public virtual string Format(bool multiLine)
        {
            if ((this.m_rawData == null) || (this.m_rawData.Length == 0))
            {
                return(string.Empty);
            }
            string lpszStructType = string.Empty;

            if ((this.m_oid != null) && (this.m_oid.Value != null))
            {
                lpszStructType = this.m_oid.Value;
            }
            return(CAPI.CryptFormatObject(1, multiLine ? 1 : 0, lpszStructType, this.m_rawData));
        }
Ejemplo n.º 2
0
        public virtual string Format(bool multiLine)
        {
            // Return empty string if no data to format.
            if (m_rawData == null || m_rawData.Length == 0)
            {
                return(String.Empty);
            }

            // If OID is not present, then we can force CryptFormatObject
            // to use hex formatting by providing an empty OID string.
            string oidValue = String.Empty;

            if (m_oid != null && m_oid.Value != null)
            {
                oidValue = m_oid.Value;
            }

            return(CAPI.CryptFormatObject(CAPI.X509_ASN_ENCODING,
                                          multiLine ? CAPI.CRYPT_FORMAT_STR_MULTI_LINE : 0,
                                          oidValue,
                                          m_rawData));
        }