![]() |
Keyple Card Calypso C++ Library 2.2.5.6
Reference Terminal Reader API for C++
|
#include <CmdCardOpenSession.h>


Public Member Functions | |
| CmdCardOpenSession (const std::shared_ptr< CalypsoCardAdapter > calypsoCard, const uint8_t keyIndex, const std::vector< uint8_t > &samChallenge, const uint8_t sfi, const uint8_t recordNumber, const uint8_t recordSize, const bool isExtendedModeAllowed) | |
| void | createRev3 (const uint8_t keyIndex, const std::vector< uint8_t > &samChallenge, const uint8_t sfi, const uint8_t recordNumber) |
| 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 |
| void | parseApduResponse (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 |
| bool | isManageSecureSessionAuthorized () const |
| const std::shared_ptr< uint8_t > | getSelectedKif () const |
| const std::shared_ptr< uint8_t > | getSelectedKvc () 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 CalypsoCardCommand & | getCommandRef () 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< CalypsoCardAdapter > | getCalypsoCard () 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< 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 Public Attributes inherited from keyple::card::calypso::AbstractApduCommand | |
| 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 47 of file CmdCardOpenSession.h.
| keyple::card::calypso::CmdCardOpenSession::CmdCardOpenSession | ( | const std::shared_ptr< CalypsoCardAdapter > | calypsoCard, |
| const uint8_t | keyIndex, | ||
| const std::vector< uint8_t > & | samChallenge, | ||
| const uint8_t | sfi, | ||
| const uint8_t | recordNumber, | ||
| const uint8_t | recordSize, | ||
| const bool | isExtendedModeAllowed | ||
| ) |
(package-private)
Instantiates a new CmdCardOpenSession.
| calypsoCard | The Calypso card. |
| keyIndex | The key index. |
| samChallenge | The SAM challenge. |
| sfi | The optional SFI of the file to read. |
| recordNumber | The optional record number to read. |
| isExtendedModeAllowed | True if the extended mode is allowed. |
| IllegalArgumentException | If the key index is 0 and rev is 2.4 |
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 219 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 202 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 185 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 | ||
| ) |
(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. |
| IllegalArgumentException | If the request is inconsistent |
Definition at line 140 of file CmdCardOpenSession.cpp.
| const std::vector< uint8_t > & keyple::card::calypso::CmdCardOpenSession::getCardChallenge | ( | ) | const |
(package-private)
Definition at line 429 of file CmdCardOpenSession.cpp.
| uint8_t keyple::card::calypso::CmdCardOpenSession::getRecordNumber | ( | ) | const |
(package-private)
Definition at line 258 of file CmdCardOpenSession.cpp.
| const std::shared_ptr< uint8_t > keyple::card::calypso::CmdCardOpenSession::getSelectedKif | ( | ) | const |
(package-private)
Definition at line 439 of file CmdCardOpenSession.cpp.
| const std::shared_ptr< uint8_t > keyple::card::calypso::CmdCardOpenSession::getSelectedKvc | ( | ) | const |
(package-private)
Definition at line 444 of file CmdCardOpenSession.cpp.
| uint8_t keyple::card::calypso::CmdCardOpenSession::getSfi | ( | ) | const |
(package-private)
Definition at line 253 of file CmdCardOpenSession.cpp.
|
overridevirtual |
(package-private)
Returns the internal status table
Reimplemented from keyple::card::calypso::AbstractApduCommand.
Definition at line 499 of file CmdCardOpenSession.cpp.
| bool keyple::card::calypso::CmdCardOpenSession::isManageSecureSessionAuthorized | ( | ) | const |
(package-private)
Definition at line 434 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 248 of file CmdCardOpenSession.cpp.
|
overridevirtual |
(package-private)
Parses the response ApduResponseApi and check the status word.
| apduResponse | The APDU response. |
| CalypsoApduCommandException | if status is not successful or if the length of the response is not equal to the LE field in the request. |
Reimplemented from keyple::card::calypso::AbstractCardCommand.
Definition at line 263 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 383 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 336 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 296 of file CmdCardOpenSession.cpp.