Smart Card API Functions

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

Smart Card Module Functions

The following functions are implemented and used by smart card modules and the Microsoft Base Smart Card Cryptographic Service Provider.

FunctionDescription
CardAcquireContextInitializes communication between the Microsoft Base Smart Card Cryptographic Service Provider and the smart card module.
CardAuthenticateChallengeSubmits a response to a challenge issued by a smart card to authenticate a user.
CardAuthenticatePinSubmits a PIN to the smart card to authenticate a user.
CardChangeAuthenticatorChanges the authentication data associated with a smart card and a specified type of user.
CardConstructDHAgreementNot currently supported.
CardCreateContainerCreates a new key container on a smart card.
CardCreateDirectoryCreates a subdirectory of the root directory in the file system on a smart card.
CardCreateFileCreates a file in the specified directory of a smart card.
CardDeauthenticateReverses the effect of authenticating a user or administrator without resetting the smart card.
CardDeleteContainerDeletes a key container from a smart card.
CardDeleteContextEnds communication between the Microsoft Base Smart Card Cryptographic Service Provider and the smart card module and cleans up resources.
CardDeleteDirectoryDeletes a directory from a smart card. The directory must be empty, and the caller must have permission to delete that directory.
CardDeleteFileDeletes a file from a smart card.
CardDeriveKeyCreates a session key by using the information in the specified CARD_DERIVE_KEY structure.
CardDestroyDHAgreementRemoves a Diffie-Hellman secret agreement from the specified key container on the smart card.
CardEnumFilesReceives an array of the names of files available in a specified directory of a smart card.
CardGetChallengeAuthenticates a user with a challenge and response.
CardGetContainerInfoGets a CONTAINER_INFO structure that contains information about a key container on a smart card.
CardGetFileInfoGets the size and access permissions of a smart card file.
CardQueryCapabilitiesGets information about the functionality provided by a smart card.
CardQueryFreeSpaceGets the amount of available memory on a smart card.
CardQueryKeySizesGets the public key sizes supported by a smart card.
CardReadFileReads the contents of a file into a buffer.
CardRSADecryptPerforms an RSA decryption of the specified data using the specified private key. The decryption operation must be for a single data buffer of the same size as the key modulus.
CardSignDataCreates a digital signature for the specified block of data.
CardUnblockPinUnblocks a smart card that has become blocked after exceeding the maximum number of incorrect PIN entry attempts. The function also authenticates a user to the smart card.
CardWriteFileWrites data in a buffer to a file on a smart card.
CspGetDHAgreementA callback function that is set by a caller before calling the CardAcquireContext function. If the CARD_DERIVE_KEY structure used for a call to CardDeriveKey specifies a parameter of the type KDF_NCRYPT_SECRET_HANDLE, the smart card module calls this function to get the handle on the smart card.
PFN_CSP_ALLOCPoints to a function that allocates a block of memory.
PFN_CSP_CACHE_ADD_FILEPoints to a function that adds a file to the data cached by the Microsoft Base Smart Card Cryptographic Service Provider.
PFN_CSP_CACHE_DELETE_FILEPoints to a function that deletes a file from the cache of the Microsoft Base Smart Card Cryptographic Service Provider.
PFN_CSP_CACHE_LOOKUP_FILEPoints to a function that reads a file that was cached by the Microsoft Base Smart Card Cryptographic Service Provider as the result of a previous call that used the PFN_CSP_CACHE_ADD_FILE function pointer.
PFN_CSP_FREEPoints to a function that frees a block of memory.
PFN_CSP_PAD_DATAPads a data buffer for use in a cryptographic operation when the smart card itself does not perform data padding.
PFN_CSP_REALLOCPoints to a function that changes the size of a previously allocated block of memory. The existing contents of the memory block are copied to the reallocated block.

 

 

 

Send comments about this topic to Microsoft

Build date: 4/19/2011

Show: