Expand Minimize

CertCreateCRLContext function

The CertCreateCRLContext function creates a certificate revocation list (CRL) context from an encoded CRL. The created context is not persisted to a certificate store. It makes a copy of the encoded CRL within the created context.

Syntax


PCCRL_CONTEXT WINAPI CertCreateCRLContext(
  _In_  DWORD dwCertEncodingType,
  _In_  const BYTE *pbCrlEncoded,
  _In_  DWORD cbCrlEncoded
);

Parameters

dwCertEncodingType [in]

Specifies the type of encoding 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
pbCrlEncoded [in]

A pointer to a buffer containing the encoded CRL from which the context is to be created.

cbCrlEncoded [in]

The size, in bytes, of the pbCrlEncoded buffer.

Return value

If the function succeeds, the return value is a pointer to a read-only CRL_CONTEXT.

If the function fails and is unable to decode and create the CRL_CONTEXT, the return value is NULL. For extended error information, call GetLastError. The following table shows a possible error code.

Return codeDescription
E_INVALIDARG

Invalid certificate encoding type. Currently, only the encoding type X509_ASN_ENCODING is supported.

 

If the function fails, GetLastError may return an Abstract Syntax Notation One (ASN.1) encoding/decoding error. For information about these errors, see ASN.1 Encoding/Decoding Return Values.

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.

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

Certificate Revocation List Functions
CertCreateCertificateContext
CertCreateCTLContext
CertDuplicateCRLContext
CertFreeCRLContext
CertGetCRLContextProperty
CertSetCRLContextProperty
CRL_CONTEXT

 

 

Community Additions

ADD
Show:
© 2014 Microsoft