Share via


CertSetEnhancedKeyUsage

This function sets the extended key usage (EKU) property for the certificate. Use of this function replaces any EKUs associated with the certificate. To add a single EKU usage without changing existing usages, use the CertAddEnhancedKeyUsageIdentifier function. To delete as single EKU usage, use CertRemoveEnhancedKeyUsageIdentifier function.

BOOL WINAPI CertSetEnhancedKeyUsage(
  PCCERT_CONTEXT pCertContext,
  PCERT_ENHKEY_USAGE pUsage
);

Parameters

  • pCertContext
    [in] Pointer to the CERT_CONTEXT structure of the specified certificate.
  • pUsage
    [in] Pointer to a CERT_ENHKEY_USAGE structure that contains an array of enhanced key usage OIDs to be set as extended properties of the certificate.

Return Values

If the function succeeds, the return value is nonzero, or TRUE.

If the function fails, the return value is zero, or FALSE.

For extended error information, call the GetLastError function.

Requirements

OS Versions: Windows CE 3.0 and later.
Header: Wincrypt.h.
Link Library: Crypt32.lib.

See Also

CertAddEnhancedKeyUsageIdentifier | CertGetEnhancedKeyUsage | CertRemoveEnhancedKeyUsageIdentifier | CERT_CONTEXT | CERT_ENHKEY_USAGE

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.