Discussion:
Usage of CertVerifyRevocation
(too old to reply)
Ghazanfar Ali
2005-10-21 06:04:52 UTC
Permalink
Hello Everyone,
Can anyone please tell me that way or the link, that how can i use
CertVerifyRevocation function to check the revocation of some certificate.
If some one can provide a small example showing the usage and parameter
passing to CertVerifyRevocation API. I have used it as :
DWORD encodingtype = X509_ASN_ENCODING | PKCS_7_ASN_ENCODING;

DWORD revocationType = CERT_CONTEXT_REVOCATION_TYPE;

DWORD noOfCerts = 1;

PVOID * dwCertPtr = new PVOID[1];

dwCertPtr[0] = &m_Certificate;

DWORD revocationFlags = CERT_VERIFY_REV_CHAIN_FLAG;

PCERT_REVOCATION_STATUS revocationStatus = 0;

BOOL b =
CertVerifyRevocation(encodingtype,revocationType,noOfCerts,dwCertPtr,revocationFlags,NULL,revocationStatus);

where m_Certificate is of type CERT_CONTEXT, it is throwing the exception.
Please some one can help me in this regard. Thanks in advance.

From,

Ghazanfar
k***@gmail.com
2016-02-24 07:33:17 UTC
Permalink
The problem in the above code is revocationStatus.cbSize is not filled in before calling CertVerifyRevocation. Change the revocationStatus declaration as below:
CERT_REVOCATION_STATUS revocationStatus;
revocationStatus.cbSize = sizeof(CERT_REVOCATION_STATUS);

Then pass &revocationStatus instead of revocationStatus in CertVerifyRevocation call.
Loading...