CertAddEnhancedKeyUsageIdentifier function (wincrypt.h)

The CertAddEnhancedKeyUsageIdentifier function adds a usage identifier object identifier (OID) to the enhanced key usage (EKU) extended property of the certificate.


BOOL CertAddEnhancedKeyUsageIdentifier(
  [in] PCCERT_CONTEXT pCertContext,
  [in] LPCSTR         pszUsageIdentifier


[in] pCertContext

A pointer to the CERT_CONTEXT of the certificate for which the usage identifier is to be added.

[in] pszUsageIdentifier

Specifies the usage identifier OID to add.

Return value

If the function succeeds, the function returns nonzero (TRUE).

If the function fails, it returns zero (FALSE). For extended error information, call GetLastError.


Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header wincrypt.h
Library Crypt32.lib
DLL Crypt32.dll

See also


Enhanced Key Usage Functions