CardGetKeyProperty function

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

Syntax

DWORD WINAPI CardGetKeyProperty(
  _In_      PCARD_DATA      pCardData,
  _In_      CARD_KEY_HANDLE hKey,
  _In_      LPCWSTR         pwszProperty,
  _Out_opt_ PBYTE           pbData,
  _In_      DWORD           cbData,
  _Out_     PDWORD          pdwDataLen,
  _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 queried.

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

  • pbData [out, optional]
    A pointer to a null-terminated Unicode string that contains the name of the property to be queried.

  • cbData [in]
    The maximum length, in bytes, of the buffer pointed to by pbData.

  • pdwDataLen [out]
    A pointer to a DWORD variable that receives the returned length, in bytes, of the data in the buffer to which by pbData 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_BLOCK_LENGTH DWORD

The returned data contains a DWORD value that contains the block length of the cipher.

Note  This property is read only.
 

 

Requirements

Target platform

Desktop

Header

Cardmod.h (include Cardmod.h)

 

 

Send comments about this topic to Microsoft