Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

NCryptDeleteKey with Key storage provider (KSP)

Focus mode
NCryptDeleteKey with Key storage provider (KSP) - AWS CloudHSM

The NCryptDeleteKey function deletes a KSP key from the Key Storage Provider (KSP).

Parameters

hKey [in]

The handle of the key to delete.

dwFlags [in]

Flags to modify the function's behavior. You can use zero or more of the following values:

Value Meaning

NCRYPT_SILENT_FLAG

This flag has no effect.

Return Value

The function returns a status code to indicate success or failure.

Common return codes include:

Return code Description

ERROR_SUCCESS

The function was successful.

NTE_INVALID_PARAMETER

One or more parameters are not valid.

NTE_BAD_FLAGS

The dwFlags parameter contains an invalid value.

NTE_FAIL

The operation couldn't complete.

NTE_INVALID_HANDLE

The handle in hKey is not valid.

NTE_INTERNAL_ERROR

A internal error happened when deleting key.

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.