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

#include <CmdCardCloseSession.h>

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

Public Member Functions

 CmdCardCloseSession (const std::shared_ptr< CalypsoCardAdapter > calypsoCard, const bool ratificationAsked, const std::vector< uint8_t > terminalSessionSignature)
 
 CmdCardCloseSession (const std::shared_ptr< CalypsoCardAdapter > calypsoCard)
 
bool isSessionBufferUsed () const override
 
void parseApduResponse (const std::shared_ptr< ApduResponseApi > apduResponse) override
 
const std::vector< uint8_t > & getSignatureLo () const
 
const std::vector< std::vector< uint8_t > > & getPostponedData () const
 
const std::map< const int, const std::shared_ptr< StatusProperties > > & getStatusTable () const override
 
- Public Member Functions inherited from keyple::card::calypso::AbstractCardCommand
 AbstractCardCommand (const CalypsoCardCommand &commandRef, const int expectedResponseLength, const std::shared_ptr< CalypsoCardAdapter > calypsoCard)
 
const CalypsoCardCommandgetCommandRef () 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
 
std::shared_ptr< CalypsoCardAdaptergetCalypsoCard () const
 
void parseApduResponse (const std::shared_ptr< ApduResponseApi > apduResponse, const std::shared_ptr< CalypsoCardAdapter > calypsoCard)
 
- 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
 

Additional Inherited Members

- 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)
Builds the Close Secure Session APDU command.

Since
2.0.1

Definition at line 47 of file CmdCardCloseSession.h.

Constructor & Destructor Documentation

◆ CmdCardCloseSession() [1/2]

keyple::card::calypso::CmdCardCloseSession::CmdCardCloseSession ( const std::shared_ptr< CalypsoCardAdapter calypsoCard,
const bool  ratificationAsked,
const std::vector< uint8_t >  terminalSessionSignature 
)

(package-private)
Instantiates a new CmdCardCloseSession depending on the product type of the card.

Parameters
calypsoCardThe CalypsoCard.
ratificationAskedthe ratification asked.
terminalSessionSignaturethe sam half session signature.
Exceptions
IllegalArgumentExceptionIf the signature is null or has a wrong length
IllegalArgumentExceptionIf the command is inconsistent
Since
2.0.1

Definition at line 40 of file CmdCardCloseSession.cpp.

◆ CmdCardCloseSession() [2/2]

keyple::card::calypso::CmdCardCloseSession::CmdCardCloseSession ( const std::shared_ptr< CalypsoCardAdapter calypsoCard)

(package-private)
Instantiates a new CmdCardCloseSession based on the product type of the card to generate an abort session command (Close Secure Session with p1 = p2 = lc = 0).

Parameters
calypsoCardThe CalypsoCard.
Since
2.0.1

Definition at line 70 of file CmdCardCloseSession.cpp.

Member Function Documentation

◆ getPostponedData()

const std::vector< std::vector< uint8_t > > & keyple::card::calypso::CmdCardCloseSession::getPostponedData ( ) const

(package-private)
Returns the secure session postponed data (e.g. Sv Signature).

Returns
An empty list if there is no postponed data.
Since
2.0.1

Definition at line 122 of file CmdCardCloseSession.cpp.

◆ getSignatureLo()

const std::vector< uint8_t > & keyple::card::calypso::CmdCardCloseSession::getSignatureLo ( ) const

(package-private)
Gets the low part of the session signature.

Returns
A 4 or 8-byte array of bytes according to the extended mode availability.
Since
2.0.1

Definition at line 117 of file CmdCardCloseSession.cpp.

◆ getStatusTable()

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

(package-private)
Returns the internal status table

Returns
A not null reference
Since
2.0.1

Since
2.0.1

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

Definition at line 151 of file CmdCardCloseSession.cpp.

◆ isSessionBufferUsed()

bool keyple::card::calypso::CmdCardCloseSession::isSessionBufferUsed ( ) const
overridevirtual

(package-private)
Indicates if the session buffer is used when executing this command.Allows the management of the overflow of this buffer.

Returns
True if this command uses the session buffer
Since
2.0.1

Returns
False
Since
2.0.1

Implements keyple::card::calypso::AbstractCardCommand.

Definition at line 84 of file CmdCardCloseSession.cpp.

◆ parseApduResponse()

void keyple::card::calypso::CmdCardCloseSession::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

Checks the card response length; the admissible lengths are 0, 4 or 8 bytes.

Since
2.0.1

Reimplemented from keyple::card::calypso::AbstractCardCommand.

Definition at line 89 of file CmdCardCloseSession.cpp.


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