![]() |
Keyple Card Calypso C++ Library 2.2.5.6
Reference Terminal Reader API for C++
|
#include <CalypsoCardAdapter.h>


Public Member Functions | |
| CalypsoCardAdapter () | |
| void | initialize (const std::shared_ptr< CardSelectionResponseApi > cardSelectionResponse) |
| void | initializeWithFci (const std::shared_ptr< CmdCardGetDataFci > cmdCardGetDataFci) |
| const CalypsoCard::ProductType & | getProductType () const override |
| bool | isHce () const override |
| const std::vector< uint8_t > & | getDfName () const override |
| const std::vector< uint8_t > & | getCalypsoSerialNumberFull () const |
| const std::vector< uint8_t > | getApplicationSerialNumber () const override |
| const std::vector< uint8_t > & | getStartupInfoRawData () const override |
| uint8_t | getPayloadCapacity () const |
| bool | isModificationsCounterInBytes () const |
| int | getModificationsCounter () const |
| uint8_t | getPlatform () const override |
| uint8_t | getApplicationType () const override |
| bool | isExtendedModeSupported () const override |
| bool | isRatificationOnDeselectSupported () const override |
| bool | isSvFeatureAvailable () const override |
| bool | isPinFeatureAvailable () const override |
| bool | isPkiModeSupported () const override |
| uint8_t | getApplicationSubtype () const override |
| uint8_t | getSoftwareIssuer () const override |
| uint8_t | getSoftwareVersion () const override |
| uint8_t | getSoftwareRevision () const override |
| uint8_t | getSessionModification () const override |
| const std::vector< uint8_t > | getTraceabilityInformation () const override |
| bool | isDfInvalidated () const override |
| bool | isDfRatified () const override |
| int | getTransactionCounter () const override |
| void | setTransactionCounter (const int transactionCounter) |
| void | setSvData (const uint8_t svKvc, const std::vector< uint8_t > &svGetHeader, const std::vector< uint8_t > &svGetData, const int svBalance, const int svLastTNum, const std::shared_ptr< SvLoadLogRecord > svLoadLogRecord, const std::shared_ptr< SvDebitLogRecord > svDebitLogRecord) |
| int | getSvBalance () const override |
| int | getSvLastTNum () const override |
| const std::shared_ptr< SvLoadLogRecord > | getSvLoadLogRecord () override |
| const std::shared_ptr< SvDebitLogRecord > | getSvDebitLogLastRecord () override |
| const std::vector< std::shared_ptr< SvDebitLogRecord > > | getSvDebitLogAllRecords () const override |
| void | setDfRatified (const bool dfRatified) |
| CalypsoCardClass | getCardClass () const |
| const std::shared_ptr< DirectoryHeader > | getDirectoryHeader () const override |
| CalypsoCard & | setDirectoryHeader (const std::shared_ptr< DirectoryHeader > directoryHeader) |
| const std::shared_ptr< ElementaryFile > | getFileBySfi (const uint8_t sfi) const override |
| const std::shared_ptr< ElementaryFile > | getFileByLid (const uint16_t lid) const override |
| const std::map< const uint8_t, const std::shared_ptr< ElementaryFile > > | getAllFiles () const override |
| const std::vector< std::shared_ptr< ElementaryFile > > & | getFiles () const override |
| bool | isPinBlocked () const override |
| int | getPinAttemptRemaining () const override |
| void | setPinAttemptRemaining (const int pinAttemptCounter) |
| void | setFileHeader (const uint8_t sfi, const std::shared_ptr< FileHeaderAdapter > header) |
| void | setContent (const uint8_t sfi, const uint8_t numRecord, const std::vector< uint8_t > &content) |
| void | setCounter (const uint8_t sfi, const uint8_t numCounter, const std::vector< uint8_t > &content) |
| void | setContent (const uint8_t sfi, const uint8_t numRecord, const std::vector< uint8_t > &content, const int offset) |
| void | fillContent (const uint8_t sfi, const uint8_t numRecord, const std::vector< uint8_t > &content, const int offset) |
| void | addCyclicContent (const uint8_t sfi, const std::vector< uint8_t > content) |
| void | backupFiles () |
| void | restoreFiles () |
| const std::string & | getPowerOnData () const override |
| const std::vector< uint8_t > | getSelectApplicationResponse () const override |
| void | setCardChallenge (const std::vector< uint8_t > &cardChallenge) |
| void | setTraceabilityInformation (const std::vector< uint8_t > &traceabilityInformation) |
| void | setSvOperationSignature (const std::vector< uint8_t > &svOperationSignature) |
| const std::vector< uint8_t > & | getCardChallenge () const |
| uint8_t | getSvKvc () const |
| const std::vector< uint8_t > & | getSvGetHeader () const |
| const std::vector< uint8_t > & | getSvGetData () const |
| const std::vector< uint8_t > & | getSvOperationSignature () const |
| bool | isCounterValuePostponed () const |
Friends | |
| KEYPLECARDCALYPSO_API std::ostream & | operator<< (std::ostream &os, const CalypsoCardAdapter &cca) |
| KEYPLECARDCALYPSO_API std::ostream & | operator<< (std::ostream &os, const std::shared_ptr< CalypsoCardAdapter > cca) |
(package-private)
Implementation of CalypsoCard.
Definition at line 59 of file CalypsoCardAdapter.h.
| keyple::card::calypso::CalypsoCardAdapter::CalypsoCardAdapter | ( | ) |
| void keyple::card::calypso::CalypsoCardAdapter::addCyclicContent | ( | const uint8_t | sfi, |
| const std::vector< uint8_t > | content | ||
| ) |
(package-private)
Add cyclic content at record #1 by rolling previously all actual records contents (record #1 -> record #2, record #2 -> record #3,...) of the current selected file.
This is useful for cyclic files. Note that records are infinitely shifted.
If EF does not exist, then it is created.
| sfi | the SFI. |
| content | the content (should be not empty). |
Definition at line 724 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::backupFiles | ( | ) |
(package-private)
Make a backup of the Elementary Files.
This method should be used before starting a card secure session.
Definition at line 730 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::fillContent | ( | const uint8_t | sfi, |
| const uint8_t | numRecord, | ||
| const std::vector< uint8_t > & | content, | ||
| const int | offset | ||
| ) |
(package-private)
Fills the content at the specified offset of the specified record of the current selected file using a binary OR operation with the provided content.
If EF does not exist, then it is created.
If actual record content is not set or has a size
offset + content size, then missing data will be completed by the provided content.
| sfi | the SFI. |
| numRecord | the record number (should be >=
|
| content | the content (should be not empty). |
| offset | the offset (should be >=
|
Definition at line 714 of file CalypsoCardAdapter.cpp.
|
override |
|
override |
Definition at line 327 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 391 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 361 of file CalypsoCardAdapter.cpp.
| const std::vector< uint8_t > & keyple::card::calypso::CalypsoCardAdapter::getCalypsoSerialNumberFull | ( | ) | const |
(package-private)
Gets the full Calypso serial number including the possible validity date information in the two MSB.
The serial number to be used as diversifier for key derivation.
This is the complete number returned by the card in its response to the Select command.
Definition at line 322 of file CalypsoCardAdapter.cpp.
| const std::vector< uint8_t > & keyple::card::calypso::CalypsoCardAdapter::getCardChallenge | ( | ) | const |
(package-private)
Gets the challenge received from the card
Definition at line 779 of file CalypsoCardAdapter.cpp.
| CalypsoCardClass keyple::card::calypso::CalypsoCardAdapter::getCardClass | ( | ) | const |
(package-private)
Gets the current card class.
Definition at line 547 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 317 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 552 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 583 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 566 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 609 of file CalypsoCardAdapter.cpp.
| int keyple::card::calypso::CalypsoCardAdapter::getModificationsCounter | ( | ) | const |
(package-private)
Indicates the maximum number of changes allowed in session.
This number can be a number of operations or a number of commands (see isModificationsCounterInBytes)
Definition at line 351 of file CalypsoCardAdapter.cpp.
| uint8_t keyple::card::calypso::CalypsoCardAdapter::getPayloadCapacity | ( | ) | const |
(package-private)
Gets the maximum length of data that an APDU in this card can carry.
Definition at line 341 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 659 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 356 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 749 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 307 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 754 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 411 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 396 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 406 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 401 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 336 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 476 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 521 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 509 of file CalypsoCardAdapter.cpp.
| const std::vector< uint8_t > & keyple::card::calypso::CalypsoCardAdapter::getSvGetData | ( | ) | const |
(package-private)
Gets the SV Get command response data
| IllegalStateException | If the requested data has not been set. |
Definition at line 799 of file CalypsoCardAdapter.cpp.
| const std::vector< uint8_t > & keyple::card::calypso::CalypsoCardAdapter::getSvGetHeader | ( | ) | const |
(package-private)
Gets the SV Get command header
| IllegalStateException | If the requested data has not been set. |
Definition at line 789 of file CalypsoCardAdapter.cpp.
| uint8_t keyple::card::calypso::CalypsoCardAdapter::getSvKvc | ( | ) | const |
(package-private)
Gets the SV KVC from the card
Definition at line 784 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 485 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 494 of file CalypsoCardAdapter.cpp.
| const std::vector< uint8_t > & keyple::card::calypso::CalypsoCardAdapter::getSvOperationSignature | ( | ) | const |
(package-private)
Gets the last SV Operation signature (SV Reload, Debit or Undebit)
Definition at line 809 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 416 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 437 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::initialize | ( | const std::shared_ptr< CardSelectionResponseApi > | cardSelectionResponse | ) |
Post-construction initialization function
/!\ C++ specific
Definition at line 78 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::initializeWithFci | ( | const std::shared_ptr< CmdCardGetDataFci > | cmdCardGetDataFci | ) |
(package-private)
Initializes or post-initializes the object with the application FCI data.
| cmdCardGetDataFci | The command containing the parsed FCI data. |
| IllegalArgumentException | If the FCI is inconsistent. |
Definition at line 206 of file CalypsoCardAdapter.cpp.
| bool keyple::card::calypso::CalypsoCardAdapter::isCounterValuePostponed | ( | ) | const |
(package-private)
Indicates if the response of the Increase/Decrease counter command is postponed to the close secure session (old revision 2 cards).
Definition at line 858 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 422 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 427 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 366 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 312 of file CalypsoCardAdapter.cpp.
| bool keyple::card::calypso::CalypsoCardAdapter::isModificationsCounterInBytes | ( | ) | const |
(package-private)
Tells if the change counter allowed in session is established in number of operations or number of bytes modified.
This varies depending on the product type of the card.
Definition at line 346 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 654 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 381 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 386 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 371 of file CalypsoCardAdapter.cpp.
|
override |
Definition at line 376 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::restoreFiles | ( | ) |
(package-private)
Restore the last backup of Elementary Files.
This method should be used when SW of the card close secure session command is unsuccessful or if secure session is aborted.
Definition at line 735 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::setCardChallenge | ( | const std::vector< uint8_t > & | cardChallenge | ) |
(package-private)
Sets the challenge received in response to the GET CHALLENGE command.
| cardChallenge | A not empty array. |
Definition at line 763 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::setContent | ( | const uint8_t | sfi, |
| const uint8_t | numRecord, | ||
| const std::vector< uint8_t > & | content | ||
| ) |
(package-private)
Set or replace the entire content of the specified record #numRecord of the current selected file by the provided content.
If EF does not exist, then it is created.
| sfi | the SFI. |
| numRecord | the record number (should be >=
|
| content | the content (should be not empty). |
Definition at line 688 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::setContent | ( | const uint8_t | sfi, |
| const uint8_t | numRecord, | ||
| const std::vector< uint8_t > & | content, | ||
| const int | offset | ||
| ) |
(package-private)
Set or replace the content at the specified offset of record #numRecord of the current selected file by a copy of the provided content.
If EF does not exist, then it is created.
If actual record content is not set or has a size
offset, then missing data will be padded with 0.
| sfi | the SFI. |
| numRecord | the record number (should be >=
|
| content | the content (should be not empty). |
| offset | the offset (should be >=
|
Definition at line 704 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::setCounter | ( | const uint8_t | sfi, |
| const uint8_t | numCounter, | ||
| const std::vector< uint8_t > & | content | ||
| ) |
(package-private)
Sets a counter value in record #1 of the current selected file.
If EF does not exist, then it is created.
| sfi | the SFI. |
| numCounter | the counter number (should be >=
|
| content | the counter value (should be not null and 3 bytes length). |
Definition at line 696 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::setDfRatified | ( | const bool | dfRatified | ) |
(package-private)
Sets the ratification status
| dfRatified | true if the session was ratified. |
Definition at line 542 of file CalypsoCardAdapter.cpp.
| CalypsoCard & keyple::card::calypso::CalypsoCardAdapter::setDirectoryHeader | ( | const std::shared_ptr< DirectoryHeader > | directoryHeader | ) |
(package-private)
Sets the DF metadata.
Updates the invalidation flag.
| directoryHeader | the DF metadata (should be not null). |
Definition at line 557 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::setFileHeader | ( | const uint8_t | sfi, |
| const std::shared_ptr< FileHeaderAdapter > | header | ||
| ) |
(package-private)
Sets the provided ileHeaderAdapter} to the current selected file.
If EF does not exist, then it is created.
| sfi | the SFI. |
| header | the file header (should be not null). |
Definition at line 673 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::setPinAttemptRemaining | ( | const int | pinAttemptCounter | ) |
(package-private)
Sets the PIN attempts counter.
The PIN attempt counter is interpreted to give the results of the methods isPinBlocked and getPinAttemptRemaining.
| pinAttemptCounter | the number of remaining attempts to present the PIN code. |
Definition at line 668 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::setSvData | ( | const uint8_t | svKvc, |
| const std::vector< uint8_t > & | svGetHeader, | ||
| const std::vector< uint8_t > & | svGetData, | ||
| const int | svBalance, | ||
| const int | svLastTNum, | ||
| const std::shared_ptr< SvLoadLogRecord > | svLoadLogRecord, | ||
| const std::shared_ptr< SvDebitLogRecord > | svDebitLogRecord | ||
| ) |
(package-private)
Sets the Stored Value data from the SV Get command
| svKvc | The KVC value. |
| svGetHeader | A not empty array. |
| svGetData | A not empty array. |
| svBalance | the current SV balance. |
| svLastTNum | the last SV transaction number. |
| svLoadLogRecord | the SV load log record (it may be null if not available). |
| svDebitLogRecord | the SV debit log record (it may be null if not available). |
Definition at line 452 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::setSvOperationSignature | ( | const std::vector< uint8_t > & | svOperationSignature | ) |
(package-private)
Sets the SV signature.
| svOperationSignature | A not empty array. |
Definition at line 774 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::setTraceabilityInformation | ( | const std::vector< uint8_t > & | traceabilityInformation | ) |
(package-private)
Sets the traceability information received in response to the GET DATA command for the tag GetDataTag::TRACEABILITY_INFORMATION}.
| traceabilityInformation | The traceability information. |
Definition at line 768 of file CalypsoCardAdapter.cpp.
| void keyple::card::calypso::CalypsoCardAdapter::setTransactionCounter | ( | const int | transactionCounter | ) |
(package-private)
Sets the transaction counter.
| transactionCounter | The counter value. |
Definition at line 447 of file CalypsoCardAdapter.cpp.
|
friend |
Definition at line 926 of file CalypsoCardAdapter.cpp.
|
friend |
Definition at line 968 of file CalypsoCardAdapter.cpp.