Skip to content

Latest commit

 

History

History
301 lines (246 loc) · 8.95 KB

nf-bcrypt-bcryptquerycontextfunctionconfiguration.md

File metadata and controls

301 lines (246 loc) · 8.95 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:bcrypt.BCryptQueryContextFunctionConfiguration
BCryptQueryContextFunctionConfiguration function (bcrypt.h)
Obtains the cryptographic function configuration information for an existing CNG context.
BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE
BCRYPT_CIPHER_INTERFACE
BCRYPT_HASH_INTERFACE
BCRYPT_RNG_INTERFACE
BCRYPT_SECRET_AGREEMENT_INTERFACE
BCRYPT_SIGNATURE_INTERFACE
BCryptQueryContextFunctionConfiguration
BCryptQueryContextFunctionConfiguration function [Security]
CRYPT_DOMAIN
CRYPT_LOCAL
NCRYPT_KEY_STORAGE_INTERFACE
NCRYPT_SCHANNEL_INTERFACE
bcrypt/BCryptQueryContextFunctionConfiguration
security.bcryptquerycontextfunctionconfiguration
security\bcryptquerycontextfunctionconfiguration.htm
security
4eea9efe-bf45-4926-86fc-9b12b6d292cd
12/05/2018
BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE, BCRYPT_CIPHER_INTERFACE, BCRYPT_HASH_INTERFACE, BCRYPT_RNG_INTERFACE, BCRYPT_SECRET_AGREEMENT_INTERFACE, BCRYPT_SIGNATURE_INTERFACE, BCryptQueryContextFunctionConfiguration, BCryptQueryContextFunctionConfiguration function [Security], CRYPT_DOMAIN, CRYPT_LOCAL, NCRYPT_KEY_STORAGE_INTERFACE, NCRYPT_SCHANNEL_INTERFACE, bcrypt/BCryptQueryContextFunctionConfiguration, security.bcryptquerycontextfunctionconfiguration
bcrypt.h
Windows
Windows Vista [desktop apps only]
Windows Server 2008 [desktop apps only]
Bcrypt.lib
Bcrypt.dll
Windows
19H1
BCryptQueryContextFunctionConfiguration
bcrypt/BCryptQueryContextFunctionConfiguration
c++
APIRef
kbSyntax
DllExport
Bcrypt.dll
BCryptQueryContextFunctionConfiguration

BCryptQueryContextFunctionConfiguration function

-description

[BCryptQueryContextFunctionConfiguration is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

The BCryptQueryContextFunctionConfiguration function obtains the cryptographic function configuration information for an existing CNG context.

-parameters

-param 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
This value is not available for use.

-param pszContext [in]

A pointer to a null-terminated Unicode string that contains the identifier of the context to obtain the function configuration information for.

-param dwInterface [in]

Identifies the cryptographic interface to obtain the function configuration information for. This can be one of the following values.

Value Meaning
BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE
Obtain the function configuration information from the list of asymmetric encryption functions.
BCRYPT_CIPHER_INTERFACE
Obtain the function configuration information from the list of cipher functions.
BCRYPT_HASH_INTERFACE
Obtain the function configuration information from the list of hash functions.
BCRYPT_RNG_INTERFACE
Obtain the function configuration information from the list of random number generator functions.
BCRYPT_SECRET_AGREEMENT_INTERFACE
Obtain the function configuration information from the list of secret agreement functions.
BCRYPT_SIGNATURE_INTERFACE
Obtain the function configuration information from the list of signature functions.
NCRYPT_KEY_STORAGE_INTERFACE
Obtain the function configuration information from the list of key storage functions.
NCRYPT_SCHANNEL_INTERFACE
Obtain the function configuration information from the list of Schannel functions.

-param pszFunction [in]

A pointer to a null-terminated Unicode string that contains the identifier of the cryptographic function to obtain the configuration information for.

-param pcbBuffer [in, out]

The address of a ULONG variable that, on entry, contains the size, in bytes, of the buffer pointed to by ppBuffer. If this size is not large enough to hold the context information, this function will fail with STATUS_BUFFER_TOO_SMALL.

After this function returns, this variable contains the number of bytes that were copied to the ppBuffer buffer.

-param ppBuffer [in, out]

The address of a pointer to a CRYPT_CONTEXT_FUNCTION_CONFIG structure that receives the function configuration information retrieved by this function. The value pointed to by the pcbBuffer parameter contains the size of this buffer.

If the value pointed to by this parameter is NULL, this function will allocate the required memory. This memory must be freed when it is no longer needed by passing this pointer to the BCryptFreeBuffer function.

If this parameter is NULL, this function will place the required size, in bytes, in the variable pointed to by the pcbBuffer parameter and return STATUS_BUFFER_TOO_SMALL.

For more information about the usage of this parameter, see Remarks.

-returns

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_BUFFER_TOO_SMALL
The ppBuffer parameter is not NULL, and the value pointed to by the pcbBuffer parameter is not large enough to hold the set of contexts.
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.

-remarks

Each cryptographic function has only one set of configuration information, so although the ppBuffer parameter appears to be a used as an array, this function treats this as an array with only one element. The following example helps clarify how this parameter is used.

// Get the function configuration information.
CRYPT_CONTEXT_FUNCTION_CONFIG FuncConfig;
ULONG uSize = sizeof(FuncConfig);
PCRYPT_CONTEXT_FUNCTION_CONFIG pFuncConfig = &FuncConfig;
status = BCryptQueryContextFunctionConfiguration(
    CRYPT_LOCAL, 
    pszContext, 
    NCRYPT_SCHANNEL_INTERFACE,
    pszFunction,
    &uSize, 
    &pFuncConfig);

BCryptQueryContextFunctionConfiguration can be called only in user mode.

-see-also

CRYPT_CONTEXT_FUNCTION_CONFIG