CertEnumCRLsInStore function (wincrypt.h)

The CertEnumCRLsInStore function retrieves the first or next certificate revocation list (CRL) context in a certificate store. Used in a loop, this function can retrieve in sequence all CRL contexts in a certificate store.

Syntax

PCCRL_CONTEXT CertEnumCRLsInStore(
  [in] HCERTSTORE    hCertStore,
  [in] PCCRL_CONTEXT pPrevCrlContext
);

Parameters

[in] hCertStore

Handle of a certificate store.

[in] pPrevCrlContext

A pointer to the previous CRL_CONTEXT structure found. The pPrevCrlContext parameter must be NULL to get the first CRL in the store. Successive CRLs are enumerated by setting pPrevCrlContext to the pointer returned by a previous call to the function. This function frees the CRL_CONTEXT referenced by non-NULL values of this parameter. The enumeration skips any CRLs previously deleted by CertDeleteCRLFromStore.

Return value

If the function succeeds, the return value is a pointer to the next CRL_CONTEXT in the store.

NULL is returned if the function fails. For extended error information, call GetLastError. Some possible error codes follow.

Return code Description
E_INVALIDARG
The handle in the hCertStore parameter is not the same as that in the certificate context pointed to by pPrevCrlContext.
CRYPT_E_NOT_FOUND
No CRL was found. This happens if the store is empty or the end of the store's list is reached.

Remarks

The returned pointer is freed when it is passed as the pPrevCrlContext on a subsequent call to the function. Otherwise, the pointer must explicitly be freed by calling CertFreeCRLContext. A pPrevCrlContext that is not NULL is always freed when passed to this function through a call to CertFreeCRLContext, even if the function itself returns an error.

A duplicate of the CRL context returned by this function can be made by calling CertDuplicateCRLContext.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header wincrypt.h
Library Crypt32.lib
DLL Crypt32.dll

See also

CRL_CONTEXT

CertDeleteCRLFromStore

CertDuplicateCRLContext

CertFindCRLInStore

CertFreeCRLContext

Certificate Revocation List Functions

GetLastError