![]() |
Keyple Card Calypso C++ Library 2.1.0
Reference Terminal Reader API for C++
|
#include <CmdCardOpenSession.h>
Public Member Functions | |
CmdCardOpenSession (const std::shared_ptr< CalypsoCard > calypsoCard, const uint8_t debitKeyIndex, const std::vector< uint8_t > sessionTerminalChallenge, const uint8_t sfi, const uint8_t recordNumber) | |
void | createRev3 (const uint8_t keyIndex, const std::vector< uint8_t > &samChallenge, const uint8_t sfi, const uint8_t recordNumber, const std::shared_ptr< CalypsoCard > calypsoCard) |
void | createRev24 (const uint8_t keyIndex, const std::vector< uint8_t > &samChallenge, const uint8_t sfi, const uint8_t recordNumber) |
void | createRev10 (const uint8_t keyIndex, const std::vector< uint8_t > &samChallenge, const uint8_t sfi, const uint8_t recordNumber) |
void | buildLegacyApduRequest (const uint8_t keyIndex, const std::vector< uint8_t > &samChallenge, const uint8_t sfi, const uint8_t recordNumber, const uint8_t p1) |
bool | isSessionBufferUsed () const override |
uint8_t | getSfi () const |
uint8_t | getRecordNumber () const |
CmdCardOpenSession & | setApduResponse (const std::shared_ptr< ApduResponseApi > apduResponse) override |
void | parseRev3 (const std::vector< uint8_t > &apduResponseData) |
void | parseRev24 (const std::vector< uint8_t > &apduResponseData) |
void | parseRev10 (const std::vector< uint8_t > &apduResponseData) |
const std::vector< uint8_t > & | getCardChallenge () const |
int | getTransactionCounterValue () const |
bool | wasRatified () const |
bool | isManageSecureSessionAuthorized () const |
const std::shared_ptr< uint8_t > | getSelectedKif () const |
const std::shared_ptr< uint8_t > | getSelectedKvc () const |
const std::vector< uint8_t > & | getRecordDataRead () const |
const std::map< const int, const std::shared_ptr< StatusProperties > > & | getStatusTable () const override |
![]() | |
AbstractCardCommand (const CalypsoCardCommand &commandRef) | |
const CalypsoCardCommand & | getCommandRef () const override |
const CalypsoApduCommandException | buildCommandException (const std::type_info &exceptionClass, const std::string &message, const CardCommand &commandRef, const int statusWord) const final |
void | checkStatus () override |
![]() | |
AbstractApduCommand (const CardCommand &commandRef) | |
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< ApduRequestAdapter > | getApduRequest () 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 const std::map< const int, const std::shared_ptr< StatusProperties > > | STATUS_TABLE |
(package-private)
Builds the Open Secure Session APDU command.
Definition at line 46 of file CmdCardOpenSession.h.
keyple::card::calypso::CmdCardOpenSession::CmdCardOpenSession | ( | const std::shared_ptr< CalypsoCard > | calypsoCard, |
const uint8_t | debitKeyIndex, | ||
const std::vector< uint8_t > | sessionTerminalChallenge, | ||
const uint8_t | sfi, | ||
const uint8_t | recordNumber | ||
) |
(package-private)
Instantiates a new CmdCardOpenSession.
calypsoCard | the CalypsoCard. |
IllegalArgumentException | If the key index is 0 and rev is 2.4 |
IllegalArgumentException | If the request is inconsistent |
Definition at line 106 of file CmdCardOpenSession.cpp.
void keyple::card::calypso::CmdCardOpenSession::buildLegacyApduRequest | ( | const uint8_t | keyIndex, |
const std::vector< uint8_t > & | samChallenge, | ||
const uint8_t | sfi, | ||
const uint8_t | recordNumber, | ||
const uint8_t | p1 | ||
) |
(private)
Build legacy apdu request.
keyIndex | the key index. |
samChallenge | the sam challenge returned by the SAM Get Challenge APDU command. |
sfi | the sfi to select. |
recordNumber | the record number to read. |
p1 | P1. |
IllegalArgumentException | If the request is inconsistent |
Definition at line 214 of file CmdCardOpenSession.cpp.
void keyple::card::calypso::CmdCardOpenSession::createRev10 | ( | const uint8_t | keyIndex, |
const std::vector< uint8_t > & | samChallenge, | ||
const uint8_t | sfi, | ||
const uint8_t | recordNumber | ||
) |
(private)
Create Rev 1.0
keyIndex | the key index. |
samChallenge | the sam challenge returned by the SAM Get Challenge APDU command. |
sfi | the sfi to select. |
recordNumber | the record number to read. |
IllegalArgumentException | If key index is 0 (rev 1.0) |
IllegalArgumentException | If the request is inconsistent |
Definition at line 197 of file CmdCardOpenSession.cpp.
void keyple::card::calypso::CmdCardOpenSession::createRev24 | ( | const uint8_t | keyIndex, |
const std::vector< uint8_t > & | samChallenge, | ||
const uint8_t | sfi, | ||
const uint8_t | recordNumber | ||
) |
(private)
Create Rev 2.4
keyIndex | the key index. |
samChallenge | the sam challenge returned by the SAM Get Challenge APDU command. |
sfi | the sfi to select. |
recordNumber | the record number to read. |
IllegalArgumentException | If key index is 0 (rev 2.4) |
IllegalArgumentException | If the request is inconsistent |
Definition at line 180 of file CmdCardOpenSession.cpp.
void keyple::card::calypso::CmdCardOpenSession::createRev3 | ( | const uint8_t | keyIndex, |
const std::vector< uint8_t > & | samChallenge, | ||
const uint8_t | sfi, | ||
const uint8_t | recordNumber, | ||
const std::shared_ptr< CalypsoCard > | calypsoCard | ||
) |
(private)
Create Rev 3
keyIndex | the key index. |
samChallenge | the sam challenge returned by the SAM Get Challenge APDU command. |
sfi | the sfi to select. |
recordNumber | the record number to read. |
calypsoCard | The CalypsoCard. |
IllegalArgumentException | If the request is inconsistent |
Definition at line 133 of file CmdCardOpenSession.cpp.
const std::vector< uint8_t > & keyple::card::calypso::CmdCardOpenSession::getCardChallenge | ( | ) | const |
(package-private)
Definition at line 398 of file CmdCardOpenSession.cpp.
const std::vector< uint8_t > & keyple::card::calypso::CmdCardOpenSession::getRecordDataRead | ( | ) | const |
(package-private)
Definition at line 428 of file CmdCardOpenSession.cpp.
uint8_t keyple::card::calypso::CmdCardOpenSession::getRecordNumber | ( | ) | const |
(package-private)
Definition at line 255 of file CmdCardOpenSession.cpp.
const std::shared_ptr< uint8_t > keyple::card::calypso::CmdCardOpenSession::getSelectedKif | ( | ) | const |
(package-private)
Definition at line 418 of file CmdCardOpenSession.cpp.
const std::shared_ptr< uint8_t > keyple::card::calypso::CmdCardOpenSession::getSelectedKvc | ( | ) | const |
(package-private)
Definition at line 423 of file CmdCardOpenSession.cpp.
uint8_t keyple::card::calypso::CmdCardOpenSession::getSfi | ( | ) | const |
(package-private)
Definition at line 250 of file CmdCardOpenSession.cpp.
|
overridevirtual |
(package-private)
Returns the internal status table
Reimplemented from keyple::card::calypso::AbstractApduCommand.
Definition at line 483 of file CmdCardOpenSession.cpp.
int keyple::card::calypso::CmdCardOpenSession::getTransactionCounterValue | ( | ) | const |
(package-private)
Definition at line 403 of file CmdCardOpenSession.cpp.
bool keyple::card::calypso::CmdCardOpenSession::isManageSecureSessionAuthorized | ( | ) | const |
(package-private)
Definition at line 413 of file CmdCardOpenSession.cpp.
|
overridevirtual |
(package-private)
Indicates if the session buffer is used when executing this command.Allows the management of the overflow of this buffer.
Implements keyple::card::calypso::AbstractCardCommand.
Definition at line 245 of file CmdCardOpenSession.cpp.
void keyple::card::calypso::CmdCardOpenSession::parseRev10 | ( | const std::vector< uint8_t > & | apduResponseData | ) |
(private)
Parse Rev 1.0
In rev 1.0 mode, the response to the Open Secure Session command is as follows:
CC CC CC CC [RR RR] [NN..NN]
Where:
CC CC CC CC
= card challenge RR RR
= ratification bytes (may be absent) NN..NN
= record data (29 bytes) Legal length values are:
apduResponseData | The response data. |
Definition at line 358 of file CmdCardOpenSession.cpp.
void keyple::card::calypso::CmdCardOpenSession::parseRev24 | ( | const std::vector< uint8_t > & | apduResponseData | ) |
(private)
Parse Rev 2.4
In rev 2.4 mode, the response to the Open Secure Session command is as follows:
KK CC CC CC CC [RR RR] [NN..NN]
Where:
KK
= KVC byte CC CC CC CC CC
= card challenge RR RR
= ratification bytes (may be absent) NN..NN
= record data (29 bytes) Legal length values are:
apduResponseData | The response data. |
Definition at line 317 of file CmdCardOpenSession.cpp.
void keyple::card::calypso::CmdCardOpenSession::parseRev3 | ( | const std::vector< uint8_t > & | apduResponseData | ) |
(private)
Parse Rev 3
apduResponseData | The response data. |
Definition at line 282 of file CmdCardOpenSession.cpp.
|
overridevirtual |
(package-private)
Sets the command ApduResponseApi.
apduResponse | The APDU response. |
Reimplemented from keyple::card::calypso::AbstractCardCommand.
Definition at line 260 of file CmdCardOpenSession.cpp.
bool keyple::card::calypso::CmdCardOpenSession::wasRatified | ( | ) | const |
(package-private)
Definition at line 408 of file CmdCardOpenSession.cpp.