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.”

NCryptEnumKeys with Key storage provider (KSP)

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

NCryptEnumKeys function lists the keys stored in the Key Storage Provider (KSP).

Parameters

hProvider [in]

The key storage provider handle. Use NCryptOpenStorageProvider to get this handle.

pszScope [in, unused]

Set this parameter to NULL.

ppKeyName [out]

A pointer address to an NCryptKeyName structure that stores the key name. To free this memory after use, call NCryptFreeBuffer.

ppEnumState [in, out]

A VOID pointer address that tracks the enumeration progress. The key storage provider uses this information internally to manage the enumeration sequence. To start a new enumeration from the beginning, set this pointer to NULL.

To free this memory after completing the enumeration, pass this pointer to the NCryptFreeBuffer.

dwFlags [in]

Flags to modify the function's behavior. This function has no flags.

Return Value

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

Common return codes include:

Return code Description

ERROR_SUCCESS

The operation completed successfully.

NTE_INVALID_PARAMETER

One or more parameters are not valid.

NTE_FAIL

The operation couldn't complete.

NTE_INVALID_HANDLE

The handle in hProvider is not valid.

NTE_NO_MORE_ITEMS

The enumeration has listed all available keys.

On this page

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