[DllImport("crypt32.dll", SetLastError=true)]
public static extern bool CertVerifyCRLRevocation(
uint dwCertEncodingType,
IntPtr pCertId,
uint cCrlInfo,
[In, MarshalAs(UnmanagedType.LPArray,SizeParamIndex=2)]
IntPtr[] rgpCrlInfo);
Declare Function CertVerifyCRLRevocation Lib "crypt32.dll" (TODO) As TODO
CRL_CONTEXT
CERT_CONTEXT
None.
Better use CertFindCertificateInCRL
IntPtr crlContext = CertCreateCRLContext(...)
IntPtr certContext = CertFindCertificateInStore(...)
// Extract CRL_INFO
CRL_CONTEXT crlCtx = (CRL_CONTEXT) Marshal.PtrToStructure(crlContext, typeof(CRL_CONTEXT));
IntPtr[] arrCrlInf = new IntPtr[1];
arrCrlInf[0] = crlCtx.pCrlInfo;
// Extract CERT_INFO
CERT_CONTEXT certCtx = (CERT_CONTEXT) Marshal.PtrToStructure(certContext, typeof(CERT_CONTEXT));
if(! CertVerifyCRLRevocation(0x00010001, // X509_ASN_ENCODING | PKCS_7_ASN_ENCODING
certCtx.pCertInfo, 1, arrCrlInf))
{
// Certificate is in CRL
}
else
{
// Certificate is not in CRL
}
Do you know one? Please contribute it!