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

#include <CmdCardSvUndebit.h>

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

Public Member Functions

 CmdCardSvUndebit (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)
 
void finalizeCommand (const std::vector< uint8_t > &undebitComplementaryData)
 
const std::vector< uint8_t > getSvUndebitData () const
 
bool isSessionBufferUsed () const override
 
CmdCardSvUndebitsetApduResponse (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 Undebit 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

-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

amount - 2 bytes signed binary

amount for debit - Integer 0..32767 => for negative value

-32767           %10000000.00000001
-32766           %10000000.00000010
-3           %11111111.11111101
-2           %11111111.11111110
-1           %11111111.11111111
0           %00000000.00000000

Notice: -32768 (%10000000.00000000) is not allowed.
Since
2.0.1

Definition at line 78 of file CmdCardSvUndebit.h.

Constructor & Destructor Documentation

◆ CmdCardSvUndebit()

keyple::card::calypso::CmdCardSvUndebit::CmdCardSvUndebit ( 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 
)

(package-private)
Instantiates a new CmdCardSvUndebit.

Parameters
calypsoCardthe Calypso card.
amountamount to undebit (positive integer from 0 to 32767).
kvcthe KVC.
datedebit date (not checked by the card).
timedebit time (not checked by the card).
Exceptions
IllegalArgumentExceptionIf the command is inconsistent
Since
2.0.1

Definition at line 44 of file CmdCardSvUndebit.cpp.

Member Function Documentation

◆ finalizeCommand()

void keyple::card::calypso::CmdCardSvUndebit::finalizeCommand ( const std::vector< uint8_t > &  undebitComplementaryData)

(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
undebitComplementaryDatathe data out from the SvPrepareDebit SAM command.
Since
2.0.1

Definition at line 89 of file CmdCardSvUndebit.cpp.

◆ getSignatureLo()

const std::vector< uint8_t > keyple::card::calypso::CmdCardSvUndebit::getSignatureLo ( ) const

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 158 of file CmdCardSvUndebit.cpp.

◆ getStatusTable()

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

◆ getSvUndebitData()

const std::vector< uint8_t > keyple::card::calypso::CmdCardSvUndebit::getSvUndebitData ( ) const

(package-private)
Gets the SV Debit part of the data to include in the SAM SV Prepare Debit command

Returns
A byte array containing the SV undebit data
Since
2.0.1

Definition at line 122 of file CmdCardSvUndebit.cpp.

◆ isSessionBufferUsed()

bool keyple::card::calypso::CmdCardSvUndebit::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 140 of file CmdCardSvUndebit.cpp.

◆ setApduResponse()

CmdCardSvUndebit & keyple::card::calypso::CmdCardSvUndebit::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 145 of file CmdCardSvUndebit.cpp.


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