NCryptIsAlgSupported function (ncrypt.h)

The NCryptIsAlgSupported function determines if a CNG key storage provider supports a specific cryptographic algorithm.

Syntax

SECURITY_STATUS NCryptIsAlgSupported(
  [in] NCRYPT_PROV_HANDLE hProvider,
  [in] LPCWSTR            pszAlgId,
  [in] DWORD              dwFlags
);

Parameters

[in] hProvider

The handle of the key storage provider. This handle is obtained with the NCryptOpenStorageProvider function.

[in] pszAlgId

A pointer to a null-terminated Unicode string that identifies the cryptographic algorithm in question. This can be one of the standard CNG Algorithm Identifiers or the identifier for another registered algorithm.

[in] dwFlags

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

Value Meaning
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 code Description
ERROR_SUCCESS
The provider supports the specified algorithm.
NTE_BAD_FLAGS
The dwFlags parameter contains one or more flags that are not supported.
NTE_INVALID_HANDLE
The handle specified by the hProvider parameter is not valid.
NTE_INVALID_PARAMETER
One or more parameters are not valid.
NTE_NOT_SUPPORTED
The provider does not support the specified algorithm.

Remarks

If the provider supports the algorithm, this function returns ERROR_SUCCESS. If the provider does not support the algorithm, and no other errors occurred, this function returns NTE_NOT_SUPPORTED.

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