CertGetPublicKeyLength function
The CertGetPublicKeyLength function acquires the bit length of public/private keys from a public key BLOB.
Syntax
DWORD WINAPI CertGetPublicKeyLength( _In_ DWORD dwCertEncodingType, _In_ PCERT_PUBLIC_KEY_INFO pPublicKey );
Parameters
- dwCertEncodingType [in]
-
Specifies the encoding type used. It is always acceptable to specify both the certificate and message encoding types by combining them with a bitwise-OR operation as shown in the following example:
X509_ASN_ENCODING | PKCS_7_ASN_ENCODING
Currently defined encoding types are:
- X509_ASN_ENCODING
- PKCS_7_ASN_ENCODING
- pPublicKey [in]
-
A pointer to the public key BLOB containing the keys for which the length is being retrieved.
Return value
Returns the length of the public/private keys in bits. If unable to determine the key's length, returns zero.
Call GetLastError to see the reason for any failures.
Requirements
|
Minimum supported client |
Windows XP [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2003 [desktop apps | Windows Store apps] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also