Keyple C++  0.9.0
Keyple, an Open Source SDK for Ticketing
Static Public Member Functions | Static Public Attributes | List of all members
keyple::calypso::transaction::CalypsoPoUtils Class Referencefinal

#include <CalypsoPoUtils.h>

Static Public Member Functions

static std::shared_ptr< AbstractPoResponseParserupdateCalypsoPo (std::shared_ptr< CalypsoPo > calypsoPo, std::shared_ptr< AbstractPoCommandBuilder< AbstractPoResponseParser >> commandBuilder, const std::shared_ptr< ApduResponse > apduResponse)
 
static void updateCalypsoPo (std::shared_ptr< CalypsoPo > calypsoPo, const std::vector< std::shared_ptr< AbstractPoCommandBuilder< AbstractPoResponseParser >>> &commandBuilders, const std::vector< std::shared_ptr< ApduResponse >> &apduResponses)
 
static std::unique_ptr< ReadRecordsCmdBuildprepareReadRecordFile (const PoClass &poClass, const uint8_t sfi, const uint8_t recordNumber)
 
static std::unique_ptr< SelectFileCmdBuildprepareSelectFile (const PoClass &poClass, const std::vector< uint8_t > &lid)
 
static std::unique_ptr< SelectFileCmdBuildprepareSelectFile (const PoClass &poClass, const SelectFileControl selectControl)
 
static const std::vector< uint8_t > & getPoChallenge ()
 
static uint8_t getSvKvc ()
 
static const std::vector< uint8_t > & getSvGetHeader ()
 
static const std::vector< uint8_t > getSvGetData ()
 
static const std::vector< uint8_t > getSvOperationSignature ()
 

Static Public Attributes

static const int MASK_3_BITS = 0x7
 
static const int MASK_4_BITS = 0xF
 
static const int MASK_5_BITS = 0x1F
 
static const int MASK_7_BITS = 0x7F
 
static const int MASK_1_BYTE = 0xFF
 
static const int MASK_2_BYTES = 0xFFFF
 
static const int MASK_3_BYTES = 0xFFFFFF
 
static const int SFI_MIN = 0
 
static const int SFI_MAX = MASK_5_BITS
 
static const int NB_REC_MIN = 1
 
static const int NB_REC_MAX = 255
 
static const int NB_CNT_MIN = 1
 
static const int NB_CNT_MAX = 255
 
static const int CNT_VALUE_MIN = 0
 
static const int CNT_VALUE_MAX = 16777215
 
static const int LE_MAX = 255
 
static const int FILE_TYPE_MF = 1
 
static const int FILE_TYPE_DF = 2
 
static const int FILE_TYPE_EF = 4
 
static const int EF_TYPE_DF = 0
 
static const int EF_TYPE_BINARY = 1
 
static const int EF_TYPE_LINEAR = 2
 
static const int EF_TYPE_CYCLIC = 4
 
static const int EF_TYPE_SIMULATED_COUNTERS = 8
 
static const int EF_TYPE_COUNTERS = 9
 
static const int SEL_SFI_OFFSET = 0
 
static const int SEL_TYPE_OFFSET = 1
 
static const int SEL_EF_TYPE_OFFSET = 2
 
static const int SEL_REC_SIZE_OFFSET = 3
 
static const int SEL_NUM_REC_OFFSET = 4
 
static const int SEL_AC_OFFSET = 5
 
static const int SEL_AC_LENGTH = 4
 
static const int SEL_NKEY_OFFSET = 9
 
static const int SEL_NKEY_LENGTH = 4
 
static const int SEL_DF_STATUS_OFFSET = 13
 
static const int SEL_KVCS_OFFSET = 14
 
static const int SEL_KIFS_OFFSET = 17
 
static const int SEL_DATA_REF_OFFSET = 14
 
static const int SEL_LID_OFFSET = 21
 
static const int PIN_LENGTH = 4
 
static const uint8_t STORED_VALUE_FILE_STRUCTURE_ID = 0x20
 
static const uint8_t SV_RELOAD_LOG_FILE_SFI = 0x14
 
