Group: Cryptography Reference - Library: advapi32
Generating random cryptographic keys
BOOL WINAPI CryptImportKey(
_In_ HCRYPTPROV hProv,
_In_ BYTE *pbData,
_In_ DWORD dwDataLen,
_In_ HCRYPTKEY hPubKey,
_In_ DWORD dwFlags,
_Out_ HCRYPTKEY *phKey
); DECLARE INTEGER CryptImportKey IN advapi32;
INTEGER hProv,;
STRING @pbData,;
INTEGER dwDataLen,;
INTEGER hPubKey,;
INTEGER dwFlags,;
INTEGER @phKey hProv [in] The handle of a CSP obtained with the CryptAcquireContext function.
pbData [in] A BYTE array that contains a PUBLICKEYSTRUC BLOB header followed by the encrypted key.
dwDataLen [in] Contains the length, in bytes, of the key BLOB.
hPubKey [in] A handle to the cryptographic key that decrypts the key stored in pbData.
dwFlags [in] Currently used only when a public/private key pair in the form of a PRIVATEKEYBLOB is imported into the CSP.
phKey [out] A pointer to a HCRYPTKEY value that receives the handle of the imported key.
If the function succeeds, the function returns nonzero.
When you have finished using the key, release the handle by calling the CryptDestroyKey function.
See also: CryptGenKey, CryptExportKey.
Home