![]() |
Keyple Card Calypso C++ Library 2.1.0
Reference Terminal Reader API for C++
|
#include <CmdCardSvReload.h>
Public Member Functions | |
CmdCardSvReload (const std::shared_ptr< CalypsoCard > calypsoCard, const int amount, const uint8_t kvc, const std::vector< uint8_t > &date, const std::vector< uint8_t > &time, const std::vector< uint8_t > &free) | |
void | finalizeCommand (const std::vector< uint8_t > &reloadComplementaryData) |
const std::vector< uint8_t > | getSvReloadData () const |
bool | isSessionBufferUsed () const override |
CmdCardSvReload & | setApduResponse (const std::shared_ptr< ApduResponseApi > apduResponse) override |
const std::vector< uint8_t > | getSignatureLo () 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 SV Reload command.
See specs: Calypso Stored Value balance (signed binaries' coding based on the two's complement method)
balance - 3 bytes signed binary - Integer from -8,388,608 to 8,388,607
amount for reload, 3 bytes signed binary - Integer from -8,388,608 to 8,388,607
-8,388,608 %10000000.00000000.00000000 -8,388,607 %10000000.00000000.00000001 -8,388,606 %10000000.00000000.00000010 -3 %11111111.11111111.11111101 -2 %11111111.11111111.11111110 -1 %11111111.11111111.11111111 0 %00000000.00000000.00000000 1 %00000000.00000000.00000001 2 %00000000.00000000.00000010 3 %00000000.00000000.00000011 8,388,605 %01111111.11111111.11111101 8,388,606 %01111111.11111111.11111110 8,388,607 %01111111.11111111.11111111
Definition at line 65 of file CmdCardSvReload.h.
keyple::card::calypso::CmdCardSvReload::CmdCardSvReload | ( | const std::shared_ptr< CalypsoCard > | calypsoCard, |
const int | amount, | ||
const uint8_t | kvc, | ||
const std::vector< uint8_t > & | date, | ||
const std::vector< uint8_t > & | time, | ||
const std::vector< uint8_t > & | free | ||
) |
(package-private)
Instantiates a new CmdCardSvReload.
The process is carried out in two steps: first to check and store the card and application data, then to create the final APDU with the data from the SAM (see finalizeCommand).
calypsoCard | the Calypso card. |
amount | amount to debit (signed integer from -8388608 to 8388607). |
kvc | debit key KVC (not checked by the card). |
date | debit date (not checked by the card). |
time | debit time (not checked by the card). |
free | 2 free bytes stored in the log but not processed by the card. |
IllegalArgumentException | If the command is inconsistent |
Definition at line 44 of file CmdCardSvReload.cpp.
void keyple::card::calypso::CmdCardSvReload::finalizeCommand | ( | const std::vector< uint8_t > & | reloadComplementaryData | ) |
(package-private)
Complete the construction of the APDU to be sent to the card with the elements received from the SAM:
4-byte SAM id
3-byte challenge
3-byte transaction number
5 or 10 byte signature (hi part)
reloadComplementaryData | the sam id and the data out from the SvPrepareReload SAM command. |
Definition at line 88 of file CmdCardSvReload.cpp.
const std::vector< uint8_t > keyple::card::calypso::CmdCardSvReload::getSignatureLo | ( | ) | const |
(package-private)
Gets the SV signature.
The signature can be empty here in the case of a secure session where the transmission of the signature is postponed until the end of the session.
Definition at line 152 of file CmdCardSvReload.cpp.
|
overridevirtual |
(package-private)
Returns the internal status table
Reimplemented from keyple::card::calypso::AbstractApduCommand.
Definition at line 188 of file CmdCardSvReload.cpp.
const std::vector< uint8_t > keyple::card::calypso::CmdCardSvReload::getSvReloadData | ( | ) | const |
(package-private)
Gets the SV Reload part of the data to include in the SAM SV Prepare Load command
Definition at line 117 of file CmdCardSvReload.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 135 of file CmdCardSvReload.cpp.
|
overridevirtual |
(package-private)
Sets the command ApduResponseApi.
apduResponse | The APDU response. |
The permitted lengths are 0 (in session), 3 (not 3.2) or 6 (3.2)
IllegalStateException | If the length is incorrect. |
Reimplemented from keyple::card::calypso::AbstractCardCommand.
Definition at line 140 of file CmdCardSvReload.cpp.