[This is preliminary documentation and subject to change.]
The CertAddCRLLinkToStore function adds a link in a store to a CRL context in a different store. Instead of creating and adding a duplicate of the CRL, this function adds a link to the original CRL context wherever it may be. Since the link provides access to an original CRL context, setting an extended property in the linked CRL context changes the property as seen in the CRL's original location and by any other links to that CRL.
#include <wincrypt.h>
BOOL WINAPI CertAddCRLLinkToStore(
HCERTSTORE hCertStore, // in
PCCRL_CONTEXT pCRLContext, // in
DWORD dwAddDisposition, // in
PCCRL_CONTEXT *ppStoreContext // out optional
);
If a matching CRL or a link to a matching CRL is not found in the store, a new link is added to the store.
TRUE if the function succeeded. FALSE if the function failed.
GetLastError returns the code for any failures using the following error codes:
Error code | Description |
---|---|
CRYPT_E_EXISTS | For a dwAddDisposition of CERT_STORE_ADD_NEW, the CTL already exists in the store. |
E_INVALIDARG | Invalid add disposition specified by the dwAddDisposition argument. |
Links cannot be added to a store that is opened as a collection. Stores opened as collections include all stores opened with CertOpenSystemStore or CertOpenStore using CERT_STORE_PROV_SYSTEM or CERT_STORE_PROV_COLLECTION. Also see CertAddStoreToCollection.
If links are used and CertCloseStore is called with CERT_CLOSE_STORE_FORCE_FLAG, the store using links must be closed before the store containing the original contexts can be closed. If CERT_CLOSE_STORE_FORCE_FLAG is not used, the two stores may be closed in either order.
See the example with CertAddCertificateLinkToStore. This example will hold for CertAddCRLLinkToStore if all the references to "certificate" are changed 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.
CertOpenSystemStore, CertAddStoreToCollection, CertAddCTLLinkToStore, CertAddCertificateLinkToStore, CertFreeCRLContext