9 private string m_distinguishedName;
17 if (m_distinguishedName ==
null)
21 return m_distinguishedName;
26 : base(new
Oid(), encodedDistinguishedNameBlob)
33 : base(new
Oid(), encodedDistinguishedName)
40 : base(encodedDistinguishedName)
47 : base(distinguishedName)
49 m_distinguishedName = distinguishedName.
Name;
63 : base(new
Oid(), Encode(distinguishedName, flag))
65 m_distinguishedName = distinguishedName;
74 uint dwStrType = 3 | MapNameToStrFlag(flag);
75 byte[] rawData = m_rawData;
76 byte[] array = rawData;
77 fixed (
byte* value = array)
79 CAPIBase.CRYPTOAPI_BLOB cRYPTOAPI_BLOB =
default(CAPIBase.CRYPTOAPI_BLOB);
81 cRYPTOAPI_BLOB.cbData = (uint)rawData.Length;
82 cRYPTOAPI_BLOB.pbData =
new IntPtr(value);
83 uint num = CAPISafe.CertNameToStrW(65537u, pName, dwStrType, SafeLocalAllocHandle.InvalidHandle, 0u);
88 using (SafeLocalAllocHandle safeLocalAllocHandle = CAPI.LocalAlloc(64u,
new IntPtr(2 * num)))
90 if (CAPISafe.CertNameToStrW(65537u, pName, dwStrType, safeLocalAllocHandle, num) == 0)
103 public override string Format(
bool multiLine)
105 if (m_rawData ==
null || m_rawData.Length == 0)
109 return CAPI.CryptFormatObject(1u, multiLine ? 1u : 0u,
new IntPtr(7
L), m_rawData);
114 if (distinguishedName ==
null)
118 uint pcbEncoded = 0u;
119 uint dwStrType = 3 | MapNameToStrFlag(flag);
124 byte[] array =
new byte[pcbEncoded];
125 byte[] array2 = array;
126 fixed (
byte* value = array2)
128 if (!CAPISafe.CertStrToNameW(65537u, distinguishedName, dwStrType,
IntPtr.
Zero,
new IntPtr(value), ref pcbEncoded,
IntPtr.
Zero))
139 if (((
int)flag & (
int)(~num)) != 0)
The exception that is thrown when an error occurs during a cryptographic operation.
X500DistinguishedNameFlags
Specifies characteristics of the X.500 distinguished name.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Represents Abstract Syntax Notation One (ASN.1)-encoded data.
Represents a cryptographic object identifier. This class cannot be inherited.
X500DistinguishedName(AsnEncodedData encodedDistinguishedName)
Initializes a new instance of the T:System.Security.Cryptography.X509Certificates....
X500DistinguishedName(X500DistinguishedName distinguishedName)
Initializes a new instance of the T:System.Security.Cryptography.X509Certificates....
Represents the distinguished name of an X509 certificate. This class cannot be inherited.
string Name
Gets the comma-delimited distinguished name from an X500 certificate.
A platform-specific type that is used to represent a pointer or a handle.
Provides a collection of methods for allocating unmanaged memory, copying unmanaged memory blocks,...
unsafe string Decode(X500DistinguishedNameFlags flag)
Decodes a distinguished name using the characteristics specified by the flag parameter.
override string Format(bool multiLine)
Returns a formatted version of an X500 distinguished name for printing or for output to a text window...
static CultureInfo CurrentCulture
Gets or sets the T:System.Globalization.CultureInfo object that represents the culture used by the cu...
static unsafe string PtrToStringUni(IntPtr ptr, int len)
Allocates a managed T:System.String and copies a specified number of characters from an unmanaged Uni...
static readonly IntPtr Zero
A read-only field that represents a pointer or handle that has been initialized to zero.
X500DistinguishedName(string distinguishedName)
Initializes a new instance of the T:System.Security.Cryptography.X509Certificates....
Provides information about a specific culture (called a locale for unmanaged code development)....
static int GetLastWin32Error()
Returns the error code returned by the last unmanaged function that was called using platform invoke ...
X500DistinguishedName(byte[] encodedDistinguishedName)
Initializes a new instance of the T:System.Security.Cryptography.X509Certificates....
X500DistinguishedName(string distinguishedName, X500DistinguishedNameFlags flag)
Initializes a new instance of the T:System.Security.Cryptography.X509Certificates....
The distinguished name is reversed.