Keypop Calypso Card C++ API 2.0.0
Reference Calypso Card API for C++
Public Member Functions | List of all members
keypop::calypso::card::transaction::SecureSymmetricCryptoTransactionManager< T > Class Template Referenceabstract

#include <SecureSymmetricCryptoTransactionManager.hpp>

Inheritance diagram for keypop::calypso::card::transaction::SecureSymmetricCryptoTransactionManager< T >:
Inheritance graph
[legend]
Collaboration diagram for keypop::calypso::card::transaction::SecureSymmetricCryptoTransactionManager< T >:
Collaboration graph
[legend]

Public Member Functions

virtual T & prepareOpenSecureSession (const WriteAccessLevel writeAccessLevel)=0
 
virtual T & prepareSvGet (const SvOperation svOperation, const SvAction svAction)=0
 
virtual T & prepareSvReload (const int amount, const std::vector< uint8_t > &date, const std::vector< uint8_t > &time, const std::vector< uint8_t > &free)=0
 
virtual T & prepareSvReload (const int amount)=0
 
virtual T & prepareSvDebit (const int amount, const std::vector< uint8_t > &date, const std::vector< uint8_t > &time)=0
 
virtual T & prepareSvDebit (const int amount)=0
 
virtual T & prepareInvalidate ()=0
 
virtual T & prepareRehabilitate ()=0
 
virtual T & prepareChangeKey (const int keyIndex, const uint8_t newKif, const uint8_t newKvc, const uint8_t issuerKif, const uint8_t issuerKvc)=0
 
- Public Member Functions inherited from keypop::calypso::card::transaction::SecureTransactionManager< T >
virtual std::shared_ptr< CardTransactionCryptoExtension > getCryptoExtension (const std::type_info &cryptoExtensionClass)=0
 
virtual SecureTransactionManagerprepareCloseSecureSession ()=0
 
virtual SecureTransactionManagerprepareCancelSecureSession ()=0
 

Detailed Description

template<typename T>
class keypop::calypso::card::transaction::SecureSymmetricCryptoTransactionManager< T >

Contains operations common to all card transactions secured by "symmetric" key cryptographic algorithms.

See SecureTransactionManager parent interface for more information and details of available card operations.

Parameters
<T>The type of the lowest level child object.
Since
2.0.0

Definition at line 34 of file SecureSymmetricCryptoTransactionManager.hpp.

Member Function Documentation

◆ prepareChangeKey()

template<typename T >
virtual T & keypop::calypso::card::transaction::SecureSymmetricCryptoTransactionManager< T >::prepareChangeKey ( const int  keyIndex,
const uint8_t  newKif,
const uint8_t  newKvc,
const uint8_t  issuerKif,
const uint8_t  issuerKvc 
)
pure virtual

Schedules the execution of "Change Key" command to replace one of the current card keys with another key present in the cryptographic module.

This command can be performed only out of a secure session.

The change key process transfers the key from the cryptographic module to the card. The new key is diversified by the cryptographic module from a primary key and encrypted using the indicated issuer key to secure the transfer to the card. All provided KIFs and KVCs must be present in the cryptographic module.

Parameters
keyIndexThe index of the key to be replaced (1 for the issuer key, 2 for the load key, 3 for the debit key).
newKifThe KIF of the new key.
newKvcThe KVC of the new key.
issuerKifThe KIF of the current card's issuer key.
issuerKvcThe KVC of the current card's issuer key.
Returns
The current instance.
Exceptions
UnsupportedOperationExceptionIf the Change Key command is not available for this card.
IllegalArgumentExceptionIf the provided key index is out of range.
IllegalStateExceptionIf the command is executed while a secure session is open.
Since
1.6.0

◆ prepareInvalidate()

template<typename T >
virtual T & keypop::calypso::card::transaction::SecureSymmetricCryptoTransactionManager< T >::prepareInvalidate ( )
pure virtual

Schedules the execution of an "Invalidate" command.