static const uint8_t SV_RELOAD_LOG_FILE_NB_REC = 1
 
static const uint8_t SV_DEBIT_LOG_FILE_SFI = 0x15
 
static const uint8_t SV_DEBIT_LOG_FILE_NB_REC = 3
 
static const uint8_t SV_LOG_FILE_REC_LENGTH = 29
 

Detailed Description

Utility class used to check Calypso specific data.

Member Function Documentation

◆ getPoChallenge()

const std::vector< uint8_t > & keyple::calypso::transaction::CalypsoPoUtils::getPoChallenge ( )
static

(package-private)
Gets the challenge received from the PO

Returns
an array of bytes containing the challenge bytes (variable length according to the revision of the PO). May be null if the challenge is not available.

◆ getSvGetData()

const std::vector< uint8_t > keyple::calypso::transaction::CalypsoPoUtils::getSvGetData ( )
static

(package-private)
Gets the SV Get command response data

Returns
a byte array containing the SV Get command response data.

◆ getSvGetHeader()

const std::vector< uint8_t > & keyple::calypso::transaction::CalypsoPoUtils::getSvGetHeader ( )
static

(package-private)
Gets the SV Get command header

Returns
a byte array containing the SV Get command header.

◆ getSvKvc()

uint8_t keyple::calypso::transaction::CalypsoPoUtils::getSvKvc ( )
static

(package-private)
Gets the SV KVC from the PO

Returns
the SV KVC byte.

◆ getSvOperationSignature()

const std::vector< uint8_t > keyple::calypso::transaction::CalypsoPoUtils::getSvOperationSignature ( )
static

(package-private)
Gets the last SV Operation signature (SV Reload, Debit or Undebit)

Returns
a byte array containing the SV Operation signature or null if not available.

◆ prepareReadRecordFile()

std::unique_ptr< ReadRecordsCmdBuild > keyple::calypso::transaction::CalypsoPoUtils::prepareReadRecordFile ( const PoClass poClass,
const uint8_t  sfi,
const uint8_t  recordNumber 
)
static

Create a Read Records command builder for the provided arguments

Parameters
poClassthe class of the PO
sfithe SFI of the EF to read
recordNumberthe record number to read
Returns
a keyple::calypso::command::po::builder::ReadRecordsCmdBuild object

◆ prepareSelectFile() [1/2]

std::unique_ptr< SelectFileCmdBuild > keyple::calypso::transaction::CalypsoPoUtils::prepareSelectFile ( const PoClass poClass,
const SelectFileControl  selectControl 
)
static

Create a Select File command builder for the provided select control

Parameters
poClassthe class of the PO
selectControlprovides the navigation case: FIRST, NEXT or CURRENT
Returns
a keyple::calypso::command::po::builder::SelectFileCmdBuild object

◆ prepareSelectFile() [2/2]

std::unique_ptr< SelectFileCmdBuild > keyple::calypso::transaction::CalypsoPoUtils::prepareSelectFile ( const PoClass poClass,
const std::vector< uint8_t > &  lid 
)
static

Create a Select File command builder for the provided LID

Parameters
poClassthe class of the PO
lidthe LID of the EF to select
Returns
a keyple::calypso::command::po::builder::SelectFileCmdBuild object

◆ updateCalypsoPo() [1/2]

void keyple::calypso::transaction::CalypsoPoUtils::updateCalypsoPo ( std::shared_ptr< CalypsoPo calypsoPo,
const std::vector< std::shared_ptr< AbstractPoCommandBuilder< AbstractPoResponseParser >>> &  commandBuilders,
const std::vector< std::shared_ptr< ApduResponse >> &  apduResponses 
)
static

(package-private)
Fills the CalypsoPo with the PO's responses to a list of commands

Parameters
calypsoPothe keyple::calypso::transaction::CalypsoPo object to fill with the provided response from the PO
commandBuildersthe list of builders that get the responses
apduResponsesthe APDU responses returned by the PO to all commands
Exceptions
CalypsoPoCommandExceptionif a response from the PO was unexpected

◆ updateCalypsoPo() [2/2]

