The CERT_CONTEXT structure contains both the encoded and decoded representations of a certificate. A certificate context returned by one of the functions defined in Wincrypt.h must be freed by calling the CertFreeCertificateContext function. The CertDuplicateCertificateContext function can be called to make a duplicate copy (which also must be freed by calling CertFreeCertificateContext).
typedef struct _CERT_CONTEXT {
    DWORD         dwCertEncodingType;
    BYTE*         pbCertEncoded;
    DWORD         cbCertEncoded;
    PCERT_INFO    pCertInfo;
    HCERTSTORE    hCertStore;
} CERT_CONTEXT,  *PCERT_CONTEXT;
typedef const CERT_CONTEXT *PCCERT_CONTEXT;
 | Encoding type | Value | 
|---|---|
| X509_ASN_ENCODING | 0x00000001 | 
CERT_INFO, CRYPT_SIGN_MESSAGE_PARA, CRYPT_VERIFY_MESSAGE_PARA, CertAddCertificateContextToStore, CertAddEncodedCertificateToStore, CertCreateCertificateContext, CertEnumCertificatesInStore, CertFindCertificateInStore, CertFreeCertificateContext, CertGetIssuerCertificateFromStore, CertGetSubjectCertificateFromStore, CertVerifyRevocation, CryptVerifyMessageSignature