This command is usually executed within a secure session with the DEBIT key (depends on the access rights given to this command in the file structure of the card).

The DF status will be available in CalypsoCard using the CalypsoCard#isDfInvalidated() method.

Exceptions
IllegalStateExceptionIf the card is already invalidated.
SessionBufferOverflowExceptionIf the command will overflow the modifications buffer size and the multiple session is not allowed.
Returns
The current instance.
Since
1.0.0

◆ prepareOpenSecureSession()

template<typename T >
virtual T & keypop::calypso::card::transaction::SecureSymmetricCryptoTransactionManager< T >::prepareOpenSecureSession ( const WriteAccessLevel  writeAccessLevel)
pure virtual

Schedules the execution of an "Open Secure Session" command.

The secure session will be opened with the provided WriteAccessLevel depending on whether it is a personalization, reload or debit transaction profile.

Note that if the next prepared command is a "Read One Record" or "Read One Or More Counters", then it will by default be merged with the "Open Secure Session" command for optimization purposes except if the "pre-open" mode is active.

This mechanism may in some cases be incompatible with the security constraints and can be disabled via the SymmetricCryptoSecuritySetting#disableReadOnSessionOpening() method.

Parameters
writeAccessLevelThe write access level to be used.
Returns
The current instance.
Exceptions
IllegalArgumentExceptionIf the provided argument is null.
IllegalStateExceptionIn the following cases:
See also
CalypsoCardSelectionExtension::preparePreOpenSecureSession(WriteAccessLevel)
Since
1.6.0

◆ prepareRehabilitate()

template<typename T >
virtual T & keypop::calypso::card::transaction::SecureSymmetricCryptoTransactionManager< T >::prepareRehabilitate ( )
pure virtual

Schedules the execution of a "Rehabilitate" command.

This command is usually executed within a secure session with the PERSONALIZATION key (depends on the access rights given to this command in the file structure of the card).

The DF status will be available in CalypsoCard using the CalypsoCard#isDfInvalidated() method.

Returns
The current instance.
Exceptions
IllegalStateExceptionIf the card is not invalidated.
SessionBufferOverflowExceptionIf the command will overflow the modifications buffer size and the multiple session is not allowed.
Since
1.0.0

◆ prepareSvDebit() [1/2]

template<typename T >
virtual T & keypop::calypso::card::transaction::SecureSymmetricCryptoTransactionManager< T >::prepareSvDebit ( const int  amount)
pure virtual

Schedules the execution of a "SV Debit" or "SV Undebit" command to increase the current SV balance or to partially or totally cancels the last SV debit command.

It consists in decreasing the current balance of the SV by a certain amount or canceling a previous debit.

Data will be available in CalypsoCard using the dedicated SV data management methods.

Note 1: the optional SV additional data are set to zero.

Note 2: the key used is the debit key.

Parameters
amountThe amount to be subtracted or added, positive integer in the range 0..32767 when subtracted and 0..32768 when added.
Returns
The current instance.
Exceptions
IllegalArgumentExceptionIf one of the provided argument is out of range.
IllegalStateExceptionIn one of the following cases:
  • New value is negative and negative balances are not allowed.
  • Another SV command was already prepared inside the same secure session.
  • The SV command is not placed in the first position in the list of prepared commands.
  • The SV command does not follow a "SV Get" command.
  • The command and the SV operation are not consistent.
SessionBufferOverflowExceptionIf the command will overflow the modifications buffer size and the multiple session is not allowed.
Since
1.0.0

◆ prepareSvDebit() [2/2]

template<typename T >
virtual T & keypop::calypso::card::transaction::SecureSymmetricCryptoTransactionManager< T >::prepareSvDebit ( const int  amount,
const std::vector< uint8_t > &  date,
const std::vector< uint8_t > &  time 
)
pure virtual

Schedules the execution of a "SV Debit" or "SV Undebit" command to increase the current SV balance or to partially or totally cancels the last SV debit command and using the provided additional data.

