CertDuplicateCertificateContext function

The CertDuplicateCertificateContext function duplicates a certificate context by incrementing its reference count.

Syntax

PCCERT_CONTEXT CertDuplicateCertificateContext(
  PCCERT_CONTEXT pCertContext
);

Parameters

pCertContext

A pointer to the CERT_CONTEXT structure for which the reference count is incremented.

Return Value

Currently, a copy is not made of the context, and the returned pointer to a context has the same value as the pointer to a context that was input. If the pointer passed into this function is NULL, NULL is returned. When you have finished using the duplicate context, decrease its reference count by calling the CertFreeCertificateContext function.

Requirements

   
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header wincrypt.h
Library Crypt32.lib
DLL Crypt32.dll

See Also

CertDuplicateCRLContext

CertFreeCertificateContext

Certificate Functions