CardGetAlgorithmProperty function

This function can be used to get properties for a cryptographic algorithm.


DWOR WINAPI CardGetAlgorithmProperty(
  _In_      PCARD_DATA pCardData,
  _In_      LPCWSTR    pwszAlgId,
  _In_      LPCWSTR    pwszProperty,
  _Out_opt_ PBYTE      pbData,
  _In_      DWORD      cbData,
  _Out_     PBYTE      pdwDataLen,
  _In_      DWORD      dwFlags


pCardData [in]

Context information for the call. For more information, see CardAcquireContext.

pwszAlgId [in]

A pointer to a null-terminated Unicode string. This string identifies the algorithm whose property is queried. For more information, see the description of CP_ENUM_ALGORITHMS in CardGetProperty.

pwszProperty [in]

A pointer to a null-terminated Unicode string. This string identifies the name of the property to be retrieved.

pbData [out, optional]

A byte pointer to a data buffer that receives the property data.

cbData [in]

The maximum length, in bytes, of the buffer to which pbData points.

pdwDataLen [out]

A pointer to a variable that receives the actual returned data length.

dwFlags [in]

A set of flags that specify options for the operation. Currently, no flags are defined for this function. Set this value to 0.

Return value

Zero on success; nonzero on failure.


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

If pwszAlgId contains an invalid or undefined value, the function should return SCARD_E_INVALID_PARAMETER. If the pwszAlgId value is defined but not supported, the function should value SCARD_E_UNSUPPORTED_FEATURE. For legacy cards the minidriver can support other algorithms.

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 valuepbData typepbData value

The return data contains a structure of the following format. This format describes the different key length values that are available for the cryptographic algorithm as specified by pwszAlgId:

typedef struct _CARD_KEY_SIZES
    DWORD  dwVersion;
    DWORD  dwMinimumBitlen;
    DWORD  dwDefaultBitlen;
    DWORD  dwMaximumBitlen;
    DWORD  dwIncrementalBitlen;

A card minidriver that supports read-only cards may support more key types than what the specific read only card has been provisioned with. In this case the returned value should include all the supported key spec.

Note  This property is read only.



Target platform


Cardmod.h (include Cardmod.h)



Send comments about this topic to Microsoft