CertSetCTLContextProperty

The CertSetCTLContextProperty function sets a property for the specified CTL context.

#include <wincrypt.h>
BOOL WINAPI CertSetCTLContextProperty(
  PCCTL_CONTEXT pCtlContext,    // in
  DWORD dwPropId,               // in
  DWORD dwFlags,                // in
  void *pvData                  // in
);
 

Parameters

pCtlContext
Pointer to the CTL context.
dwPropId
See CertSetCertificateContextProperty for the complete list of defined IDs. Typically only the following properties will be set:
Property ID type Definition
CERT_NEXT_UPDATE_
LOCATION_PROP_ID
Typiclly, this property is implicitly set by a call to CertGetCTLContextProperty. pvData points to a CRYPT_DATA_BLOB containing an ASN_1 encoded CERT_ENHKEY_USAGE (encoded via CryptEncodeObject(
X509_ENHANCED_KEY_USAGE))

For all the other PROP_IDs, pvData points to an encoded CRYPT_DATA_BLOB.

dwFlags
See CertSetCertificateContextProperty for details about setting flags.
pvData
Pointer to a data type that is determined by the value passed in dwPropId.

Important  Setting pvData to NULL deletes the property.

Return Values

TRUE if the function succeeded. FALSE if the function failed.

Call GetLastError to see the reason for any failures. This function has the following error codes:

Error code Description
E_INVALIDARG Invalid property ID. See CertSetCertificateContextProperty for details.

Remarks

If the property already exists, then, the old value is deleted and replaced.

Example

See CertSetCertificateContextProperty.

QuickInfo

  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.

See Also

CertGetCTLContextProperty