![]() |
Keyple Card Calypso C++ Library 2.2.2
Reference Terminal Reader API for C++
|
#include <AbstractApduCommand.h>
Classes | |
class | StatusProperties |
Public Member Functions | |
AbstractApduCommand (const CardCommand &commandRef, const int le) | |
virtual void | addSubName (const std::string &subName) final |
virtual const CardCommand & | getCommandRef () const |
virtual const std::string & | getName () const final |
virtual void | setApduRequest (const std::shared_ptr< ApduRequestAdapter > apduRequest) final |
virtual const std::shared_ptr< ApduRequestAdapter > | getApduRequest () const final |
virtual AbstractApduCommand & | setApduResponse (const std::shared_ptr< ApduResponseApi > apduResponse) |
virtual const std::shared_ptr< ApduResponseApi > | getApduResponse () const final |
virtual const std::map< const int, const std::shared_ptr< StatusProperties > > & | getStatusTable () const |
virtual const CalypsoApduCommandException | buildCommandException (const std::type_info &exceptionClass, const std::string &message) const =0 |
virtual const CalypsoApduCommandException | buildUnexpectedResponseLengthException (const std::string &message) const =0 |
virtual bool | isSuccessful () const final |
virtual void | checkStatus () |
virtual const std::string | getStatusInformation () const final |
Static Public Attributes | |
static const std::map< const int, const std::shared_ptr< StatusProperties > > | STATUS_TABLE |
(package-private)
Generic APDU command.
It provides the generic getters to retrieve:
Definition at line 48 of file AbstractApduCommand.h.
keyple::card::calypso::AbstractApduCommand::AbstractApduCommand | ( | const CardCommand & | commandRef, |
const int | le | ||
) |
(package-private)
Constructor
commandRef | The command reference. |
le | The value of the LE field. |
Definition at line 61 of file AbstractApduCommand.cpp.
|
finalvirtual |
(package-private)
Appends a string to the current name.
The sub name completes the name of the current command. This method must therefore only be invoked conditionally (log level >= debug).
subName | The string to append. |
NullPointerException | If the request is not set. |
Definition at line 64 of file AbstractApduCommand.cpp.
|
pure virtual |
(package-private)
Builds a specific APDU command exception.
message | The message. |
Implemented in keyple::card::calypso::AbstractCardCommand, and keyple::card::calypso::AbstractSamCommand.
|
pure virtual |
(package-private)
Builds a specific APDU command exception for the case of an unexpected response length.
message | The message. |
Implemented in keyple::card::calypso::AbstractCardCommand, and keyple::card::calypso::AbstractSamCommand.
|
virtual |
(package-private)
This method check the status word and if the length of the response is equal to the LE field in the request.
If status word is not referenced, then status is considered unsuccessful.
CalypsoApduCommandException | if status is not successful or if the length of the response is not equal to the LE field in the request. |
Reimplemented in keyple::card::calypso::AbstractCardCommand, keyple::card::calypso::AbstractSamCommand, and keyple::card::calypso::CmdSamDataCipher.
Definition at line 129 of file AbstractApduCommand.cpp.
|
finalvirtual |
(package-private)
Gets the ApduRequestAdapter.
Definition at line 86 of file AbstractApduCommand.cpp.
|
finalvirtual |
(package-private)
Gets ApduResponseApi
Definition at line 99 of file AbstractApduCommand.cpp.
|
virtual |
(package-private)
Gets CardCommand the current command identification
Reimplemented in keyple::card::calypso::AbstractCardCommand, and keyple::card::calypso::AbstractSamCommand.
Definition at line 70 of file AbstractApduCommand.cpp.
|
finalvirtual |
(package-private)
Gets the name of this APDU command.
Definition at line 75 of file AbstractApduCommand.cpp.
|
finalvirtual |
(package-private)
Gets the ASCII message from the statusTable for the current status word.
Definition at line 159 of file AbstractApduCommand.cpp.
|
virtual |
(package-private)
Returns the internal status table
Reimplemented in keyple::card::calypso::AbstractSamCommand, keyple::card::calypso::CmdCardAppendRecord, keyple::card::calypso::CmdCardChangeKey, keyple::card::calypso::CmdCardChangePin, keyple::card::calypso::CmdCardCloseSession, keyple::card::calypso::CmdCardGetDataEfList, keyple::card::calypso::CmdCardGetDataFci, keyple::card::calypso::CmdCardGetDataFcp, keyple::card::calypso::CmdCardGetDataTraceabilityInformation, keyple::card::calypso::CmdCardIncreaseOrDecrease, keyple::card::calypso::CmdCardIncreaseOrDecreaseMultiple, keyple::card::calypso::CmdCardInvalidate, keyple::card::calypso::CmdCardOpenSession, keyple::card::calypso::CmdCardReadBinary, keyple::card::calypso::CmdCardReadRecordMultiple, keyple::card::calypso::CmdCardReadRecords, keyple::card::calypso::CmdCardRehabilitate, keyple::card::calypso::CmdCardSearchRecordMultiple, keyple::card::calypso::CmdCardSelectFile, keyple::card::calypso::CmdCardSvDebitOrUndebit, keyple::card::calypso::CmdCardSvGet, keyple::card::calypso::CmdCardSvReload, keyple::card::calypso::CmdCardUpdateOrWriteBinary, keyple::card::calypso::CmdCardUpdateRecord, keyple::card::calypso::CmdCardVerifyPin, keyple::card::calypso::CmdCardWriteRecord, keyple::card::calypso::CmdSamCardCipherPin, keyple::card::calypso::CmdSamCardGenerateKey, keyple::card::calypso::CmdSamDataCipher, keyple::card::calypso::CmdSamDigestAuthenticate, keyple::card::calypso::CmdSamDigestClose, keyple::card::calypso::CmdSamDigestInit, keyple::card::calypso::CmdSamDigestUpdate, keyple::card::calypso::CmdSamDigestUpdateMultiple, keyple::card::calypso::CmdSamGetChallenge, keyple::card::calypso::CmdSamGiveRandom, keyple::card::calypso::CmdSamPsoComputeSignature, keyple::card::calypso::CmdSamPsoVerifySignature, keyple::card::calypso::CmdSamReadCeilings, keyple::card::calypso::CmdSamReadEventCounter, keyple::card::calypso::CmdSamReadKeyParameters, keyple::card::calypso::CmdSamSelectDiversifier, keyple::card::calypso::CmdSamSvCheck, keyple::card::calypso::CmdSamSvPrepareDebitOrUndebit, keyple::card::calypso::CmdSamSvPrepareLoad, keyple::card::calypso::CmdSamUnlock, and keyple::card::calypso::CmdSamWriteKey.
Definition at line 105 of file AbstractApduCommand.cpp.
|
finalvirtual |
(package-private)
Gets true if the status is successful from the statusTable according to the current status code and if the length of the response is equal to the LE field in the request.
Definition at line 119 of file AbstractApduCommand.cpp.
|
finalvirtual |
(package-private)
Sets the command ApduRequestAdapter.
apduRequest | The APDU request. |
Definition at line 80 of file AbstractApduCommand.cpp.
|
virtual |
(package-private)
Sets the command ApduResponseApi.
apduResponse | The APDU response. |
Reimplemented in keyple::card::calypso::AbstractCardCommand, keyple::card::calypso::AbstractSamCommand, keyple::card::calypso::CmdCardCloseSession, keyple::card::calypso::CmdCardGetDataFci, keyple::card::calypso::CmdCardIncreaseOrDecreaseMultiple, keyple::card::calypso::CmdCardOpenSession, keyple::card::calypso::CmdCardReadRecordMultiple, keyple::card::calypso::CmdCardReadRecords, keyple::card::calypso::CmdCardSearchRecordMultiple, keyple::card::calypso::CmdCardSvDebitOrUndebit, keyple::card::calypso::CmdCardSvGet, keyple::card::calypso::CmdCardSvReload, keyple::card::calypso::CmdSamDataCipher, keyple::card::calypso::CmdSamPsoComputeSignature, and keyple::card::calypso::CmdSamPsoVerifySignature.
Definition at line 91 of file AbstractApduCommand.cpp.
|
static |
(package-private)
This Map stores expected status that could be by default initialized with sw1=90 and sw2=00 (Success)
Definition at line 129 of file AbstractApduCommand.h.