Keypop Generic Card C++ API - 1.0.0
Component of the Keypop C++ API
keypop::genericcard::CardTransactionManager Class Referenceabstract

Provides basic methods to prepare and process APDU exchange with a card. More...

#include <keypop/genericcard/CardTransactionManager.hpp>

Inheritance diagram for keypop::genericcard::CardTransactionManager:
Collaboration diagram for keypop::genericcard::CardTransactionManager:

Public Member Functions

virtual ~CardTransactionManager ()=default
 
virtual CardTransactionManager & prepareApdu (const std::string &apduCommand)=0
 Prepares an APDU to be transmitted the next time processCommands(keypop::reader::ChannelControl) is invoked. More...
 
virtual CardTransactionManager & prepareApdu (const std::vector< std::uint8_t > &apduCommand)=0
 Prepares an APDU to be transmitted the next time processCommands(keypop::reader::ChannelControl) is invoked. More...
 
virtual CardTransactionManager & prepareApdu (const std::uint8_t cla, const std::uint8_t ins, const std::uint8_t p1, const std::uint8_t p2, const std::vector< std::uint8_t > &dataIn, const std::uint8_t le)=0
 Prepares an APDU to be transmitted the next time processCommands(keypop::reader::ChannelControl) is invoked. More...
 
virtual CardTransactionManager & prepareApdu (const std::uint8_t cla, const std::uint8_t ins, const std::uint8_t p1, const std::uint8_t p2, const std::vector< std::uint8_t > &dataIn)=0
 Prepares an APDU to be transmitted the next time processCommands(keypop::reader::ChannelControl) is invoked. More...
 
virtual const std::vector< std::vector< std::uint8_t > > getResponsesAsByteArrays ()=0
 Returns the list of responses corresponding to the commands executed by the last call to processCommands(keypop::reader::ChannelControl), represented as byte arrays. More...
 
virtual const std::vector< std::string > getResponsesAsHexStrings ()=0
 Returns the list of responses corresponding to the commands executed by the last call to processCommands(keypop::reader::ChannelControl), represented as hexadecimal strings. More...
 

Detailed Description

Provides basic methods to prepare and process APDU exchange with a card.

Since
1.0.0

Definition at line 30 of file CardTransactionManager.hpp.

Constructor & Destructor Documentation

◆ ~CardTransactionManager()

virtual keypop::genericcard::CardTransactionManager::~CardTransactionManager ( )
virtualdefault

Member Function Documentation

◆ getResponsesAsByteArrays()

virtual const std::vector< std::vector< std::uint8_t > > keypop::genericcard::CardTransactionManager::getResponsesAsByteArrays ( )
pure virtual

Returns the list of responses corresponding to the commands executed by the last call to processCommands(keypop::reader::ChannelControl), represented as byte arrays.

Each element in the returned list represents the response of one command, in the same order as the commands were prepared. The returned list is never null.
This method does not alter the internal state of the manager: the list of responses remains available for later calls until processCommands(keypop::reader::ChannelControl) is invoked again, at which point it is replaced by the new set of responses.

Returns
A not-null list of byte arrays representing the command responses, in the same order as the commands were sent.
Since
1.0.0

◆ getResponsesAsHexStrings()

virtual const std::vector< std::string > keypop::genericcard::CardTransactionManager::getResponsesAsHexStrings ( )
pure virtual

Returns the list of responses corresponding to the commands executed by the last call to processCommands(keypop::reader::ChannelControl), represented as hexadecimal strings.

Each element in the returned list represents the response of one command, in the same order as the commands were prepared. The returned list is never null.
This method does not alter the internal state of the manager: the list of responses remains available for later calls until processCommands(keypop::reader::ChannelControl) is invoked again, at which point it is replaced by the new set of responses.

Returns
A not-null list of hexadecimal strings representing the command responses, in the same order as the commands were sent.
Since
1.0.0

◆ prepareApdu() [1/4]

virtual CardTransactionManager & keypop::genericcard::CardTransactionManager::prepareApdu ( const std::string &  apduCommand)
pure virtual

Prepares an APDU to be transmitted the next time processCommands(keypop::reader::ChannelControl) is invoked.

Parameters
apduCommandA not empty hexadecimal string containing a raw APDU command.
Returns
This instance.
Since
1.0.0

◆ prepareApdu() [2/4]

virtual CardTransactionManager & keypop::genericcard::CardTransactionManager::prepareApdu ( const std::uint8_t  cla,
const std::uint8_t  ins,
const std::uint8_t  p1,
const std::uint8_t  p2,
const std::vector< std::uint8_t > &  dataIn 
)
pure virtual

Prepares an APDU to be transmitted the next time processCommands(keypop::reader::ChannelControl) is invoked.

Parameters
claThe class byte.
insThe instruction byte.
p1The P1 parameter.
p2The P2 parameter.
dataInThe APDU data, empty if there is no data.
Returns
This instance.
Since
1.0.0

◆ prepareApdu() [3/4]

virtual CardTransactionManager & keypop::genericcard::CardTransactionManager::prepareApdu ( const std::uint8_t  cla,
const std::uint8_t  ins,
const std::uint8_t  p1,
const std::uint8_t  p2,
const std::vector< std::uint8_t > &  dataIn,
const std::uint8_t  le 
)
pure virtual

Prepares an APDU to be transmitted the next time processCommands(keypop::reader::ChannelControl) is invoked.

Parameters
claThe class byte.
insThe instruction byte.
p1The P1 parameter.
p2The P2 parameter.
dataInThe APDU data, empty if there is no data.
leThe expected output length, 0 if the output length is unspecified..
Returns
This instance.
Since
1.0.0

◆ prepareApdu() [4/4]

virtual CardTransactionManager & keypop::genericcard::CardTransactionManager::prepareApdu ( const std::vector< std::uint8_t > &  apduCommand)
pure virtual

Prepares an APDU to be transmitted the next time processCommands(keypop::reader::ChannelControl) is invoked.

Parameters
apduCommandA not empty byte arrays containing raw APDU commands.
Returns
This instance.
Since
1.0.0

The documentation for this class was generated from the following file: