Share via


CardSetKeyProperty function

This function is used to set the properties of a key.

Syntax

DWORD WINAPI CardSetKeyProperty(
  _In_ PCARD_DATA      pCardData,
  _In_ CARD_KEY_HANDLE hKey,
  _In_ LPCWSTR         pwszProperty,
  _In_ PBYTE           pbInput,
  _In_ DWORD           cbInput,
  _In_ DWORD           dwFlags
);

Parameters

  • pCardData [in]
    Context information for the call. For more information, see CardAcquireContext.

  • hKey [in]
    The handle of the cryptographic key whose property is to be set.

  • pwszProperty [in]
    A pointer to a null-terminated Unicode string that contains the name of the property to be set.

  • pbInput [in]
    A byte pointer to data buffer that contains the property data.

  • cbInput [in]
    The length, in bytes, of the data in the buffer to which pbInput points.

  • dwFlags [in]
    A set of flags that specify options for the operation. Currently, no flags are defined. Set this value to 0.

Return value

Zero on success; nonzero on failure.

Remarks

If dwFlags has a nonzero value, the function should return SCARD_E_INVALID_PARAMETER.

If pwszProperty contains an unsupported value, the function should return SCARD_E_INVALID_PARAMETER.

Note  Any minidriver may choose to define and support optional custom properties that are not defined in this specification.

 

The format of pbData depends on the value of the pwszProperty parameter. The following table describes the supported values for pwszProperty along with the corresponding format for pbData.

pwszProperty value pbData type pbData value
CKP_CHAINING_MODE LPWSTR

The data contains a string that describes the type of chaining mode that the card should use for decryption. For more information, see the description of CP_CHAINING_MODES in CardGetProperty.

CKP_INITIALIZATION_VECTOR PBYTE

The data contains an initialization vector to be used for decryption.

 

Requirements

Target platform

Desktop

Header

Cardmod.h (include Cardmod.h)

 

 

Send comments about this topic to Microsoft