PCRYPT_DECRYPT_PRIVATE_KEY_FUNC function pointer
[The PCRYPT_DECRYPT_PRIVATE_KEY_FUNC function is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]
The PCRYPT_DECRYPT_PRIVATE_KEY_FUNC function decrypts the private key and returns the decrypted key in the pbClearTextKey parameter. PCRYPT_DECRYPT_PRIVATE_KEY_FUNC is a callback function specified in a CRYPT_PKCS8_IMPORT_PARAMS structure. It is used when a CRYPT_ENCRYPTED_PRIVATE_KEY_INFO structure contains a private key that needs to be decrypted. The CryptImportPKCS8 function uses this function. The function must be implemented by the developer to suit each application.
Syntax
typedef BOOL ( CALLBACK *PCRYPT_DECRYPT_PRIVATE_KEY_FUNC)(
_In_ CRYPT_ALGORITHM_IDENTIFIER Algorithm,
_In_ CRYPT_DATA_BLOB EncryptedPrivateKey,
_Out_ BYTE *pbClearTextKey,
_Inout_ DWORD *pcbClearTextKey,
_In_ LPVOID pVoidDecryptFunc
);
Parameters
- Algorithm [in]
-
A CRYPT_ALGORITHM_IDENTIFIER structure that identifies the algorithm used to encrypt the PrivateKeyInfo ASN.1 type found in the PKCS #8 standard.
- EncryptedPrivateKey [in]
-
A CRYPT_DATA_BLOB value that identifies the encrypted private key BLOB.
- pbClearTextKey [out]
-
A pointer to a BYTE buffer to receive the plaintext. This parameter can be NULL. For more information, see Retrieving Data of Unknown Length.
- pcbClearTextKey [in, out]
-
A pointer to a DWORD value that identifies the size, in bytes, of the pbClearTextKey buffer. If the size is zero, then pcbClearTextKey should be filled with the size, in bytes, required to decrypt the key, and pbClearTextKey should be ignored.
- pVoidDecryptFunc [in]
-
An LPVOID value that provides data used in decryption, such as key, initialization vector, and password.
Return value
If the function succeeds, the function returns nonzero (TRUE).
If the function fails, it returns zero (FALSE).
Requirements
|
Minimum supported client |
Windows XP [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2003 [desktop apps only] |
|
Header |
|
See also