[DllImport("crypt32.dll", EntryPoint = "CertGetNameString", CharSet = CharSet.Auto, SetLastError = true)]
static extern System.UInt32 CertGetNameString(IntPtr CertContext, System.UInt32 lType, System.UInt32 lFlags, IntPtr pTypeParameter, System.Text.StringBuilder str, System.UInt32 cch);
Declare Function CertGetNameString Lib "crypt32.dll" (TODO) As TODO
const uint CERT_NAME_EMAIL_TYPE = 1;
const uint CERT_NAME_RDN_TYPE = 2;
const uint CERT_NAME_ATTR_TYPE = 3;
const uint CERT_NAME_SIMPLE_DISPLAY_TYPE = 4;
const uint CERT_NAME_FRIENDLY_DISPLAY_TYPE = 5;
const uint CERT_NAME_DNS_TYPE = 6;
const uint CERT_NAME_URL_TYPE = 7;
const uint CERT_NAME_UPN_TYPE = 8;
const uint CERT_NAME_ISSUER_FLAG = 0x1;
const uint CERT_NAME_DISABLE_IE4_UTF8_FLAG = 0x00010000;
Do you know one? Please contribute it!
None.
Please add some!
while ((certContext = CertEnumCertificatesInStore(hCertStore, certContext)) != IntPtr.Zero)
{
StringBuilder Buffer = new StringBuilder(255);
UInt32 cchString = 255 ;
System.UInt32 nChars = CertGetNameString(certContext,
CERT_NAME_FRIENDLY_DISPLAY_TYPE,
CERT_NAME_ISSUER_FLAG,
IntPtr.Zero,
Buffer,
cchString);
// use Buffer.ToString() to use the cert's name string
}