Keyple C++
0.9.0
Keyple, an Open Source SDK for Ticketing
|
#include <AbstractIso7816CommandBuilder.h>
Inherits keyple::core::command::AbstractApduCommandBuilder.
Inherited by keyple::calypso::command::po::AbstractPoCommandBuilder< AbstractOpenSessionRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< AppendRecordRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< ChangeKeyRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< CloseSessionRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< DecreaseRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< GetDataFciRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< GetDataTraceRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< IncreaseRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< InvalidateRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< PoGetChallengeRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< ReadRecordsRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< RehabilitateRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< SelectFileRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< SvDebitRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< SvGetRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< SvReloadRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< SvUndebitRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< UpdateRecordRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< VerifyPinRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< WriteRecordRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< CardCipherPinRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< CardGenerateKeyRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< DigestAuthenticateRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< DigestCloseRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< DigestInitRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< DigestUpdateMultipleRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< DigestUpdateRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< GiveRandomRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< SamGetChallengeRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< SamReadCeilingsRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< SamReadEventCounterRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< SamReadKeyParametersRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< SamWriteKeyRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< SelectDiversifierRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< SvCheckRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< SvPrepareOperationRespPars >, keyple::calypso::command::sam::AbstractSamCommandBuilder< UnlockRespPars >, keyple::calypso::command::po::AbstractPoCommandBuilder< T >, and keyple::calypso::command::sam::AbstractSamCommandBuilder< T >.
Public Member Functions | |
AbstractIso7816CommandBuilder (const std::shared_ptr< SeCommand > commandReference, const std::shared_ptr< ApduRequest > request) | |
AbstractIso7816CommandBuilder (const std::string &name, const std::shared_ptr< ApduRequest > request) | |
virtual | ~AbstractIso7816CommandBuilder ()=default |
![]() | |
AbstractApduCommandBuilder (const std::shared_ptr< SeCommand > commandRef, const std::shared_ptr< ApduRequest > request) | |
AbstractApduCommandBuilder (const std::string &name, const std::shared_ptr< ApduRequest > request) | |
virtual | ~AbstractApduCommandBuilder ()=default |
virtual void | addSubName (const std::string &subName) |
virtual const std::shared_ptr< SeCommand > | getCommandRef () const |
virtual const std::string & | getName () const |
virtual const std::shared_ptr< ApduRequest > | getApduRequest () const |
Protected Member Functions | |
virtual std::shared_ptr< ApduRequest > | setApduRequest (const uint8_t cla, const SeCommand &command, const uint8_t p1, const uint8_t p2, const std::vector< uint8_t > &dataIn) |
virtual std::shared_ptr< ApduRequest > | setApduRequest (const uint8_t cla, const SeCommand &command, const uint8_t p1, const uint8_t p2, const uint8_t le) |
virtual std::shared_ptr< ApduRequest > | setApduRequest (const uint8_t cla, const SeCommand &command, const uint8_t p1, const uint8_t p2, const std::vector< uint8_t > &dataIn, const uint8_t le) |
Additional Inherited Members | |
![]() | |
const std::shared_ptr< SeCommand > | mCommandRef |
std::shared_ptr< ApduRequest > | mRequest |
Iso7816 APDU command builder.
It has to be extended by all PO and SAM command builder classes.
It provides, through the AbstractApduCommandBuilder superclass, the generic getters to retrieve:
keyple::core::command::AbstractIso7816CommandBuilder::AbstractIso7816CommandBuilder | ( | const std::shared_ptr< SeCommand > | commandReference, |
const std::shared_ptr< ApduRequest > | request | ||
) |
Abstract constructor to build a command with a command reference and an keyple::core::seproxy::message::ApduRequest.
commandReference | command reference |
request | ApduRequest |
keyple::core::command::AbstractIso7816CommandBuilder::AbstractIso7816CommandBuilder | ( | const std::string & | name, |
const std::shared_ptr< ApduRequest > | request | ||
) |
Abstract constructor to build a command with a command name and an keyple::core::seproxy::message::ApduRequest
name | name of command |
request | ApduRequest |
|
virtualdefault |
|
protectedvirtual |
Helper method to create an ApduRequest from separated elements.
The ISO7816-4 case for data in a command-response pair is determined from the provided arguments:
dataIn = null, le = null
→ case 1: no command data, no response data expected. dataIn = null, le != null
→ case 2: no command data, expected response data. dataIn != null, le = null
→ case 3: command data, no response data expected. dataIn != null, le = 0
→ case 4: command data, expected response data. If dataIn is not null and Le > 0 an IllegalArgumentException is thrown
cla | class of instruction |
command | instruction code |
p1 | instruction parameter 1 |
p2 | instruction parameter 2 |
dataIn | bytes sent in the data field of the command. dataIn.limit will be Lc (Number of bytes present in the data field of the command) |
|
protectedvirtual |
Helper method to create an ApduRequest from separated elements.
The ISO7816-4 case for data in a command-response pair is determined from the provided arguments:
dataIn = null, le = null
→ case 1: no command data, no response data expected. dataIn = null, le != null
→ case 2: no command data, expected response data. dataIn != null, le = null
→ case 3: command data, no response data expected. dataIn != null, le = 0
→ case 4: command data, expected response data. If dataIn is not null and Le > 0 an IllegalArgumentException is thrown
cla | class of instruction |
command | instruction code |
p1 | instruction parameter 1 |
p2 | instruction parameter 2 |
dataIn | bytes sent in the data field of the command. dataIn.limit will be Lc (Number of bytes present in the data field of the command) |
le | maximum number of bytes expected in the data field of the response to the command (set to 0 is the case where ingoing and outgoing are present. Let the lower layer to handle the actual length [case4]) |
|
protectedvirtual |
Helper method to create an ApduRequest from separated elements.
The ISO7816-4 case for data in a command-response pair is determined from the provided arguments:
dataIn = null, le = null
→ case 1: no command data, no response data expected. dataIn = null, le != null
→ case 2: no command data, expected response data. dataIn != null, le = null
→ case 3: command data, no response data expected. dataIn != null, le = 0
→ case 4: command data, expected response data. If dataIn is not null and Le > 0 an IllegalArgumentException is thrown
cla | class of instruction |
command | instruction code |
p1 | instruction parameter 1 |
p2 | instruction parameter 2 |
le | maximum number of bytes expected in the data field of the response to the command (set to 0 is the case where ingoing and outgoing are present. Let the lower layer to handle the actual length [case4]) |