共用方式為


CARD_DATA structure

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

The CARD_DATA structure contains context information used during communication between a smart card module and either the Microsoft Base Smart Card Cryptographic Service Provider (CSP) or the smart card key storage provider (KSP). The structure includes pointers to all functions that the smart card module implements. It also includes pointers to the functions that the CSP and KSP export to the smart card module.

Syntax

typedef struct _CARD_DATA {
  DWORD                           dwVersion;
  PBYTE                           pbAtr;
  DWORD                           cbAtr;
  LPWSTR                          pwszCardName;
  PFN_CSP_ALLOC                   pfnCspAlloc;
  PFN_CSP_REALLOC                 pfnCspReAlloc;
  PFN_CSP_FREE                    pfnCspFree;
  PFN_CSP_CACHE_ADD_FILE          pfnCspCacheAddFile;
  PFN_CSP_CACHE_LOOKUP_FILE       pfnCspCacheLookupFile;
  PFN_CSP_CACHE_DELETE_FILE       pfnCspCacheDeleteFile;
  PVOID                           pvCacheContext;
  PFN_CSP_PAD_DATA                pfnCspPadData;
  SCARDCONTEXT                    hSCardCtx;
  SCARDHANDLE                     hScard;
  PVOID                           pvVendorSpecific;
  PFN_CARD_DELETE_CONTEXT         pfnCardDeleteContext;
  PFN_CARD_QUERY_CAPABILITIES     pfnCardQueryCapabilities;
  PFN_CARD_DELETE_CONTAINER       pfnCardDeleteContainer;
  PFN_CARD_CREATE_CONTAINER       pfnCardCreateContainer;
  PFN_CARD_GET_CONTAINER_INFO     pfnCardGetContainerInfo;
  PFN_CARD_AUTHENTICATE_PIN       pfnCardAuthenticatePin;
  PFN_CARD_GET_CHALLENGE          pfnCardGetChallenge;
  PFN_CARD_AUTHENTICATE_CHALLENGE pfnCardAuthenticateChallenge;
  PFN_CARD_UNBLOCK_PIN            pfnCardUnblockPin;
  PFN_CARD_CHANGE_AUTHENTICATOR   pfnCardChangeAuthenticator;
  PFN_CARD_DEAUTHENTICATE         pfnCardDeauthenticate;
  PFN_CARD_CREATE_DIRECTORY       pfnCardCreateDirectory;
  PFN_CARD_DELETE_DIRECTORY       pfnCardDeleteDirectory;
  LPVOID                          pvUnused3;
  LPVOID                          pvUnused4;
  PFN_CARD_CREATE_FILE            pfnCardCreateFile;
  PFN_CARD_READ_FILE              pfnCardReadFile;
  PFN_CARD_WRITE_FILE             pfnCardWriteFile;
  PFN_CARD_DELETE_FILE            pfnCardDeleteFile;
  PFN_CARD_ENUM_FILES             pfnCardEnumFiles;
  PFN_CARD_GET_FILE_INFO          pfnCardGetFileInfo;
  PFN_CARD_QUERY_FREE_SPACE       pfnCardQueryFreeSpace;
  PFN_CARD_QUERY_KEY_SIZES        pfnCardQueryKeySizes;
  PFN_CARD_SIGN_DATA              pfnCardSignData;
  PFN_CARD_RSA_DECRYPT            pfnCardRSADecrypt;
  PFN_CARD_CONSTRUCT_DH_AGREEMENT pfnCardConstructDHAgreement;
  PFN_CARD_DERIVE_KEY             pfnCardDeriveKey;
  PFN_CARD_DESTROY_DH_AGREEMENT   pfnCardDestroyDHAgreement;
  PFN_CSP_GET_DH_AGREEMENT        pfnCspGetDHAgreement;
} CARD_DATA, *PCARD_DATA;

Members

dwVersion

The version number of the smart card module.

This member must be initialized by the CSP or KSP before calling the CardAcquireContext function with the requested version.

On output, this member must be set to the version of this structure that the smart card module returns.

pbAtr

The ATR string that identifies the smart card.

This member must be initialized by the CSP or KSP before calling the CardAcquireContext function.

cbAtr

The size, in bytes, of the string contained in the pbAtr parameter.

This member must be initialized by the CSP or KSP before calling the CardAcquireContext function.

pwszCardName

A pointer to a null-terminated wide character string that contains the name of the smart card.

This member must be initialized by the CSP or KSP before calling the CardAcquireContext function.

pfnCspAlloc

A PFN_CSP_ALLOC function pointer.

This member must be initialized by the CSP or KSP before calling the CardAcquireContext function.

