CTL_CONTEXT

The CTL_CONTEXT structure. A CTL context contains both the encoded and decoded representations of a CTL. It also contains an opened HCRYPTMSG handle to the decoded cryptographic signed message containing the CTL_INFO as its inner content.

The CryptMsg APIs can be used to extract additional signer information.

A CTL context returned by a certificate store function must be freed by calling the CertFreeCTLContext function. The CertDuplicateCTLContext function can be called to make a duplicate copy (which also must be freed by calling CertFreeCTLContext).

typedef struct _CTL_CONTEXT {
    DWORD           dwMsgAndCertEncodingType;
    BYTE*           pbCtlEncoded;
    DWORD           cbCtlEncoded;
    PCTL_INFO       pCtlInfo;
    HCERTSTORE      hCertStore;
    HCRYPTMSG       hCryptMsg;
    BYTE*           pbCtlContent;
    DWORD           cbCtlContent;
} CTL_CONTEXT,     *PCTL_CONTEXT;
typedef const CTL_CONTEXT *PCCTL_CONTEXT;
 

Members

dwMsgAndCertEncodingType
The type of encoding used. Note that both a certificate and message encoding type is required to be specified by combining them with a bitwise OR operation as shown in the following example:
X509_ASN_ENCODING | PKCS_7_ASN_ENCODING
 

Currently defined encoding types are shown in the following table.
Encoding type Value
X509_ASN_ENCODING 0x00000001
PKCS_7_ASN_ENCODING 0x00010000

pbCtlEncoded
A pointer to the encoded CTL.
cbCtlEncoded
The size, in bytes, of the encoded CTL.
pCrtInfo
A pointer to a structure of CTL information.
hCertStore
A handle to the certificate store.
hCryptMsg
An opened HCRYPTMSG handle to the decoded cryptographic signed message containing the CTL_INFO as its inner content.
pbCtlContent
The encoded inner content of the signed message.
cbCtlContent
The count, in bytes, of pbCtlContent.

See Also

CTL_INFO, CertAddCTLContextToStore, CertAddEncodedCTLToStore, CertCreateCTLContext, CertEnumCTLsInStore, CertFindCTLInStore, CertFindSubjectInCTL, CertFreeCTLContext, CryptMsgGetAndVerifySigner, CryptMsgSignCTL