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

#include <CmdCardSvReload.h>

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

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
 
CmdCardSvReloadsetApduResponse (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
 
- Public Member Functions inherited from keyple::card::calypso::AbstractCardCommand
 AbstractCardCommand (const CalypsoCardCommand &commandRef)
 
const CalypsoCardCommandgetCommandRef () 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
 
- Public Member Functions inherited from keyple::card::calypso::AbstractApduCommand
 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< 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 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
Since
2.0.1

Definition at line 65 of file CmdCardSvReload.h.

Constructor & Destructor Documentation

◆ CmdCardSvReload()

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).

Parameters
calypsoCardthe Calypso card.
amountamount to debit (signed integer from -8388608 to 8388607).
kvcdebit key KVC (not checked by the card).
datedebit date (not checked by the card).
timedebit time (not checked by the card).
free2 free bytes stored in the log but not processed by the card.
Exceptions
IllegalArgumentExceptionIf the command is inconsistent
Since
2.0.1

Definition at line 44 of file CmdCardSvReload.cpp.

Member Function Documentation

◆ finalizeCommand()

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)

Parameters
reloadComplementaryDatathe sam id and the data out from the SvPrepareReload SAM command.
Since
2.0.1

Definition at line 88 of file CmdCardSvReload.cpp.

◆ getSignatureLo()

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.

Returns
A byte array containing the signature
Since
2.0.1

Definition at line 152 of file CmdCardSvReload.cpp.

◆ getStatusTable()

const std::map< const int, const std::shared_ptr< StatusProperties > > & keyple::card::calypso::CmdCardSvReload::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 188 of file CmdCardSvReload.cpp.

◆ getSvReloadData()

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

Returns
a byte array containing the SV reload data
Since
2.0.1

Definition at line 117 of file CmdCardSvReload.cpp.

◆ isSessionBufferUsed()

bool keyple::card::calypso::CmdCardSvReload::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
True
Since
2.0.1

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

Definition at line 135 of file CmdCardSvReload.cpp.

◆ setApduResponse()

CmdCardSvReload & keyple::card::calypso::CmdCardSvReload::setApduResponse ( const std::shared_ptr< ApduResponseApi >  apduResponse)
overridevirtual

(package-private)
Sets the command ApduResponseApi.

Parameters
apduResponseThe APDU response.
Returns
The current instance.
Since
2.0.1
Since
2.0.1

The permitted lengths are 0 (in session), 3 (not 3.2) or 6 (3.2)

Exceptions
IllegalStateExceptionIf the length is incorrect.
Since
2.0.1

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

Definition at line 140 of file CmdCardSvReload.cpp.


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