std::shared_ptr< AbstractPoResponseParser > keyple::calypso::transaction::CalypsoPoUtils::updateCalypsoPo ( std::shared_ptr< CalypsoPo calypsoPo,
std::shared_ptr< AbstractPoCommandBuilder< AbstractPoResponseParser >>  commandBuilder,
const std::shared_ptr< ApduResponse apduResponse 
)
static

(package-private)
Fills the CalypsoPo with the PO's response to a single command

Parameters
calypsoPothe keyple::calypso::transaction::CalypsoPo object to fill with the provided response from the PO
commandBuilderthe builder of the command that get the response
apduResponsethe APDU response returned by the PO to the command
Exceptions
CalypsoPoCommandExceptionif a response from the PO was unexpected

Member Data Documentation

◆ CNT_VALUE_MAX

const int keyple::calypso::transaction::CalypsoPoUtils::CNT_VALUE_MAX = 16777215
static

◆ CNT_VALUE_MIN

const int keyple::calypso::transaction::CalypsoPoUtils::CNT_VALUE_MIN = 0
static

Counter value

◆ EF_TYPE_BINARY

const int keyple::calypso::transaction::CalypsoPoUtils::EF_TYPE_BINARY = 1
static

◆ EF_TYPE_COUNTERS

const int keyple::calypso::transaction::CalypsoPoUtils::EF_TYPE_COUNTERS = 9
static

◆ EF_TYPE_CYCLIC

const int keyple::calypso::transaction::CalypsoPoUtils::EF_TYPE_CYCLIC = 4
static

◆ EF_TYPE_DF

const int keyple::calypso::transaction::CalypsoPoUtils::EF_TYPE_DF = 0
static

EF Type Values

◆ EF_TYPE_LINEAR

const int keyple::calypso::transaction::CalypsoPoUtils::EF_TYPE_LINEAR = 2
static

◆ EF_TYPE_SIMULATED_COUNTERS

const int keyple::calypso::transaction::CalypsoPoUtils::EF_TYPE_SIMULATED_COUNTERS = 8
static

◆ FILE_TYPE_DF

const int keyple::calypso::transaction::CalypsoPoUtils::FILE_TYPE_DF = 2
static

◆ FILE_TYPE_EF

const int keyple::calypso::transaction::CalypsoPoUtils::FILE_TYPE_EF = 4
static

◆ FILE_TYPE_MF

const int keyple::calypso::transaction::CalypsoPoUtils::FILE_TYPE_MF = 1
static

File Type Values

◆ LE_MAX

const int keyple::calypso::transaction::CalypsoPoUtils::LE_MAX = 255
static

Le max

◆ MASK_1_BYTE

const int keyple::calypso::transaction::CalypsoPoUtils::MASK_1_BYTE = 0xFF
static

◆ MASK_2_BYTES

const int keyple::calypso::transaction::CalypsoPoUtils::MASK_2_BYTES = 0xFFFF
static

◆ MASK_3_BITS

const int keyple::calypso::transaction::CalypsoPoUtils::MASK_3_BITS = 0x7
static

◆ MASK_3_BYTES

const int keyple::calypso::transaction::CalypsoPoUtils::MASK_3_BYTES = 0xFFFFFF
static

◆ MASK_4_BITS

const int keyple::calypso::transaction::CalypsoPoUtils::MASK_4_BITS = 0xF
static

◆ MASK_5_BITS

const int keyple::calypso::transaction::CalypsoPoUtils::MASK_5_BITS = 0x1F
static

◆ MASK_7_BITS

const int keyple::calypso::transaction::CalypsoPoUtils::MASK_7_BITS = 0x7F
static

◆ NB_CNT_MAX

const int keyple::calypso::transaction::CalypsoPoUtils::NB_CNT_MAX = 255
static

◆ NB_CNT_MIN

const int keyple::calypso::transaction::CalypsoPoUtils::NB_CNT_MIN = 1
static

Counter number

◆ NB_REC_MAX

const int keyple::calypso::transaction::CalypsoPoUtils::NB_REC_MAX = 255
static

