EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

PCRYPT_ENCRYPT_PRIVATE_KEY_FUNC function pointer

[The PCRYPT_ENCRYPT_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_ENCRYPT_PRIVATE_KEY_FUNC function encrypts the private key and returns the encrypted contents in the pbEncryptedKey parameter. It is a callback function identified in a CRYPT_PKCS8_EXPORT_PARAMS structure that creates a PKCS #8 CRYPT_ENCRYPTED_PRIVATE_KEY_INFO structure. The function must be implemented by the developer to suit each application.

Syntax


typedef BOOL ( CALLBACK *PCRYPT_ENCRYPT_PRIVATE_KEY_FUNC)(
  _Out_   CRYPT_ALGORITHM_IDENTIFIER *pAlgorithm,
  _In_    CRYPT_DATA_BLOB            *pClearTextPrivateKey,
  _Out_   BYTE                       *pbEncryptedKey,
  _Inout_ DWORD                      *pcbEncryptedKey,
  _In_    LPVOID                     pVoidEncryptFunc
);

Parameters

pAlgorithm [out]

A pointer to a CRYPT_ALGORITHM_IDENTIFIER structure to receive the algorithm used to encrypt the PrivateKeyInfo ASN.1 type found in the PKCS #8 standard.

pClearTextPrivateKey [in]

A pointer to a CRYPT_DATA_BLOB structure that contains the plaintext private key to be encrypted.

pbEncryptedKey [out]

A pointer to a BYTE buffer to receive the encrypted private key BLOB. If this parameter is NULL, pcbEncryptedKey will return the size, in bytes, of memory needed to contain the encrypted key on a subsequent call to this function.

pcbEncryptedKey [in, out]

A pointer to a DWORD variable that contains the size, in bytes, of the pbEncryptedKey buffer. If pbEncryptedKey is NULL, then pcbEncryptedKey is set to the size, in bytes, required to encrypt the key. For more information, see Retrieving Data of Unknown Length.

pVoidEncryptFunc [in]

An LPVOID variable that contains data used for encryption, 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

Wincrypt.h

See also

CRYPT_PKCS8_EXPORT_PARAMS
PCRYPT_DECRYPT_PRIVATE_KEY_FUNC

 

 

Afficher: