CertCreateCRLContext

The CertCreateCRLContext function creates a CRL context from an encoded CRL. The created context is not put into a certificate store. It makes a copy of the encoded CRL within the created context.

#include <wincrypt.h>
PCCRL_CONTEXT WINAPI CertCreateCRLContext(
  DWORD dwCertEncodingType,           // in
  const BYTE *pbCrlEncoded,           // in
  DWORD cbCrlEncoded                  // in
);
 

Parameters

dwCertEncodingType
The type of encoding used on the certificate. Currently defined certificate encoding types are shown in the following table:
Encoding type Value
X509_ASN_ENCODING 0x00000001

pbCrlEncoded
A pointer to the encoded CRL from which the context is to be created.
cbCrlEncoded
The size, in bytes, of the encoded CRL.

Return Values

If unable to decode and create the CRL_CONTEXT, NULL is returned. Otherwise, a pointer to a read-only CRL_CONTEXT is returned.

Call GetLastError to see the reason for any failures. This function has the following error codes:

Error code Description
E_INVALIDARG Invalid certificate encoding type. Currently only X509_ASN_ENCODING is supported.
CRYPT_E_OSS_ERROR ASN.1 decoding error. Note, to get the OSS error subtract CRYPT_E_OSS_ERROR from the returned error and see asn1code.h for details on the error.

Remarks

The CRL_CONTEXT must be freed by calling CertFreeCRLContext. CertDuplicateCRLContext can be called to make a duplicate. CertSetCRLContextProperty and CertGetCRLContextProperty can be called to store and read properties for the CRL.

Example

See CertCreateCertificateContext. In that example, change all references to "certificate" to "CRL."

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later. Available also in IE 3.02 and later.
  Windows: Requires Windows 95 OSR2 or later.
  Windows CE: Unsupported.
  Header: Declared in wincrypt.h.
  Import Library: Use crypt32.lib.

See Also

CertCreateCertificateContext, CertCreateCTLContext