Files | |
file | libchipcard.h |
Contains the C API of LibChipCard. | |
Organisational Stuff | |
Well, I don't know in which group to put these functions otherwise ;-) | |
CHIPCARD_API int | ChipCard_Work () |
CHIPCARD_API int | ChipCard_AddServer (const char *addr, int port) |
CHIPCARD_API void | ChipCard_ReaderDescr_free (CHIPCARD_READERDESCR *rd) |
Initialisation and Deinitialisation | |
The functions in this group only need to be called hen you are using the C interface only. The C++ classes automatically call them. | |
CHIPCARD_API int | ChipCard_Init (const char *configfile, const char *section) |
CHIPCARD_API void | ChipCard_Fini () |
Configuration File Based APDU Engine | |
The functions of this group are allow looking up APDU commands. This engine allows adjusting LibChipCard to special cards and readers without recompiling LibChipCard. | |
CHIPCARD_API int | ChipCard_LocateCommand (const char *command, const char *readertype, const char *cardtype, char *buffer, int bufferlen) |
CHIPCARD_API int | ChipCard_ExistsCommand (const char *command) |
int | ChipCard_MakeAPDU (char *buffer, int *bufferlen, const char *command, int argc,...) |
General Request and Response Handling | |
This group contains functions which can be applied to any pending request. | |
CHIPCARD_API int | ChipCard_CheckResponse (int requestid) |
CHIPCARD_API void | ChipCard_WithdrawRequest (int requestid) |
CHIPCARD_API void | ChipCard_AbandonRequest (int requestid) |
Requests | |
LibChipCard works asynchronously. Nearly all actions you want LibChipCard to take are in form of a request. Generally you call a request function (ChipCard_RequestXYZ()), then ChipCard_Work() (repeatedly until a response arrives) and the appropriate check function (ChipCard_CheckXYZ()). The check function is the one that returns the results of a request (if it successfully returns) | |
CHIPCARD_API int | ChipCard_RequestAllocReader (int *requestid, unsigned int tid) |
CHIPCARD_API int | ChipCard_CheckAllocReader (int requestid, int *thdl, CHIPCARD_READERDESCR **rd) |
CHIPCARD_API int | ChipCard_RequestReleaseReader (int *requestid, unsigned int tid) |
CHIPCARD_API int | ChipCard_CheckReleaseReader (int requestid) |
CHIPCARD_API int | ChipCard_RequestConnect (int *requestid, unsigned int thdl, int cardId, int waitForIt) |
CHIPCARD_API int | ChipCard_RequestStopConnect (int *requestid, unsigned int thdl, int prevRequest) |
CHIPCARD_API int | ChipCard_CheckConnect (int requestid, int *result, char *atrbuffer, int *atrbufferlength) |
CHIPCARD_API int | ChipCard_RequestDisconnect (int *requestid, unsigned int thdl) |
CHIPCARD_API int | ChipCard_CheckDisconnect (int requestid, int *result) |
CHIPCARD_API int | ChipCard_RequestCommand (int *requestid, unsigned int thdl, const char *sendBuffer, int sendBufferLength) |
CHIPCARD_API int | ChipCard_CheckCommand (int requestid, int *result, char *recvBuffer, int *recvBufferLength) |
CHIPCARD_API int | ChipCard_RequestFindReader (int *requestid, const char *readerType, unsigned int readerFlags, unsigned int readerFlagsMask) |
CHIPCARD_API int | ChipCard_CheckFindReader (int requestid, unsigned int *readerbuffer, int *readerBufferLength) |
CHIPCARD_API int | ChipCard_RequestStatReader (int *requestid, int thdl) |
CHIPCARD_API int | ChipCard_CheckStatReader (int requestid, int *result, unsigned int *status, char *atrbuffer, int *atrlen) |
CHIPCARD_API int | ChipCard_RequestWaitReader (int *requestid, int mustChange, const char *readerType, unsigned int readerFlags, unsigned int readerFlagsMask, unsigned int status, unsigned int statusMask, unsigned int statusDelta) |
CHIPCARD_API int | ChipCard_CheckWaitReader (int requestid, int *tid, unsigned int *status, unsigned int *readerflags, unsigned int *cardId) |
CHIPCARD_API int | ChipCard_StopWaitReader (int prevRequest) |
CHIPCARD_API int | ChipCard_CheckStopConnect (int requestid, int *result) |
|
This only marks the request as abandoned. When the response for this request arrives, it will be discarded and the request itself will be deleted. However, if there already is a response to this request this request will immediately be deleted.
|
|
This function allows adding a card server to the internal list thus bypassing the configuration files. This function is depracated and may seize to exist in future versions, so please don't rely on it.
|
|
This function checks whether there is a response for the request.
|
|
This function checks for the result of ChipCard_RequestCommand() and ChipCard_RequestCommand2().
|
|
This function checks whether there is a response for the request. All return parameters are only modified upon successfull return.
|
|
This function checks whether there is a response for the request.
|
|
This function checks whether there is a response for the request. Since a FindReader request is send to all registered servers you should call this function repeatedly (intermixed with ChipCard_Work())until CHIPCARD_ERROR_NO_REQUEST is returned. If you have found a reader before CHIPCARD_ERROR_NO_REQUEST is returned then you should withdraw the request by calling ChipCard_WithdrawRequest().
|
|
This function checks whether there is a response for the request.
|
|
Each request can be identified by its request id. This function here checks whether there is a response to the given request pending.
|
|
This function checks whether there is a response for the request.
|
|
|
|
This function checks whether there is a response for the request.
|
|
Checks whether a given command exists. You can provide a full path here (including readertype and card type separated by "/")
|
|
This functions shuts down LibChipCard (the client part). It should be called when the program exits. However, when using the C++ API then it will be called internally when needed.
|
|
This function initializes LibChipCard. It loads all necessary configuration and command files. No communication with any server is done here. This function can be called directly (and must be called if only C code is to be used), but if you are using the C++ API (CTCard and derived classes) then this will be called internally when needed.
|
|
This functions tries to lookup a card command (APDU) based on the type of the reader and the card. This allows adjusting commands to special cards or readers without the need for recompilation of LibChipCard.
|
|
Creates an APDU (card command) from the given parameters. This uses the core of the new configuration file driven command engine.
|
|
This function can be used to free a reader description received upon ChipCard_CheckConnect(). You should alway free such a reader description by using this function.
|
|
This function requests the allocation of a card reader. A card reader must be allocated in order to use it. After you have finished using the reader you should release it by ChipCard_RequestReleaseReader().
|
|
This function requests executing a raw APDU on the card in the given reader.
|
|
This function requests connecting a card to the given reader.
|
|
This function requests disconnecting a card in the given reader. The card is reset by this function, so that any security status is guaranteed to be cleared upon successfull disconnect.
|
|
This function requests to find a reader by drivertype, readertype and/or readerflags.
|
|
This function requests to release a reader. You are expected to call this function when you are finished using the reader in order to free ressources allocated locally by the reader.
|
|
This function requests the status of a card reader.
|
|
This function requests aborting a pending connection request
|
|
This is nearly the same as the function above, but it allows to additionally give a delta status. Only changes in those parts of the reader status, whose bits are set in statusDelta are checked. So you can now effectively ignore some status changes. E.g. if statusDelta is "0" then all status changes are ignored, so you will never receive a status change notification.
|
|
This function stops waiting for further reader notifications induced by ChipCard_RequestWaitReader(). It releases all ressources allocated by this request.
|
|
If you issued a request and for any reason want to withdraw it (thereby telling LibChipCard that you're no longer interested in a response) then you are expected to call this function. It frees all ressources occupied by the request. All future responses to this request which may arrive after withdrawing the request are ignored.
|
|
LibChipCard works asynchronously. Most functions only create a request and enqueue it internally. Every time you call this function the enqueued requests are actually send to the corresponding servers. So you will never get an answer to a request if you don't call this function. However, when using the C++ interface (CTCard and derived classes) then this function is called internally.
|