Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 1.28 KB

File metadata and controls

49 lines (33 loc) · 1.28 KB

Home

Function name : CryptDestroyKey

Group: Cryptography Reference - Library: advapi32


Releases the handle referenced by the hKey parameter. After a key handle has been released, it becomes invalid and cannot be used again.


Code examples:

CryptoAPI: Collection of Providers class
A class that encrypts and decrypts files using Cryptography API Functions
Generating random cryptographic keys

Declaration:

BOOL WINAPI CryptDestroyKey(
	HCRYPTKEY hKey
);  

FoxPro declaration:

DECLARE INTEGER CryptDestroyKey IN advapi32;
	INTEGER hKey  

Parameters:

hKey [in] Handle of the key to be destroyed.


Return value:

If the function succeeds, the return value is nonzero (TRUE).


Comments:

Keys take up both operating system"s memory space and the CSP"s memory space. Some CSPs are implemented in hardware with limited memory resources. Applications must destroy all keys with the CryptDestroyKey function when they are finished with them.