pfnCspReAlloc

A PFN_CSP_ALLOC function pointer.

This member must be initialized by the CSP or KSP before calling the CardAcquireContext function.

pfnCspFree

A PFN_CSP_FREE function pointer.

This member must be initialized by the CSP or KSP before calling the CardAcquireContext function.

pfnCspCacheAddFile

A PFN_CSP_CACHE_ADD_FILE function pointer.

This member must be initialized by the CSP or KSP after calling the CardAcquireContext function. Implementations of CardAcquireContext must check that this member is not set to NULL before using or caching the pointer.

pfnCspCacheLookupFile

A PFN_CSP_CACHE_LOOKUP_FILE function pointer.

This member must be initialized by the CSP or KSP after calling the CardAcquireContext function. Implementations of CardAcquireContext must check that this member is not set to NULL before using or caching the pointer.

pfnCspCacheDeleteFile

A PFN_CSP_CACHE_DELETE_FILE function pointer.

This member must be initialized by the CSP or KSP after calling the CardAcquireContext function. Implementations of CardAcquireContext must check that this member is not set to NULL before using or caching the pointer.

pvCacheContext

A pointer to a context value used by the functions pointed to by the PFN_CSP_CACHE_ADD_FILE, PFN_CSP_CACHE_LOOKUP_FILE, and PFN_CSP_CACHE_DELETE_FILE function pointers.

This member must be initialized by the CSP or KSP after calling the CardAcquireContext function. Implementations of CardAcquireContext must check that this member is not set to NULL before using or caching the pointer.

pfnCspPadData

A PFN_CSP_PAD_DATA function pointer.

This member must be initialized by the CSP or KSP before calling the CardAcquireContext function.

hSCardCtx

A handle that identifies the resource manager context. The CSP or KSP retrieves the resource manager context from a previous call to the SCardEstablishContext function.

This member must be initialized by the CSP or KSP before calling the CardAcquireContext function.

hScard

A handle to a smart card. The CSP or KSP retrieves this handle from a previous call to the SCardConnect function.

This member must be initialized by the CSP or KSP before calling the CardAcquireContext function.

pvVendorSpecific

A pointer to card-specific information that the smart card module can use.

pfnCardDeleteContext

A pointer to the CardDeleteContext function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardQueryCapabilities

A pointer to the CardQueryCapabilities function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardDeleteContainer

A pointer to the CardDeleteContainer function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardCreateContainer

A pointer to the CardCreateContainer function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardGetContainerInfo

A pointer to the CardGetContainerInfo function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardAuthenticatePin

A pointer to the CardAuthenticatePin function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardGetChallenge

A pointer to the CardGetChallenge function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardAuthenticateChallenge

A pointer to the CardAuthenticateChallenge function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardUnblockPin

A pointer to the CardUnblockPin function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardChangeAuthenticator

A pointer to the CardChangeAuthenticator function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardDeauthenticate

A pointer to the CardDeauthenticate function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardCreateDirectory

A pointer to the CardCreateDirectory function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardDeleteDirectory

A pointer to the CardDeleteDirectory function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pvUnused3

Reserved.

pvUnused4

Reserved.

pfnCardCreateFile

A pointer to the CardCreateFile function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardReadFile

A pointer to the CardReadFile function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardWriteFile

A pointer to the CardWriteFile function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardDeleteFile

A pointer to the CardDeleteFile function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardEnumFiles

A pointer to the CardEnumFiles function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardGetFileInfo

A pointer to the CardGetFileInfo function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardQueryFreeSpace

A pointer to the CardQueryFreeSpace function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardQueryKeySizes

A pointer to the CardQueryKeySizes function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardSignData

A pointer to the CardSignData function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardRSADecrypt

A pointer to the CardRSADecrypt function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardConstructDHAgreement

A pointer to the CardConstructDHAgreement function implemented by the smart card module.

This member is initialized by the CardAcquireContext function of the smart card module.

pfnCardDeriveKey

A pointer to the CardDeriveKey function implemented by the smart card module.

Windows Server 2003, Windows XP, Windows 2000 Server and Windows 2000 Professional: This function is not supported.

pfnCardDestroyDHAgreement

A pointer to the CardDestroyDHAgreement function implemented by the smart card module.

Windows Server 2003, Windows XP, Windows 2000 Server and Windows 2000 Professional: This function is not supported.

pfnCspGetDHAgreement

A pointer to the CspGetDHAgreement callback function set by the CSP.

Windows Server 2003, Windows XP, Windows 2000 Server and Windows 2000 Professional: This function is not supported.

Requirements

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

See also

CardAcquireContext