BCryptAddContextFunctionProvider

The BCryptAddContextFunctionProvider function adds a cryptographic function provider to the list of providers that are supported by an existing CNG context.

NTSTATUS WINAPI BCryptAddContextFunctionProvider(
  ULONG dwTable,
  LPCWSTR pszContext,
  ULONG dwInterface,
  LPCWSTR pszFunction,
  LPCWSTR pszProvider,
  ULONG dwPosition
);

Parameters

  • dwTable
    [in] Identifies the configuration table that the context exists in. This can be one of the following values.

    Value Meaning
    CRYPT_LOCAL The context exists in the local-machine configuration table.
    CRYPT_DOMAIN The context exists in the enterprise-wide configuration table.
  • pszContext
    [in] A pointer to a null-terminated Unicode string that contains the identifier of the context to add the provider to.

  • dwInterface
    [in] Identifies the cryptographic interface to add the provider to. This can be one of the following values.

    Value Meaning
    BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE Add the provider to the list of asymmetric encryption function providers.
    BCRYPT_CIPHER_INTERFACE Add the provider to the list of cipher function providers.
    BCRYPT_HASH_INTERFACE Add the provider to the list of hash function providers.
    BCRYPT_RNG_INTERFACE Add the provider to the list of random number generator function providers.
    BCRYPT_SECRET_AGREEMENT_INTERFACE Add the provider to the list of secret agreement function providers.
    BCRYPT_SIGNATURE_INTERFACE Add the provider to the list of signature function providers.
    NCRYPT_KEY_STORAGE_INTERFACE Add the provider to the list of key storage function providers.
    NCRYPT_SCHANNEL_INTERFACE Add the provider to the list of Schannel function providers.
  • pszFunction
    [in] A pointer to a null-terminated Unicode string that contains the identifier of the cryptographic function to add the provider for.

  • pszProvider
    [in] A pointer to a null-terminated Unicode string that contains the identifier of the provider to add.

  • dwPosition
    [in] Specifies the position in the list at which to insert this provider. The provider is inserted at this position ahead of any existing providers. The CRYPT_PRIORITY_TOP value is used to insert the provider at the top of the list. The CRYPT_PRIORITY_BOTTOM value is used to insert the provider at the end of the list.

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
STATUS_SUCCESS The function was successful.
STATUS_INVALID_PARAMETER One or more parameters are not valid.
STATUS_NO_MEMORY A memory allocation failure occurred.
STATUS_NOT_FOUND The specified context or function could not be found.

Requirements

Client Requires Windows Vista.
Server Requires Windows Server "Longhorn".
Header

Declared in Bcrypt.h.

Library

Use Bcrypt.lib.

DLL Requires Bcrypt.dll.

See Also

BCryptRemoveContextFunctionProvider