Keyple C++
0.9.0
Keyple, an Open Source SDK for Ticketing
|
#include <AbstractApduResponseParser.h>
Inherited by keyple::calypso::command::po::AbstractPoResponseParser, and keyple::calypso::command::sam::AbstractSamResponseParser.
Classes | |
class | StatusProperties |
Public Member Functions | |
AbstractApduResponseParser (const std::shared_ptr< ApduResponse > response, AbstractApduCommandBuilder *builder) | |
AbstractApduResponseParser (const AbstractApduResponseParser &aarp)=default | |
virtual | ~AbstractApduResponseParser ()=default |
void | setApduResponse (const std::shared_ptr< ApduResponse > &response) |
const std::shared_ptr< ApduResponse > | getApduResponse () const |
virtual AbstractApduCommandBuilder * | getBuilder () const |
virtual bool | isSuccessful () const |
std::string | getStatusInformation () const |
virtual void | checkStatus () const |
Protected Member Functions | |
virtual const KeypleSeCommandException | buildCommandException (const std::type_info &exceptionClass, const std::string &message, const std::shared_ptr< SeCommand > commandRef, const int statusCode) const |
virtual const std::map< int, std::shared_ptr< StatusProperties > > & | getStatusTable () const |
virtual const std::shared_ptr< SeCommand > | getCommandRef () const |
Protected Attributes | |
std::shared_ptr< ApduResponse > | mResponse |
AbstractApduCommandBuilder * | mBuilder |
Static Protected Attributes | |
static const std::map< int, std::shared_ptr< StatusProperties > > | STATUS_TABLE |
Base class for parsing APDU
keyple::core::command::AbstractApduResponseParser::AbstractApduResponseParser | ( | const std::shared_ptr< ApduResponse > | response, |
AbstractApduCommandBuilder * | builder | ||
) |
the generic abstract constructor to build a parser of the APDU response.
response | response to parse |
builder | the reference of the builder that created the parser |
|
default |
Copy constructor
Required by macOS/CLang...
|
virtualdefault |
|
protectedvirtual |
Build a command exception.
This method should be override in subclasses in order to create specific exceptions.
exceptionClass | the exception class |
message | the message |
commandRef | the command reference |
statusCode | the status code |
Reimplemented in keyple::calypso::command::sam::AbstractSamResponseParser, and keyple::calypso::command::po::AbstractPoResponseParser.
|
virtual |
This method check the status code.
If status code is not referenced, then status is considered unsuccessful.
KeypleSeCommandException | if status is not successful. |
Reimplemented in keyple::calypso::command::sam::AbstractSamResponseParser, and keyple::calypso::command::po::AbstractPoResponseParser.
const std::shared_ptr< ApduResponse > keyple::core::command::AbstractApduResponseParser::getApduResponse | ( | ) | const |
Gets the apdu response.
|
virtual |
Reimplemented in keyple::calypso::command::sam::AbstractSamResponseParser, and keyple::calypso::command::po::AbstractPoResponseParser.
|
protectedvirtual |
Gets the associated command reference.
By default, the command reference is retrieved from the associated builder.
std::string keyple::core::command::AbstractApduResponseParser::getStatusInformation | ( | ) | const |
|
protectedvirtual |
Reimplemented in keyple::calypso::command::sam::parser::security::UnlockRespPars, keyple::calypso::command::sam::parser::security::SvPrepareOperationRespPars, keyple::calypso::command::sam::parser::security::SvCheckRespPars, keyple::calypso::command::sam::parser::security::SelectDiversifierRespPars, keyple::calypso::command::sam::parser::security::SamWriteKeyRespPars, keyple::calypso::command::sam::parser::security::SamReadKeyParametersRespPars, keyple::calypso::command::sam::parser::security::SamReadEventCounterRespPars, keyple::calypso::command::sam::parser::security::SamReadCeilingsRespPars, keyple::calypso::command::sam::parser::security::SamGetChallengeRespPars, keyple::calypso::command::sam::parser::security::GiveRandomRespPars, keyple::calypso::command::sam::parser::security::DigestUpdateRespPars, keyple::calypso::command::sam::parser::security::DigestUpdateMultipleRespPars, keyple::calypso::command::sam::parser::security::DigestInitRespPars, keyple::calypso::command::sam::parser::security::DigestCloseRespPars, keyple::calypso::command::sam::parser::security::DigestAuthenticateRespPars, keyple::calypso::command::sam::parser::security::CardGenerateKeyRespPars, keyple::calypso::command::sam::parser::security::CardCipherPinRespPars, keyple::calypso::command::sam::AbstractSamResponseParser, keyple::calypso::command::po::parser::WriteRecordRespPars, keyple::calypso::command::po::parser::UpdateRecordRespPars, keyple::calypso::command::po::parser::storedvalue::SvUndebitRespPars, keyple::calypso::command::po::parser::storedvalue::SvReloadRespPars, keyple::calypso::command::po::parser::storedvalue::SvGetRespPars, keyple::calypso::command::po::parser::storedvalue::SvDebitRespPars, keyple::calypso::command::po::parser::SelectFileRespPars, keyple::calypso::command::po::parser::security::VerifyPinRespPars, keyple::calypso::command::po::parser::security::RehabilitateRespPars, keyple::calypso::command::po::parser::security::InvalidateRespPars, keyple::calypso::command::po::parser::security::CloseSessionRespPars, keyple::calypso::command::po::parser::security::ChangeKeyRespPars, keyple::calypso::command::po::parser::security::AbstractOpenSessionRespPars, keyple::calypso::command::po::parser::ReadRecordsRespPars, keyple::calypso::command::po::parser::IncreaseRespPars, keyple::calypso::command::po::parser::GetDataTraceRespPars, keyple::calypso::command::po::parser::GetDataFciRespPars, keyple::calypso::command::po::parser::DecreaseRespPars, and keyple::calypso::command::po::parser::AppendRecordRespPars.
|
virtual |
void keyple::core::command::AbstractApduResponseParser::setApduResponse | ( | const std::shared_ptr< ApduResponse > & | response | ) |
Sets the Apdu response to parse
response | the apdu response |
|
protected |
Parsers are usually created by their associated builder. The CalypsoSam field maintains a link between the builder and the parser in order to allow the parser to access the builder parameters that were used to create the command (e.g. SFI, registration number, etc.).
|
protected |
The byte array APDU response
|
staticprotected |