Keyple Card Calypso C++ Library 2.2.2
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 le)
 
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
 
AbstractSamCommandsetApduResponse (const std::shared_ptr< ApduResponseApi > apduResponse) override
 
void checkStatus () override
 
- Public Member Functions inherited from keyple::card::calypso::AbstractApduCommand
 AbstractApduCommand (const CardCommand &commandRef, const int le)
 
virtual void addSubName (const std::string &subName) final
 
virtual const std::string & getName () const 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 34 of file AbstractSamCommand.h.

Constructor & Destructor Documentation

◆ AbstractSamCommand()

keyple::card::calypso::AbstractSamCommand::AbstractSamCommand ( const CalypsoSamCommand commandRef,
const int  le 
)

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

Parameters
commandRefa command reference from the Calypso command table.
leThe value of the LE field.
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 42 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 67 of file AbstractSamCommand.cpp.

◆ checkStatus()

void keyple::card::calypso::AbstractSamCommand::checkStatus ( )
overridevirtual

(package-private)
This method check the status word and if the length of the response is equal to the LE field in the request.
If status word is not referenced, then status is considered unsuccessful.

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.

Definition at line 82 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 37 of file AbstractSamCommand.cpp.

◆ getStatusTable()

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

◆ setApduResponse()

AbstractSamCommand & keyple::card::calypso::AbstractSamCommand::setApduResponse ( const std::shared_ptr< ApduResponseApi >  apduResponse)
overridevirtual

(package-private)
Sets the command ApduResponseApi.

Parameters
apduResponseThe APDU response.
Returns
The current instance.
Since
2.0.1

Since
2.0.1

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

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

Definition at line 76 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 42 of file AbstractSamCommand.h.


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