Keyple Card Calypso C++ Library 2.2.5.6
Reference Terminal Reader API for C++
Public Member Functions | Static Public Attributes | List of all members
keyple::card::calypso::AbstractSamCommand Class Reference

#include <AbstractSamCommand.h>

Inheritance diagram for keyple::card::calypso::AbstractSamCommand:
Inheritance graph
[legend]
Collaboration diagram for keyple::card::calypso::AbstractSamCommand:
Collaboration graph
[legend]

Public Member Functions

const std::map< const int, const std::shared_ptr< StatusProperties > > & getStatusTable () const override
 
 AbstractSamCommand (const CalypsoSamCommand &commandRef, const int expectedResponseLength, const std::shared_ptr< CalypsoSamAdapter > calypsoSam)
 
const std::shared_ptr< CalypsoSamAdaptergetCalypsoSam () const
 
const CalypsoSamCommandgetCommandRef () const override
 
const CalypsoApduCommandException buildCommandException (const std::type_info &exceptionClass, const std::string &message) const final
 
const CalypsoApduCommandException buildUnexpectedResponseLengthException (const std::string &message) const final
 
void parseApduResponse (const std::shared_ptr< ApduResponseApi > apduResponse) override
 
void parseApduResponse (const std::shared_ptr< ApduResponseApi > apduResponse, const std::shared_ptr< CalypsoSamAdapter > calypsoSam)
 
- Public Member Functions inherited from keyple::card::calypso::AbstractApduCommand
 AbstractApduCommand (const CardCommand &commandRef, const int expectedResponseLength)
 
virtual void addSubName (const std::string &subName) final
 
virtual const std::string & getName () const final
 
virtual void setExpectedResponseLength (const int expectedResponseLength) final
 
virtual void setApduRequest (const std::shared_ptr< ApduRequestAdapter > apduRequest) final
 
virtual const std::shared_ptr< ApduRequestAdaptergetApduRequest () const final
 
virtual const std::shared_ptr< ApduResponseApi > getApduResponse () const final
 
virtual bool isSuccessful () const final
 
virtual const std::string getStatusInformation () const final
 

Static Public Attributes

static const std::map< const int, const std::shared_ptr< StatusProperties > > STATUS_TABLE = initStatusTable()
 
- Static Public Attributes inherited from keyple::card::calypso::AbstractApduCommand
static const std::map< const int, const std::shared_ptr< StatusProperties > > STATUS_TABLE
 

Detailed Description

(package-private)
Superclass for all SAM command.

Since
2.0.1

Definition at line 35 of file AbstractSamCommand.h.

Constructor & Destructor Documentation

◆ AbstractSamCommand()

keyple::card::calypso::AbstractSamCommand::AbstractSamCommand ( const CalypsoSamCommand commandRef,
const int  expectedResponseLength,
const std::shared_ptr< CalypsoSamAdapter calypsoSam 
)

(package-private)
Constructor dedicated for the building of referenced Calypso commands

Parameters
commandRefA command reference from the Calypso command table.
expectedResponseLengthThe expected response length or -1 if not specified.
calypsoSamThe Calypso SAM (it may be null if the SAM selection has not yet been made).
Since
2.0.1

Definition at line 34 of file AbstractSamCommand.cpp.

Member Function Documentation

◆ buildCommandException()

const CalypsoApduCommandException keyple::card::calypso::AbstractSamCommand::buildCommandException ( const std::type_info &  exceptionClass,
const std::string &  message 
) const
finalvirtual

(package-private)
Builds a specific APDU command exception.

Parameters
messageThe message.
Returns
A not null reference.
A not null value
Since
2.0.1

Since
2.0.1

Implements keyple::card::calypso::AbstractApduCommand.

Definition at line 49 of file AbstractSamCommand.cpp.

◆ buildUnexpectedResponseLengthException()

const CalypsoApduCommandException keyple::card::calypso::AbstractSamCommand::buildUnexpectedResponseLengthException ( const std::string &  message) const
finalvirtual

(package-private)
Builds a specific APDU command exception for the case of an unexpected response length.

Parameters
messageThe message.
Returns
A not null reference.
Since
2.1.1

Since
2.1.1

Implements keyple::card::calypso::AbstractApduCommand.

Definition at line 74 of file AbstractSamCommand.cpp.

◆ getCalypsoSam()

const std::shared_ptr< CalypsoSamAdapter > keyple::card::calypso::AbstractSamCommand::getCalypsoSam ( ) const

(package-private)
Returns the Calypso SAM.

Returns
Null if the SAM selection has not yet been made.
Since
2.2.3

Definition at line 39 of file AbstractSamCommand.cpp.

◆ getCommandRef()

const CalypsoSamCommand & keyple::card::calypso::AbstractSamCommand::getCommandRef ( ) const
overridevirtual

(package-private)
Gets CardCommand the current command identification

Returns
A not null reference.
Since
2.0.1

Since
2.0.1

Reimplemented from keyple::card::calypso::AbstractApduCommand.

Definition at line 44 of file AbstractSamCommand.cpp.

◆ getStatusTable()

const std::map< const int, const std::shared_ptr< StatusProperties > > & keyple::card::calypso::AbstractSamCommand::getStatusTable ( ) const
overridevirtual

◆ parseApduResponse() [1/2]

void keyple::card::calypso::AbstractSamCommand::parseApduResponse ( const std::shared_ptr< ApduResponseApi >  apduResponse)
overridevirtual

(package-private)
Parses the response ApduResponseApi and check the status word.

Parameters
apduResponseThe APDU response.
Exceptions
CalypsoApduCommandExceptionif status is not successful or if the length of the response is not equal to the LE field in the request.
Since
2.0.1

Since
2.0.1

Reimplemented from keyple::card::calypso::AbstractApduCommand.

Reimplemented in keyple::card::calypso::CmdSamDataCipher, keyple::card::calypso::CmdSamPsoComputeSignature, keyple::card::calypso::CmdSamPsoVerifySignature, keyple::card::calypso::CmdSamReadCeilings, and keyple::card::calypso::CmdSamReadEventCounter.

Definition at line 83 of file AbstractSamCommand.cpp.

◆ parseApduResponse() [2/2]

void keyple::card::calypso::AbstractSamCommand::parseApduResponse ( const std::shared_ptr< ApduResponseApi >  apduResponse,
const std::shared_ptr< CalypsoSamAdapter calypsoSam 
)

(package-private)
Sets the Calypso SAM and invoke the parseApduResponse(ApduResponseApi) method.

Since
2.2.3

Definition at line 117 of file AbstractSamCommand.cpp.

Member Data Documentation

◆ STATUS_TABLE

const std::map< const int, const std::shared_ptr< StatusProperties > > keyple::card::calypso::AbstractSamCommand::STATUS_TABLE = initStatusTable()
static

(package-private)
Default SAM product type.

Since
2.0.1

Definition at line 43 of file AbstractSamCommand.h.


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