Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
NCryptFinalizeKey function (ncrypt.h)
The NCryptFinalizeKey function completes a CNG key storage key. The key cannot be used until this function has been called.
Syntax
SECURITY_STATUS NCryptFinalizeKey(
[in] NCRYPT_KEY_HANDLE hKey,
[in] DWORD dwFlags
);
Parameters
[in] hKey
The handle of the key to complete. This handle is obtained by calling the NCryptCreatePersistedKey function.
[in] dwFlags
Flags that modify function behavior. This can be zero or a combination of one or more of the following values.
| Value | Meaning |
|---|---|
|
Do not validate the public portion of the key pair. This flag only applies to public/private key pairs. |
|
Also save the key in legacy storage. This allows the key to be used with CryptoAPI. This flag only applies to RSA keys. |
|
Requests that the key storage provider (KSP) not display any user interface. If the provider must display the UI to operate, the call fails and the KSP should set the NTE_SILENT_CONTEXT error code as the last error. |
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
| Requirement | Value |
|---|---|
| Minimum supported client | Windows Vista [desktop apps | UWP apps] |
| Minimum supported server | Windows Server 2008 [desktop apps | UWP apps] |
| Target Platform | Windows |
| Header | ncrypt.h |
| Library | Ncrypt.lib |
| DLL | Ncrypt.dll |
Feedback
Was this page helpful?
