CertCompareCertificateName

The CertCompareCertificateName function compares two certificate names to determine whether they are identical.

#include <wincrypt.h>
BOOL WINAPI CertCompareCertificateName(
  DWORD dwCertEncodingType,     // in
  PCERT_NAME_BLOB pCertName1,   // in
  PCERT_NAME_BLOB pCertName2    // in
);
 

Parameters

dwCertEncodingType
The type of encoding used on the certificate. Currently defined certificate encoding types are shown in the following table:
Encoding type Value
X509_ASN_ENCODING 0x00000001

pCertName1
A pointer to the CERT_NAME_BLOB for the first name in the comparison. See BLOB Structure.
pCertName2
A pointer to the CERT_NAME_BLOB for the second name in the comparison.

Return Values

TRUE if the names are identical.

Example

// EXAMPLE CODE FOR USING CertCompareCertificateName() to 
// compare two certificate names to determine whether they are identical.

// Assume that the application has a pointer to both certificate names to 
// compare (pCertName1, pCertName2) and that X509_ASN_ENCODING was 
// used to encode the certificate names.

// Set up the variables.
PCERT_NAME_BLOB pCertName1, pCertName2; // Initialized elsewhere
BOOL Return;

Return = CertCompareCertificateName(
            X509_ASN_ENCODING, pCertName1, pCertName2);

if (Return == TRUE) {
    // The certificate names are identical, continue as desired.
}
 

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later. Available also in IE 3.02 and later.
  Windows: Requires Windows 98 (or Windows 95 with IE 3.02 or later).
  Windows CE: Unsupported.
  Header: Declared in wincrypt.h.
  Import Library: Use crypt32.lib.

See Also

CertCompareCertificate