◆ NB_REC_MIN

const int keyple::calypso::transaction::CalypsoPoUtils::NB_REC_MIN = 1
static

Record number

◆ PIN_LENGTH

const int keyple::calypso::transaction::CalypsoPoUtils::PIN_LENGTH = 4
static

◆ SEL_AC_LENGTH

const int keyple::calypso::transaction::CalypsoPoUtils::SEL_AC_LENGTH = 4
static

◆ SEL_AC_OFFSET

const int keyple::calypso::transaction::CalypsoPoUtils::SEL_AC_OFFSET = 5
static

◆ SEL_DATA_REF_OFFSET

const int keyple::calypso::transaction::CalypsoPoUtils::SEL_DATA_REF_OFFSET = 14
static

◆ SEL_DF_STATUS_OFFSET

const int keyple::calypso::transaction::CalypsoPoUtils::SEL_DF_STATUS_OFFSET = 13
static

◆ SEL_EF_TYPE_OFFSET

const int keyple::calypso::transaction::CalypsoPoUtils::SEL_EF_TYPE_OFFSET = 2
static

◆ SEL_KIFS_OFFSET

const int keyple::calypso::transaction::CalypsoPoUtils::SEL_KIFS_OFFSET = 17
static

◆ SEL_KVCS_OFFSET

const int keyple::calypso::transaction::CalypsoPoUtils::SEL_KVCS_OFFSET = 14
static

◆ SEL_LID_OFFSET

const int keyple::calypso::transaction::CalypsoPoUtils::SEL_LID_OFFSET = 21
static

◆ SEL_NKEY_LENGTH

const int keyple::calypso::transaction::CalypsoPoUtils::SEL_NKEY_LENGTH = 4
static

◆ SEL_NKEY_OFFSET

const int keyple::calypso::transaction::CalypsoPoUtils::SEL_NKEY_OFFSET = 9
static

◆ SEL_NUM_REC_OFFSET

const int keyple::calypso::transaction::CalypsoPoUtils::SEL_NUM_REC_OFFSET = 4
static

◆ SEL_REC_SIZE_OFFSET

const int keyple::calypso::transaction::CalypsoPoUtils::SEL_REC_SIZE_OFFSET = 3
static

◆ SEL_SFI_OFFSET

const int keyple::calypso::transaction::CalypsoPoUtils::SEL_SFI_OFFSET = 0
static

Field offsets in select file response (tag/length excluded)

◆ SEL_TYPE_OFFSET

const int keyple::calypso::transaction::CalypsoPoUtils::SEL_TYPE_OFFSET = 1
static

◆ SFI_MAX

const int keyple::calypso::transaction::CalypsoPoUtils::SFI_MAX = MASK_5_BITS
static

◆ SFI_MIN

const int keyple::calypso::transaction::CalypsoPoUtils::SFI_MIN = 0
static

SFI

◆ STORED_VALUE_FILE_STRUCTURE_ID

const uint8_t keyple::calypso::transaction::CalypsoPoUtils::STORED_VALUE_FILE_STRUCTURE_ID = 0x20
static

◆ SV_DEBIT_LOG_FILE_NB_REC

const uint8_t keyple::calypso::transaction::CalypsoPoUtils::SV_DEBIT_LOG_FILE_NB_REC = 3
static

◆ SV_DEBIT_LOG_FILE_SFI

const uint8_t keyple::calypso::transaction::CalypsoPoUtils::SV_DEBIT_LOG_FILE_SFI = 0x15
static

◆ SV_LOG_FILE_REC_LENGTH

const uint8_t keyple::calypso::transaction::CalypsoPoUtils::SV_LOG_FILE_REC_LENGTH = 29
static

◆ SV_RELOAD_LOG_FILE_NB_REC

const uint8_t keyple::calypso::transaction::CalypsoPoUtils::SV_RELOAD_LOG_FILE_NB_REC = 1
static

◆ SV_RELOAD_LOG_FILE_SFI

const uint8_t keyple::calypso::transaction::CalypsoPoUtils::SV_RELOAD_LOG_FILE_SFI = 0x14
static

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