The CertCompareCertificate function compares two certificates to determine whether they are identical.
#include <wincrypt.h>
BOOL WINAPI CertCompareCertificate(
DWORD dwCertEncodingType, // in
PCERT_INFO pCertId1, // in
PCERT_INFO pCertId2 // in
);
Encoding type | Value |
---|---|
X509_ASN_ENCODING | 0x00000001 |
TRUE if the certificates are identical.
// EXAMPLE CODE FOR USING CertCompareCertificate() to
// compare two certificates to determine whether they are identical.
// Assume that the application has a pointer to both certificates to
// compare (pCertId1, pCertId2) and that X509_ASN_ENCODING was used to
// encode the certificates.
// Set up the variables.
PCERT_INFO pCertId1, pCertId2; // Initialized elsewhere
BOOL Return;
Return = CertCompareCertificate(
X509_ASN_ENCODING, pCertId1, pCertId2);
if (Return == TRUE) {
// The certificates are identical, continue as desired.
}
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.