共用方式為


CardQueryKeySizes function

This topic is not current. For the most current information about the Smart Card API, see Smart Card Minidriver Specification.

The CardQueryKeySizes function, defined by a smart card module, retrieves the public key lengths supported by a smart card.

Syntax

DWORD WINAPI CardQueryKeySizes(
  _In_  PCARD_DATA      pCardData,
  _In_  DWORD           dwKeySpec,
  _In_  DWORD           dwFlags,
  _Out_ PCARD_KEY_SIZES pKeySizes
);

Parameters

pCardData [in]

A pointer to a CARD_DATA structure received from a call to the CardAcquireContext function.

dwKeySpec [in]

A DWORD value that specifies the type of the private key for which to find the length.

This parameter can be one of the following values.

Value Meaning
AT_KEYEXCHANGE
1
This function gets the sizes of keys that are used to encrypt and decrypt session keys.
AT_SIGNATURE
2
This function gets the sizes of keys that are used to create and verify digital signatures.

dwFlags [in]

Reserved. This parameter must be set to zero.

pKeySizes [out]

A pointer to a CARD_KEY_SIZES structure that, on output, contains information about the sizes of private keys supported on the smart card.

Return value

If the function succeeds, the function returns zero.

If the function fails, it returns a nonzero value.

Requirements

Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Header
Cardmod.h

See also

Microsoft Base Smart Card Cryptographic Service Provider

CARD_DATA

CARD_KEY_SIZES

CardAcquireContext

CardCreateContainer