Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

CertVerifyCRLRevocation (crypt32)
 
.
Summary
The CertVerifyCRLRevocation function check a CRL to determine whether a subject's certificate has or has not been revoked. The new Certificate Chain Verification Functions are recommended instead of the use of this function.

C# Signature:

[DllImport("crypt32.dll", SetLastError=true)]
public static extern bool CertVerifyCRLRevocation(
    uint    dwCertEncodingType,
    IntPtr    pCertId,
    uint    cCrlInfo,
    [In, MarshalAs(UnmanagedType.LPArray,SizeParamIndex=2)]
    IntPtr[] rgpCrlInfo);

VB Signature:

Declare Function CertVerifyCRLRevocation Lib "crypt32.dll" (TODO) As TODO

User-Defined Types:

CRL_CONTEXT

CERT_CONTEXT

Notes:

None.

Tips & Tricks:

Better use CertFindCertificateInCRL

Sample Code:

    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
    }

Alternative Managed API:

Do you know one? Please contribute it!

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions