SPSmartcard.h File Reference
Detailed Description
SignWare Dynamic Development toolkit, access smart cards.
- Author:
- uko
The application should query the number of installed drivers, select the appropriate driver, and then create an SPSmartcard object. The application may then query the status of the selected smart card terminal, read data from, and write data to the inserted smart card.
The SPSmartcard object uses CT-API to connect to the device-dependent hardware driver for a specific card reader. PC-SC support is planned in the future.
Data exchange is based on ISO 7816-4 (Interindustry commands for interchange) and ISO 7816-8 (Commands for security operation). Note that smart cards typically support only a subset of the commands provided here. Always check the smart card documentation for supported commands.
Some smart cards require authentication to allow further commands, see the documentation of the smart card you intend to use.
Encryption functions use the libdes library written by Eric A. Young.
Defines | |
#define | SP_SC_MFC 0x1100 |
Smart card ID: Comcard MFC. | |
#define | SP_SC_MFC_41 0x1101 |
Smart card ID: Comcard MFC, Version 4.1. | |
#define | SP_SC_MFC_43 0x1103 |
Smart card ID: Comcard MFC, Version 4.3. | |
#define | SP_SC_SMARTCAFE 0x1000 |
Smart card ID: Giesecke & Devrient JavaCard. | |
#define | SP_SC_SMARTCAFE_11 0x1001 |
Smart card ID: Giesecke & Devrient JavaCard V1.1. | |
#define | SP_SC_STARCOS 0x0F00 |
Smart card ID: Giesecke & Devrient STARCOS smart cards. | |
#define | SP_SC_STARCOS_S21 0x0F01 |
Smart card ID: Giesecke & Devrient STARCOS S 2.1 smart cards. | |
#define | SP_SC_STARCOS_SPK22 0x0F02 |
Smart card ID: Giesecke & Devrient STARCOS SPK 2.2 smart cards. | |
#define | SP_SC_STARCOS_SPK23 0x0F03 |
Smart card ID: Giesecke & Devrient STARCOS SPK 2.3 smart cards. | |
#define | SP_SC_TCOS 0x0900 |
Smart card ID: TeleSec TCOS smart cards. | |
#define | SP_SC_TCOS_44 0x0901 |
Smart card ID: TeleSec TCOS with SLE44 chip. | |
#define | SP_SC_TCOS_66 0x0902 |
Smart card ID: TeleSec TCOS with SLE66 chip. | |
#define | SP_SC_TCOS_66P 0x0903 |
Smart card ID: TeleSec TCOS with SLE66p chip. | |
#define | SP_SC_UNKNOWN 0x0000 |
Smart card ID: unknown Smart card. | |
#define | SP_SMARTCARD_CHANGED 2 |
SPSmartcardGetStatus flag: The smart card in the reader was changed, data is no more reliable. | |
#define | SP_SMARTCARD_INSERTED 1 |
SPSmartcardGetStatus flag: A smart card is inserted in the reader. | |
#define | SP_SMARTCARD_WRITE_PASSWORD 0x1000 |
SPSmartcardGetStatus Flag: The smart card in the reader requires a password to write template data. | |
Functions | |
SPINT32 __cdecl | SPSmartcardAPDU (pSPSMARTCARD_T pSmartcard, const SPUCHAR *pucCommand, SPINT32 iCommandLength, SPUCHAR *pucResult, SPINT32 *piResultLength, SPINT32 iCmdRespType) |
Send an APDU (Application protocol data unit) to the smart card. | |
SPINT32 __cdecl | SPSmartcardCreate (pSPSMARTCARD_T *ppSmartcard, pSPSMARTCARDDRIVER_T pSmartcardDriver) |
Create a new SPSmartcard object from an SPSmartcardDriver object. | |
SPINT32 __cdecl | SPSmartcardDisplayText (pSPSMARTCARD_T pSmartcard, const SPCHAR *pszDisplayText) |
Display a text on the smart card terminal. | |
SPINT32 __cdecl | SPSmartcardFree (pSPSMARTCARD_T *ppSmartcard) |
Deallocate an SPSmartcard object. | |
SPINT32 __cdecl | SPSmartcardGetCardType (pSPSMARTCARD_T pSmartcard, SPINT32 *piCardType) |
Get the type of the smart card that is currently inserted. | |
SPINT32 __cdecl | SPSmartcardGetInput (pSPSMARTCARD_T pSmartcard, const SPCHAR *pszDisplayText, SPINT32 iOptionFlags, SPCHAR *pszInputBuffer, SPINT32 *piInputBufferLength) |
Get input from the smart card terminal. | |
SPINT32 __cdecl | SPSmartcardGetLastResult (pSPSMARTCARD_T pSmartcard, SPINT32 *piResult) |
Get the result of the last SPSmartcardCommand or SPSmartcardAPDU operation. | |
SPINT32 __cdecl | SPSmartcardGetStatus (pSPSMARTCARD_T pSmartcard, SPINT32 *piStatus) |
Get the status of an SPSmartcard object. | |
SPINT32 __cdecl | SPSmartcardGotoState (pSPSMARTCARD_T pSmartcard, SPINT32 iNewState) |
Set a smart card driver state. | |
SPINT32 __cdecl | SPSmartcardLoadTemplate (pSPSMARTCARD_T pSmartcard, pSPTEMPLATE_T *ppTemplate) |
Load a template from a smart card. | |
SPINT32 __cdecl | SPSmartcardSaveTemplate (pSPSMARTCARD_T pSmartcard, pSPTEMPLATE_T pTemplate) |
Save a template on a smart card. | |
SPINT32 __cdecl | SPSmartcardSaveTemplatePassword (pSPSMARTCARD_T pSmartcard, pSPTEMPLATE_T pTemplate, SPCHAR *pucPassword, SPINT32 iPasswordLen) |
Save a template in a password protected file on a smart card. |
Define Documentation
|
Smart card ID: Comcard MFC.
|
|
Smart card ID: Comcard MFC, Version 4.1.
|
|
Smart card ID: Comcard MFC, Version 4.3.
|
|
Smart card ID: Giesecke & Devrient JavaCard.
|
|
Smart card ID: Giesecke & Devrient JavaCard V1.1.
|
|
Smart card ID: Giesecke & Devrient STARCOS smart cards.
|
|
Smart card ID: Giesecke & Devrient STARCOS S 2.1 smart cards.
|
|
Smart card ID: Giesecke & Devrient STARCOS SPK 2.2 smart cards.
|
|
Smart card ID: Giesecke & Devrient STARCOS SPK 2.3 smart cards.
|
|
Smart card ID: TeleSec TCOS smart cards.
|
|
Smart card ID: TeleSec TCOS with SLE44 chip.
|
|
Smart card ID: TeleSec TCOS with SLE66 chip.
|
|
Smart card ID: TeleSec TCOS with SLE66p chip.
|
|
Smart card ID: unknown Smart card. Smart card ID's consist of a byte that describes the smart card family and a byte that describes the smart card type within its family. |
|
SPSmartcardGetStatus flag: The smart card in the reader was changed, data is no more reliable.
|
|
SPSmartcardGetStatus flag: A smart card is inserted in the reader.
|
|
SPSmartcardGetStatus Flag: The smart card in the reader requires a password to write template data.
|
Function Documentation
|
Send an APDU (Application protocol data unit) to the smart card. Use this function to send an APDU command to the smart card. If possible, the application should not call this function, but rather use the higher communication levels. This function is provided to support application-specific command extensions. The application must set the open or connect state before sending any commands, and finally reset to the closed state.
|
|
Create a new SPSmartcard object from an SPSmartcardDriver object. This function copies the SPSmartcardDriver object.
|
|
Display a text on the smart card terminal.
|
|
Deallocate an SPSmartcard object. All resources acquired for the SPSmartcard object will be released. The SPSmartcard object must have been created by SPSmartcardCreate.
|
|
Get the type of the smart card that is currently inserted.
|
|
Get input from the smart card terminal.
|
|
Get the result of the last SPSmartcardCommand or SPSmartcardAPDU operation. Each command returns a 2-byte status word. The typical "no error" result is 0x9000.
|
|
Get the status of an SPSmartcard object.
|
|
Set a smart card driver state. The application is responsible for finally closing the driver.
|
|
Load a template from a smart card.
|
|
Save a template on a smart card.
|
|
Save a template in a password protected file on a smart card.
|