CertCreateCTLContext function (wincrypt.h)
The CertCreateCTLContext function creates a certificate trust list (CTL) context from an encoded CTL. The created context is not persisted to a certificate store. The function makes a copy of the encoded CTL within the created context.
PCCTL_CONTEXT CertCreateCTLContext( [in] DWORD dwMsgAndCertEncodingType, [in] const BYTE *pbCtlEncoded, [in] DWORD cbCtlEncoded );
Specifies the type of encoding used. Both the certificate and message encoding types must 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:
A pointer to a buffer containing the encoded CTL from which the context is to be created.
The size, in bytes, of the pbCtlEncoded buffer.
If the function succeeds, the return value is a pointer to a read-only CTL_CONTEXT.
||Invalid certificate encoding type. Only PKCS_7_ASN_ENCODING and X509_ASN_ENCODING are supported.|
The CTL_CONTEXT must be freed by calling CertFreeCTLContext. CertDuplicateCTLContext can be called to make a duplicate. CertSetCTLContextProperty and CertGetCTLContextProperty can be called to store and read properties for the CTL.
|Minimum supported client||Windows XP [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2003 [desktop apps | UWP apps]|