CERT_CONTEXT

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;
 

Members

dwCertEncodingType
The type of encoding used on the certificate. Currently defined certificate encoding types are shown in the following table:
Encoding type Value
X509_ASN_ENCODING 0x00000001

pbCertEncoded
A pointer to the encoded certificate.
cbCertEncoded
The size, in bytes, of the encoded certificate.
pCertInfo
A pointer to a structure of certificate information.
hCertStore
A handle to the certificate store that contains the certificate context.

See Also

CERT_INFO, CRYPT_SIGN_MESSAGE_PARA, CRYPT_VERIFY_MESSAGE_PARA, CertAddCertificateContextToStore, CertAddEncodedCertificateToStore, CertCreateCertificateContext, CertEnumCertificatesInStore, CertFindCertificateInStore, CertFreeCertificateContext, CertGetIssuerCertificateFromStore, CertGetSubjectCertificateFromStore, CertVerifyRevocation, CryptVerifyMessageSignature