CertDeleteCertificateFromStore
A version of this page is also available for
4/8/2010
This function deletes the specified certificate context from the certificate store.
Syntax
BOOL WINAPI CertDeleteCertificateFromStore(
PCCERT_CONTEXT pCertContext
);
Parameters
- pCertContext
[in] Pointer to the CERT_CONTEXT structure to be deleted.
Return Value
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE.
For extended error information, call the GetLastError function. The GetLastError function can return E_ACCESSDENIED, which indicates that the store was opened as read-only and a delete operation is not allowed.
Remarks
After a certificate is deleted from a store, all subsequent attempts to get or find that certificate in that store will fail. However, memory allocated for the certificate is not freed until all duplicated contexts have also been freed.
The pCertContext parameter is always freed for this function by using the CertFreeCertificateContext function, even for an error. Freeing the context reduces its reference count by one. If the reference count reaches zero, memory allocated for the certificate is freed.
Requirements
Header | wincrypt.h |
Library | crypt32.lib |
Windows Embedded CE | Windows CE 3.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |