Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

CertCompareCertificate function

The CertCompareCertificate function determines whether two certificates are identical by comparing the issuer name and serial number of the certificates.

Caution  The CertCompareCertificate function must not be used for security assertions because it does not compare BLOBs.

Syntax


BOOL WINAPI CertCompareCertificate(
  _In_  DWORD dwCertEncodingType,
  _In_  PCERT_INFO pCertId1,
  _In_  PCERT_INFO pCertId2
);

Parameters

dwCertEncodingType [in]

Specifies the encoding type used. It is always acceptable to specify both the certificate and message encoding types by combining them with a bitwise-OR operation as shown in the following example:

X509_ASN_ENCODING | PKCS_7_ASN_ENCODING

Currently defined encoding types are:

  • X509_ASN_ENCODING
  • PKCS_7_ASN_ENCODING
pCertId1 [in]

A pointer to the CERT_INFO for the first certificate in the comparison.

pCertId2 [in]

A pointer to the CERT_INFO for the second certificate in the comparison.

Return value

If the certificates are identical and the function succeeds, the function returns nonzero (TRUE).

If the function fails, it returns zero (FALSE).

Examples

For an example that uses this function, see Example C Program: Deleting Certificates from a Certificate Store.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Wincrypt.h

Library

Crypt32.lib

DLL

Crypt32.dll

See also

CertCompareCertificateName
CERT_INFO
Data Management Functions

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.