The CertGetCTLContextProperty function gets a property for the specified CTL context.
#include <wincrypt.h>
BOOL WINAPI CertGetCTLContextProperty(
PCCTL_CONTEXT pCtlContext, // in
DWORD dwPropId, // in
void *pvData, // out
DWORD *pcbData // in/out
);
See CertGetCertificateContextProperty for a complete list of property IDs. CERT_SHA1_HASH_PROP_ID or CERT_NEXT_UPDATE_LOCATION_PROP_ID are the predefined properties of most interest.
This parameter can be NULL to set the size of this information for memory allocation purposes. For more information, see Common In/Out Parameter Conventions.
Note When processing the data returned in the buffer, applications need to use the actual size of the data returned. The actual size may be slightly smaller than the size of the buffer specified on input. (On input, buffer sizes are usually specified large enough to ensure that the largest possible output data will fit in the buffer.) On output, the variable pointed to by this parameter is updated to reflect the actual size of the data copied to the buffer.
TRUE if the function succeeded. FALSE if the function failed.
Call GetLastError to see the reason for any failures. Note that errors from the called function CryptHashCertificate may be propagated to this function. This function has the following error codes:
Error code | Description |
---|---|
ERROR_MORE_DATA | If the buffer specified by the pvData parameter is not large enough to hold the returned data, the function sets the ERROR_MORE_DATA code, and stores the required buffer size, in bytes, into the variable pointed to by pcbData. |
CRYPT_E_NOT_FOUND | The CTL doesn't have the specified property. |
See the example for CertEnumCertificateContextProperties, and extrapolate from a certificate to a CTL ( PCCERT_CONTEXT becomes PCCTL_CONTEXT, pCertContext becomes pCTLContext, CertEnumCertificateContextProperties becomes CertEnumCTLContextProperties, and CertGetCertificateContextProperty becomes CertGetCTLContextProperty).
Windows NT: Requires version 4.0 SP3 or later. Available also in IE 3.02 and later.
Windows: Requires Windows 95 OSR2 or later.
Windows CE: Unsupported.
Header: Declared in wincrypt.h.
Import Library: Use crypt32.lib.
CertEnumCTLContextProperties, CertSetCTLContextProperty