Keypop Calypso Card C++ API 2.0.0
Reference Calypso Card API for C++
|
#include <CalypsoCardSelectionExtension.hpp>
Public Member Functions | |
virtual CalypsoCardSelectionExtension & | acceptInvalidatedCard ()=0 |
virtual CalypsoCardSelectionExtension & | prepareSelectFile (const uint16_t lid)=0 |
virtual CalypsoCardSelectionExtension & | prepareSelectFile (const SelectFileControl selectControl)=0 |
virtual CalypsoCardSelectionExtension & | prepareGetData (const GetDataTag tag)=0 |
virtual CalypsoCardSelectionExtension & | prepareReadRecord (const uint8_t sfi, const int recordNumber)=0 |
virtual CalypsoCardSelectionExtension & | prepareReadBinary (const uint8_t sfi, const int offset, const int nbBytesToRead)=0 |
virtual CalypsoCardSelectionExtension & | prepareReadCounter (const uint8_t sfi, const int nbCountersToRead)=0 |
virtual CalypsoCardSelectionExtension & | preparePreOpenSecureSession (const WriteAccessLevel writeAccessLevel)=0 |
Extends the CardSelectionExtension interface of the "Keypop Reader API" to provide means to define optional commands to be executed during the selection phase.
An instance of this interface can be obtained via the method CalypsoCardApiFactory#createCalypsoCardSelectionExtension().
Note 1: by default, the selection process ignores PRIME revision 3 cards that have been invalidated. The CalypsoCardSelectionExtension#acceptInvalidatedCard() method must be called to stop ignoring them.
This feature does not apply to earlier revisions for which it is necessary to run a Select File (DF) command to determine the invalidation status. In this case, the rejection or acceptance of invalidated cards will have to be handled by the application.
Note 2: the APDU commands resulting from the invocation of the "prepare" methods shall be compliant with the PRIME revision 3 cards.
For all "prepare" type commands, unless otherwise specified, here are the ranges of values checked for the various parameters:
Definition at line 56 of file CalypsoCardSelectionExtension.hpp.
|
pure virtual |
Request to accept invalidated cards during the selection stage.
Caution: this functionality is operational only from PRIME revision 3 cards. Invalidated cards are rejected by default.
|
pure virtual |
Adds a "Get Data" command to retrieve the data indicated by the provided tag.
This method can be used to obtain FCI information when it is not provided directly by the select application (e.g. OMAPI case).
Caution: the resulting APDU command must be compliant with PRIME revision 3 cards. Therefore, the command may be rejected by some earlier revision cards.
tag | The tag to use. |
IllegalArgumentException | If tag is null. |
|
pure virtual |
Adds a specific "Open Secure Session" command to attempt a secure session pre-opening. For cards that support this feature, this optimizes future exchanges with the card in the case of secure sessions intended to be executed in a single step.
The objective of the pre-opening is to allow the grouping of all the commands of a secure session. This functionality is only relevant in the case of a distributed system where the ticketing processing is done remotely in order to allow a complete secure session to be carried out in a single exchange between the server and the terminal.
This mechanism is based on the anticipation of the APDU responses of the card.
In order to achieve the objective of a single exchange, it is essential to read locally beforehand (out of session) all the data that will have to be read in session. If not, additional exchanges will be made.
Then, the remote ticketing processing must prepare all the commands of the session (from opening to closing) before executing it.
Example:
transaction.prepareOpenSecureSession(...).prepare...[...].prepare....prepareCloseSecureSession().processCommands(...);
Caution: this feature will be ineffective in the following cases:
writeAccessLevel | The write access level. |
IllegalArgumentException | If writeAccessLevel is null. |
IllegalStateException | If "Pre-Open" command is already prepared. |
|
pure virtual |
Adds one or multiple "Read Binary" commands to read all or part of the indicated "binary" EF.
Once this command is processed, the result is available in CalypsoCard if the requested file exist in the file structure of the card and if the offset and number of bytes to read are valid (best-effort mode).
Caution: the resulting APDU command is compliant with PRIME revision 3 cards. Therefore, the command may be rejected by some earlier revision cards.
sfi | The SFI of the EF. |
offset | The offset (0 indicates the first byte). |
nbBytesToRead | The number of bytes to read. |
IllegalArgumentException | If one of the provided argument is out of range. |
|
pure virtual |
Adds a "Read Records" command to read a part of a record of the indicated EF, which should be a counter file.
The record will be read up to the counter location indicated in parameter.
Thus, all previous counters will also be read.
Once this command is processed, the result is available in CalypsoCard if the requested file and the counter number exist in the file structure of the card (best-effort mode).
Caution: the resulting APDU command is compliant with PRIME revision 3 cards. Therefore, the command may be rejected by some earlier revision cards.
sfi | The SFI of the EF. |
nbCountersToRead | The number of counters to read. |
IllegalArgumentException | If one of the provided argument is out of range. |
|
pure virtual |
Adds a "Read Records" command to read a single record from the indicated "linear" or "cyclic" EF.
Once this command is processed, the result is available in CalypsoCard if the requested file and record exist in the file structure of the card (best-effort mode).
Caution: the resulting APDU command is compliant with PRIME revision 3 cards. Therefore, the command may be rejected by some earlier revision cards.
sfi | The SFI of the EF to read |
recordNumber | The record number to read. |
IllegalArgumentException | If one of the provided argument is out of range. |
|
pure virtual |
Adds a "Select File" command to select file according to the provided SelectFileControl enum entry indicating the navigation case: FIRST, NEXT or CURRENT.
Caution: the resulting APDU command must be compliant with PRIME revision 3 cards. Therefore, the command may be rejected by some earlier revision cards.
selectControl | A SelectFileControl enum entry. |
IllegalArgumentException | If the argument is null. |
|
pure virtual |
Adds a command APDU to select an EF by its LID in the current DF.
Caution 1: the resulting APDU command must be compliant with PRIME revision 3 cards. Therefore, the command may be rejected by some earlier revision cards.
Caution 2: the command will fail if the selected file is not an EF.
lid | A short. |