It consists in decreasing the current balance of the SV by a certain amount or canceling a previous debit according to the type operation chosen in when invoking the previous SV Get command.

Data will be available in CalypsoCard using the dedicated SV data management methods.

Note 1: the key used is the debit key

Parameters
amountThe amount to be subtracted or added, positive integer in the range 0..32767 when subtracted and 0..32768 when added.
date2-byte free value.
time2-byte free value.
Returns
The current instance.
Exceptions
IllegalArgumentExceptionIf one of the provided argument is out of range.
IllegalStateExceptionIn one of the following cases:
  • New value is negative and negative balances are not allowed.
  • Another SV command was already prepared inside the same secure session.
  • The SV command is not placed in the first position in the list of prepared commands.
  • The SV command does not follow a "SV Get" command.
  • The command and the SV operation are not consistent.
SessionBufferOverflowExceptionIf the command will overflow the modifications buffer size and the multiple session is not allowed.
Since
1.0.0

◆ prepareSvGet()

template<typename T >
virtual T & keypop::calypso::card::transaction::SecureSymmetricCryptoTransactionManager< T >::prepareSvGet ( const SvOperation  svOperation,
const SvAction  svAction 
)
pure virtual

Schedules the execution of a "SV Get" command to prepare an SV operation or simply retrieves the current SV status.

Data will be available in CalypsoCard using the dedicated SV data management methods.

Parameters
svOperationInforms about the nature of the intended operation: debit or reload.
svActionThe type of action: DO a debit or a positive reload, UNDO an undebit or a negative reload.
Returns
The current instance.
Exceptions
UnsupportedOperationExceptionIf the SV feature is not available for this card.
IllegalArgumentExceptionIf one of the arguments is null.
Since
1.0.0

◆ prepareSvReload() [1/2]

template<typename T >
virtual T & keypop::calypso::card::transaction::SecureSymmetricCryptoTransactionManager< T >::prepareSvReload ( const int  amount)
pure virtual

Schedules the execution of a "SV Reload" command to increase the current SV balance.

Data will be available in CalypsoCard using the dedicated SV data management methods.

Note 1: the optional SV additional data are set to zero.

Note 2: the key used is the reload key.

Parameters
amountThe value to be reloaded, positive integer in the range 0..8388607 for a DO. action, in the range 0..8388608 for an UNDO action.
Returns
The current instance.
Exceptions
IllegalArgumentExceptionIf the provided argument is out of range.
IllegalStateExceptionIn one of the following cases:
  • Another SV command was already prepared inside the same secure session.
  • The SV command is not placed in the first position in the list of prepared commands.
  • The SV command does not follow a "SV Get" command.
  • The command and the SV operation are not consistent.
SessionBufferOverflowExceptionIf the command will overflow the modifications buffer size and the multiple session is not allowed.
Since
1.0.0

◆ prepareSvReload() [2/2]

template<typename T >
virtual T & keypop::calypso::card::transaction::SecureSymmetricCryptoTransactionManager< T >::prepareSvReload ( const int  amount,
const std::vector< uint8_t > &  date,
const std::vector< uint8_t > &  time,
const std::vector< uint8_t > &  free 
)
pure virtual

Schedules the execution of a "SV Reload" command to increase the current SV balance and using the provided additional data.

Data will be available in CalypsoCard using the dedicated SV data management methods.

Note: the key used is the reload key.

Parameters
amountThe value to be reloaded, positive or negative integer in the range. -8388608..8388607
date2-byte free value.
time2-byte free value.
free2-byte free value.
Returns
The current instance.
Exceptions
IllegalArgumentExceptionIf one of the provided argument is out of range.
IllegalStateExceptionIn one of the following cases:
  • Another SV command was already prepared inside the same secure session.
  • The SV command is not placed in the first position in the list of prepared commands.
  • The SV command does not follow a "SV Get" command.
  • The command and the SV operation are not consistent.
SessionBufferOverflowExceptionIf the command will overflow the modifications buffer size and the multiple session is not allowed.
Since
1.0.0

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