This function acquires the intended key usage bytes from a certificate. The intended key usage can be in either the szOID_KEY_USAGE ("220.127.116.11") or szOID_KEY_ATTRIBUTES ("18.104.22.168") extension.
BOOL WINAPI CertGetIntendedKeyUsage( DWORD dwCertEncodingType, PCERT_INFO pCertInfo, BYTE *pbKeyUsage, DWORD cbKeyUsage );
- [in] Specifies the encoding type used. Currently, only X509_ASN_ENCODING is used; however, additional encoding types may be added in the future.
- [in] Pointer to the CERT_INFO structure of the specified certificate.
- [in] Pointer to a buffer containing the intended key usage. The following list shows the currently defined values, which can be combined using bitwise OR operations:
- [in] Size, in bytes, of the intended key usage. Currently, the intended key usage occupies only 1 byte of data.
If the certificate does not have any intended key usage bytes, FALSE is returned and the pbKeyUsage parameter is set to zero. Otherwise, TRUE is returned and up to the cbKeyUsage number of bytes are copied into the pbKeyUsage parameter. Any remaining bytes not copied are set to zero.
For extended error information, call the GetLastError function. This function has the following error code.
|ERROR_FILE_NOT_FOUND||Invalid certificate encoding type. Currently only X509_ASN_ENCODING is supported.|
The desktop platform supports the PKCS_7_ASN_ENCODING flag, but Windows CE does not. Windows CE ignores the flag when it is specified.
|Runs on||Versions||Defined in||Include||Link to|
|Windows CE OS||3.0 or later||Wincrypt.h||Crypt32.lib|
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
Last updated on Tuesday, July 13, 2004
© 1992-2000 Microsoft Corporation. All rights reserved.