NCryptDeleteKey function
The NCryptDeleteKey function deletes a CNG key.
Syntax
SECURITY_STATUS WINAPI NCryptDeleteKey( _In_ NCRYPT_KEY_HANDLE hKey, _In_ DWORD dwFlags );
Parameters
- hKey [in]
-
The handle of the key to delete. This handle is obtained by using the NCryptOpenKey function.
Note The NCryptDeleteKey function frees the handle. Applications must not use the handle or attempt to call the NCryptFreeObject function on it after calling the NCryptDeleteKey function. - dwFlags [in]
-
Flags that modify function behavior. This can be zero or a combination of values that is specific to each key storage provider.
Return value
Returns a status code that indicates the success or failure of the function.
Possible return codes include, but are not limited to, the following.
| Return code | Description |
|---|---|
|
The function was successful. |
|
The dwFlags parameter contains a value that is not valid. |
|
The hKey parameter is not valid. |
Remarks
A service must not call this function from its StartService Function. If a service calls this function from its StartService function, a deadlock can occur, and the service may stop responding.
Requirements
|
Minimum supported client |
Windows Vista [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2008 [desktop apps | Windows Store apps] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also