The CertEnumCRLsInStore function enumerates the CRL contexts in a certificate store.
#include <wincrypt.h>
PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(
HCERTSTORE hCertStore, // in
PCCRL_CONTEXT pPrevCrlContext // in
);
The function returns a pointer to the next CRL_CONTEXT in the store. If there are no more CRLs in the store, NULL is returned.
GetLastError may be called to indicate the reason for any failure. This function uses the following error codes:
Error code | Description |
---|---|
E_INVALIDARG | The hCertStore argument is not the same as the hCertStore of the certificate context pointed to by pPrevCertContext. |
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. |
The pPrevCrlContext parameter must be NULL to get the first CRL in the store. Successive CRLs are enumerated by setting pPrevCRlContext to the the pointer by a previous call to the function. The enumeration skips any certificates previously deleted by CertDeleteCRLFromStore.
The returned pointer is freed when it is passed as the pPrevCrlContext on a subsequent call the function. Otherwise, the pointer must 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 contest returned by this function can be made by calling CertDuplicateCRLContext.
See CertEnumCertificatesInStore. Change all references to "certificate" in that example to "CRL."
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in wincrypt.h.
Import Library: Use crypt32.lib.