CertDeleteCertificateFromStore

This function deletes the specified certificate context from the certificate store.

BOOL WINAPI CertDeleteCertificateFromStore(
  PCCERT_CONTEXT pCertContext
);

Parameters

  • pCertContext
    [in] Pointer to the CERT_CONTEXT structure to be deleted.

Return Values

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

OS Versions: Windows CE 3.0 and later.
Header: Wincrypt.h.
Link Library: Crypt32.lib.

See Also

CertFreeCertificateContext | CERT_CONTEXT

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.