NCryptEnumAlgorithms function

The NCryptEnumAlgorithms function obtains the names of the algorithms that are supported by the specified key storage provider.

Syntax


SECURITY_STATUS WINAPI NCryptEnumAlgorithms(
  _In_  NCRYPT_PROV_HANDLE  hProvider,
  _In_  DWORD               dwAlgOperations,
  _Out_ DWORD               *pdwAlgCount,
  _Out_ NCryptAlgorithmName **ppAlgList,
  _In_  DWORD               dwFlags
);

Parameters

hProvider [in]

The handle of the key storage provider to enumerate the algorithms for. This handle is obtained with the NCryptOpenStorageProvider function.

dwAlgOperations [in]

A set of values that determine which algorithm classes to enumerate. This can be zero or a combination of one or more of the following values. If dwAlgOperations is zero, all algorithms are enumerated.

ValueMeaning
NCRYPT_CIPHER_OPERATION
0x00000001

Enumerate the cipher (symmetric encryption) algorithms.

NCRYPT_HASH_OPERATION
0x00000002

Enumerate the hashing algorithms.

NCRYPT_ASYMMETRIC_ENCRYPTION_OPERATION
0x00000004

Enumerate the asymmetric encryption algorithms.

NCRYPT_SECRET_AGREEMENT_OPERATION
0x00000008

Enumerate the secret agreement algorithms.

NCRYPT_SIGNATURE_OPERATION
0x00000010

Enumerate the digital signature algorithms.

 

pdwAlgCount [out]

The address of a DWORD that receives the number of elements in the ppAlgList array.

ppAlgList [out]

The address of an NCryptAlgorithmName structure pointer that receives an array of the registered algorithm names. The variable pointed to by the pdwAlgCount parameter receives the number of elements in this array.

When this memory is no longer needed, it must be freed by passing this pointer to the NCryptFreeBuffer function.

dwFlags [in]

Flags that modify function behavior. This can be zero (0) or the following value.

ValueMeaning
NCRYPT_SILENT_FLAG

Requests that the key service 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 codeDescription
ERROR_SUCCESS

The function was successful.

NTE_BAD_FLAGS

The dwFlags parameter contains a value that is not valid.

NTE_INVALID_HANDLE

The hProvider parameter is not valid.

NTE_INVALID_PARAMETER

One or more parameters are not valid.

NTE_NO_MEMORY

A memory allocation failure occurred.

 

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

Ncrypt.h

Library

Ncrypt.lib

DLL

Ncrypt.dll

 

 

Show: