Keyple C++  0.9.0
Keyple, an Open Source SDK for Ticketing
Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
keyple::calypso::command::sam::AbstractSamResponseParser Class Reference

#include <AbstractSamResponseParser.h>

Inherits keyple::core::command::AbstractApduResponseParser.

Inherited by keyple::calypso::command::sam::parser::security::CardCipherPinRespPars, keyple::calypso::command::sam::parser::security::CardGenerateKeyRespPars, keyple::calypso::command::sam::parser::security::DigestAuthenticateRespPars, keyple::calypso::command::sam::parser::security::DigestCloseRespPars, keyple::calypso::command::sam::parser::security::DigestInitRespPars, keyple::calypso::command::sam::parser::security::DigestUpdateMultipleRespPars, keyple::calypso::command::sam::parser::security::DigestUpdateRespPars, keyple::calypso::command::sam::parser::security::GiveRandomRespPars, keyple::calypso::command::sam::parser::security::SamGetChallengeRespPars, keyple::calypso::command::sam::parser::security::SamReadCeilingsRespPars, keyple::calypso::command::sam::parser::security::SamReadEventCounterRespPars, keyple::calypso::command::sam::parser::security::SamReadKeyParametersRespPars, keyple::calypso::command::sam::parser::security::SamWriteKeyRespPars, keyple::calypso::command::sam::parser::security::SelectDiversifierRespPars, keyple::calypso::command::sam::parser::security::SvCheckRespPars, keyple::calypso::command::sam::parser::security::SvPrepareOperationRespPars, and keyple::calypso::command::sam::parser::security::UnlockRespPars.

Public Member Functions

 AbstractSamResponseParser (const std::shared_ptr< ApduResponse > response, AbstractSamCommandBuilder< AbstractSamResponseParser > *builder)
 
 AbstractSamResponseParser (const AbstractSamResponseParser &asrp)=default
 
virtual ~AbstractSamResponseParser ()=default
 
AbstractApduCommandBuildergetBuilder () const override
 
void checkStatus () const override
 
- Public Member Functions inherited from keyple::core::command::AbstractApduResponseParser
 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< ApduResponsegetApduResponse () const
 
virtual bool isSuccessful () const
 
std::string getStatusInformation () const
 

Protected Member Functions

const std::map< int, std::shared_ptr< StatusProperties > > & getStatusTable () const override
 
const KeypleSeCommandException buildCommandException (const std::type_info &exceptionClass, const std::string &message, const std::shared_ptr< SeCommand > commandRef, const int statusCode) const override
 
- Protected Member Functions inherited from keyple::core::command::AbstractApduResponseParser
virtual const std::shared_ptr< SeCommandgetCommandRef () const
 

Static Protected Attributes

static const std::map< int, std::shared_ptr< StatusProperties > > STATUS_TABLE
 
- Static Protected Attributes inherited from keyple::core::command::AbstractApduResponseParser
static const std::map< int, std::shared_ptr< StatusProperties > > STATUS_TABLE
 

Additional Inherited Members

- Protected Attributes inherited from keyple::core::command::AbstractApduResponseParser
std::shared_ptr< ApduResponsemResponse
 
AbstractApduCommandBuildermBuilder
 

Constructor & Destructor Documentation

◆ AbstractSamResponseParser() [1/2]

keyple::calypso::command::sam::AbstractSamResponseParser::AbstractSamResponseParser ( const std::shared_ptr< ApduResponse response,
AbstractSamCommandBuilder< AbstractSamResponseParser > *  builder 
)

Constructor to build a parser of the APDU response.

Parameters
responseresponse to parse
builderthe reference of the builder that created the parser

◆ AbstractSamResponseParser() [2/2]

keyple::calypso::command::sam::AbstractSamResponseParser::AbstractSamResponseParser ( const AbstractSamResponseParser asrp)
default

Copy constructor

Required by macOS/CLang

◆ ~AbstractSamResponseParser()

virtual keyple::calypso::command::sam::AbstractSamResponseParser::~AbstractSamResponseParser ( )
virtualdefault

Member Function Documentation

◆ buildCommandException()

const KeypleSeCommandException keyple::calypso::command::sam::AbstractSamResponseParser::buildCommandException ( const std::type_info &  exceptionClass,
const std::string &  message,
const std::shared_ptr< SeCommand commandRef,
const int  statusCode 
) const
overrideprotectedvirtual

Build a command exception.
This method should be override in subclasses in order to create specific exceptions.

Parameters
exceptionClassthe exception class
messagethe message
commandRefthe command reference
statusCodethe status code
Returns
a new instance not null

Reimplemented from keyple::core::command::AbstractApduResponseParser.

◆ checkStatus()

void keyple::calypso::command::sam::AbstractSamResponseParser::checkStatus ( ) const
overridevirtual

This method check the status code.
If status code is not referenced, then status is considered unsuccessful.

Exceptions
KeypleSeCommandExceptionif status is not successful.

Reimplemented from keyple::core::command::AbstractApduResponseParser.

◆ getBuilder()

AbstractApduCommandBuilder * keyple::calypso::command::sam::AbstractSamResponseParser::getBuilder ( ) const
overridevirtual

Returns
the associated builder reference

Return type should be AbstractSamCommandBuilder<AbstractSamResponseParser>*

Reimplemented from keyple::core::command::AbstractApduResponseParser.

◆ getStatusTable()

const std::map< int, std::shared_ptr< StatusProperties > > & keyple::calypso::command::sam::AbstractSamResponseParser::getStatusTable ( ) const
overrideprotectedvirtual

Member Data Documentation

◆ STATUS_TABLE

const std::map< int, std::shared_ptr< StatusProperties > > keyple::calypso::command::sam::AbstractSamResponseParser::STATUS_TABLE
staticprotected
Initial value:
= {
{
0x6D00,
std::make_shared<StatusProperties>("Instruction unknown.",
typeid(CalypsoSamIllegalParameterException))
}, {
0x6E00,
std::make_shared<StatusProperties>("Class not supported.",
typeid(CalypsoSamIllegalParameterException))
}, {
0x9000,
std::make_shared<StatusProperties>("Success")
}
}

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