Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

CertDeleteCertificateFromStore function

The CertDeleteCertificateFromStore function deletes the specified certificate context from the certificate store.

Syntax


BOOL WINAPI CertDeleteCertificateFromStore(
  _In_  PCCERT_CONTEXT pCertContext
);

Parameters

pCertContext [in]

A 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 GetLastError. One possible error code is the following.

Return codeDescription
E_ACCESSDENIED

Indicates 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 CertDeleteCertificateFromStore function always frees pCertContext by calling the CertFreeCertificateContext function, even if an error is encountered. Freeing the context reduces the context's reference count by one. If the reference count reaches zero, memory allocated for the certificate is freed.

Examples

For an example that uses this function, see Example C Program: Deleting Certificates from a Certificate Store.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Wincrypt.h

Library

Crypt32.lib

DLL

Crypt32.dll

See also

Certificate Functions
CertDeleteCRLFromStore
CertFreeCertificateContext

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.