TokenBindingGenerateBinding function

Constructs one token binding that contains the exported public key and signature by using the specified key type for the token binding, a target identifier string for creating and retrieving the token binding key, and the unique data. This function also returns the token binding identifier, if needed.

Syntax

SECURITY_STATUS TokenBindingGenerateBinding(
  TOKENBINDING_KEY_PARAMETERS_TYPE keyType,
  PCWSTR                           targetURL,
  TOKENBINDING_TYPE                bindingType,
  const void                       *tlsEKM,
  DWORD                            tlsEKMSize,
  TOKENBINDING_EXTENSION_FORMAT    extensionFormat,
  const void                       *extensionData,
  void                             **tokenBinding,
  DWORD                            *tokenBindingSize,
  TOKENBINDING_RESULT_DATA         **resultData
);

Parameters

keyType

The negotiated key type to use. Use a value from the list of key types that you retrieved by calling the TokenBindingGetKeyTypesClient function.

targetURL

The target string to use in conjunction with the key type to generate or retrieve a token binding key for the NCrypt operations that build the buffer for the tokenBinding parameter.

bindingType

The type of token binding that TokenBindingGenerateBinding should generate.

tlsEKM

A pointer to the buffer that contains unique data.

tlsEKMSize

The size of the buffer that the tlsUnique parameter points to, in bytes.

extensionFormat

The format to use to interpret the data in the extensionData parameter. This value must be TOKENBINDING_EXTENSION_FORMAT_UNDEFINED.

extensionData

A pointer to a buffer that contains extension data. The value of the extensionFormat parameter determines how to interpret this data.

tokenBinding

A pointer that receives the address of the token binding buffer. Use the HeapAlloc function to allocate the memory for this buffer, and the HeapFree function to free that memory.

tokenBindingSize

Pointer to a variable that receives the size of the buffer allocated for the tokenBinding parameter, in bytes.

resultData

A pointer that receives the address of the buffer that contains result data that includes the token binding identifier of the token binding that TokenBindingGenerateBinding generates. Use the HeapAlloc function to allocate the memory for this buffer, and the HeapFree function to free that memory. Specify NULL is you do not need this information.

Return Value

Returns a status code that indicates the success or failure of the function.

Remarks

You can call TokenBindingGenerateBinding from user mode.

Requirements

   
Minimum supported client Windows 10 [desktop apps only]
Minimum supported server Windows Server 2016 [desktop apps only]
Target Platform Windows
Header tokenbinding.h
Library Tokenbinding.lib
DLL Tokenbinding.dll

See Also

HeapAlloc

HeapFree

TOKENBINDING_EXTENSION_FORMAT

TOKENBINDING_RESULT_DATA

TOKENBINDING_TYPE

TokenBindingDeleteBinding

TokenBindingGetKeyTypesClient