Keypop Calypso Crypto Symmetric C++ API 0.1.1
Reference Calypso Crypto Symmetric API for C++
Public Member Functions | List of all members
keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi Class Referenceabstract

#include <SymmetricCryptoCardTransactionManagerSpi.hpp>

Public Member Functions

virtual std::vector< uint8_t > & initTerminalSecureSessionContext ()=0
 
virtual void initTerminalSessionMac (const std::vector< uint8_t > &openSecureSessionDataOut, const uint8_t kif, const uint8_t kvc)=0
 
virtual const std::vector< uint8_t > & updateTerminalSessionMac (const std::vector< uint8_t > &cardApdu)=0
 
virtual const std::vector< uint8_t > & finalizeTerminalSessionMac ()=0
 
virtual const std::vector< uint8_t > & generateTerminalSessionMac ()=0
 
virtual void activateEncryption ()=0
 
virtual void deactivateEncryption ()=0
 
virtual bool isCardSessionMacValid (const std::vector< uint8_t > &cardSessionMac)=0
 
virtual void computeSvCommandSecurityData (const std::shared_ptr< SvCommandSecurityDataApi > data)=0
 
virtual bool isCardSvMacValid (const std::vector< uint8_t > &cardSvMac)=0
 
virtual const std::vector< uint8_t > & cipherPinForPresentation (const std::vector< uint8_t > &cardChallenge, const std::vector< uint8_t > &pin, const std::shared_ptr< uint8_t > kif, const std::shared_ptr< uint8_t > kvc)=0
 
virtual const std::vector< uint8_t > & cipherPinForModification (const std::vector< uint8_t > &cardChallenge, const std::vector< uint8_t > &currentPin, const std::vector< uint8_t > &newPin, const std::shared_ptr< uint8_t > kif, const std::shared_ptr< uint8_t > kvc)=0
 
virtual const std::vector< uint8_t > & generateCipheredCardKey (const std::vector< uint8_t > &cardChallenge, const uint8_t issuerKeyKif, const uint8_t issuerKeyKvc, const uint8_t targetKeyKif, const uint8_t targetKeyKvc)=0
 
virtual void synchronize ()=0
 

Detailed Description

Calypso card symmetric key cryptography service.

It defines the API needed by a terminal to perform the cryptographic operations required by a Calypso card when using symmetric keys.

An instance of this interface can be obtained via the method boolean, List).

Since
0.1.0

Definition at line 37 of file SymmetricCryptoCardTransactionManagerSpi.hpp.

Member Function Documentation

◆ activateEncryption()

virtual void keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi::activateEncryption ( )
pure virtual

Activates the encryption/decryption of the data sent/received during the secure session.

Exceptions
SymmetricCryptoExceptionIf an internal error occurred.
SymmetricCryptoIOExceptionIf an IO error occurred when processing a command.
Since
0.1.0

◆ cipherPinForModification()

virtual const std::vector< uint8_t > & keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi::cipherPinForModification ( const std::vector< uint8_t > &  cardChallenge,
const std::vector< uint8_t > &  currentPin,
const std::vector< uint8_t > &  newPin,
const std::shared_ptr< uint8_t >  kif,
const std::shared_ptr< uint8_t >  kvc 
)
pure virtual

Computes a block of encrypted data to be sent to the card for a PIN modification.

Note: the

kif

and

kvc

parameters are ignored when PIN modification is performed within a Secure Session.

Parameters
cardChallengeA byte array containing the card challenge.
currentPinA byte array containing the 4-byte current PIN value.
newPinA byte array containing the 4-byte new PIN value.
kifThe PIN encryption key KIF.
kvcThe PIN encryption key KVC.
Returns
A byte array containing the encrypted data block to sent to the card.
Exceptions
SymmetricCryptoExceptionIf an internal error occurred.
SymmetricCryptoIOExceptionIf an IO error occurred when processing a command.
Since
0.1.0

◆ cipherPinForPresentation()

virtual const std::vector< uint8_t > & keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi::cipherPinForPresentation ( const std::vector< uint8_t > &  cardChallenge,
const std::vector< uint8_t > &  pin,
const std::shared_ptr< uint8_t >  kif,
const std::shared_ptr< uint8_t >  kvc 
)
pure virtual

Computes a block of encrypted data to be sent to the card for an enciphered PIN presentation.

Note: the

kif

and

kvc

parameters are ignored when PIN verification is performed within a Secure Session.

Parameters
cardChallengeA byte array containing the card challenge.
pinA byte array containing the 4-byte PIN value.
kifThe PIN encryption key KIF.
kvcThe PIN encryption key KVC.
Returns
A byte array containing the encrypted data block to sent to the card.
Exceptions
SymmetricCryptoExceptionIf an internal error occurred.
SymmetricCryptoIOExceptionIf an IO error occurred when processing a command.
Since
0.1.0

◆ computeSvCommandSecurityData()

virtual void keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi::computeSvCommandSecurityData ( const std::shared_ptr< SvCommandSecurityDataApi data)
pure virtual

Computes the needed data to operate SV card commands.

Parameters
dataThe data involved in the preparation of an SV Reload/Debit/Undebit command.
Exceptions
SymmetricCryptoExceptionIf an internal error occurred.
SymmetricCryptoIOExceptionIf an IO error occurred when processing a command.
Since
0.1.0

◆ deactivateEncryption()

virtual void keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi::deactivateEncryption ( )
pure virtual

Deactivates the encryption/decryption of the data sent/received during the secure session.

Exceptions
SymmetricCryptoExceptionIf an internal error occurred.
SymmetricCryptoIOExceptionIf an IO error occurred when processing a command.
Since
0.1.0

◆ finalizeTerminalSessionMac()

virtual const std::vector< uint8_t > & keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi::finalizeTerminalSessionMac ( )
pure virtual

Finalizes the digest computation and returns the terminal part of the session MAC.

Returns
A byte array containing the terminal session MAC.
Exceptions
SymmetricCryptoExceptionIf an internal error occurred.
SymmetricCryptoIOExceptionIf an IO error occurred when processing a command.
Since
0.1.0

◆ generateCipheredCardKey()

virtual const std::vector< uint8_t > & keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi::generateCipheredCardKey ( const std::vector< uint8_t > &  cardChallenge,
const uint8_t  issuerKeyKif,
const uint8_t  issuerKeyKvc,
const uint8_t  targetKeyKif,
const uint8_t  targetKeyKvc 
)
pure virtual

Generates an encrypted key data block for loading a key into a card.

Parameters
cardChallengeA byte array containing the card challenge.
issuerKeyKifThe issuer key KIF.
issuerKeyKvcThe issuer key KVC.
targetKeyKifThe target key KIF.
targetKeyKvcThe target key KVC.
Returns
A byte array containing the encrypted data block to sent to the card.
Exceptions
SymmetricCryptoExceptionIf an internal error occurred.
SymmetricCryptoIOExceptionIf an IO error occurred when processing a command.
Since
0.1.0

◆ generateTerminalSessionMac()

virtual const std::vector< uint8_t > & keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi::generateTerminalSessionMac ( )
pure virtual

Generates the terminal part of the session MAC used for an early mutual authentication.

Returns
A byte array containing the terminal session MAC.
Exceptions
SymmetricCryptoExceptionIf an internal error occurred.
SymmetricCryptoIOExceptionIf an IO error occurred when processing a command.
Since
0.1.0

◆ initTerminalSecureSessionContext()

virtual std::vector< uint8_t > & keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi::initTerminalSecureSessionContext ( )
pure virtual

Initializes the crypto service context for operating a Secure Session with a card and gets the terminal challenge.

Returns
The terminal challenge.
Exceptions
SymmetricCryptoExceptionIf an internal error occurred.
SymmetricCryptoIOExceptionIf an IO error occurred when processing a command.
Since
0.1.0

◆ initTerminalSessionMac()

virtual void keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi::initTerminalSessionMac ( const std::vector< uint8_t > &  openSecureSessionDataOut,
const uint8_t  kif,
const uint8_t  kvc 
)
pure virtual

Stores the data needed to initialize the session MAC computation for a Secure Session.

Parameters
openSecureSessionDataOutThe data out from the card Open Secure Session command.
kifThe card KIF.
kvcThe card KVC.
Exceptions
SymmetricCryptoExceptionIf an internal error occurred.
SymmetricCryptoIOExceptionIf an IO error occurred when processing a command.
Since
0.1.0

◆ isCardSessionMacValid()

virtual bool keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi::isCardSessionMacValid ( const std::vector< uint8_t > &  cardSessionMac)
pure virtual

Verifies the card part of the session MAC finalizing the mutual authentication process.

Parameters
cardSessionMacA byte array containing the card session MAC.
Returns
true if the card session MAC is validated.
Exceptions
SymmetricCryptoExceptionIf an internal error occurred.
SymmetricCryptoIOExceptionIf an IO error occurred when processing a command.
Since
0.1.0

◆ isCardSvMacValid()

virtual bool keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi::isCardSvMacValid ( const std::vector< uint8_t > &  cardSvMac)
pure virtual

Verifies the SV card MAC.

Parameters
cardSvMacA byte array containing the card SV MAC.
Returns
true if the card SV MAC is validated.
Exceptions
SymmetricCryptoExceptionIf an internal error occurred.
SymmetricCryptoIOExceptionIf an IO error occurred when processing a command.
Since
0.1.0

◆ synchronize()

virtual void keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi::synchronize ( )
pure virtual

Synchronizes data of the associated card transaction crypto extension if needed.

Exceptions
SymmetricCryptoExceptionIf an internal error occurred.
SymmetricCryptoIOExceptionIf an IO error occurred when processing a command.
Since
0.1.0

◆ updateTerminalSessionMac()

virtual const std::vector< uint8_t > & keypop::calypso::crypto::symmetric::spi::SymmetricCryptoCardTransactionManagerSpi::updateTerminalSessionMac ( const std::vector< uint8_t > &  cardApdu)
pure virtual

Updates the digest computation with data sent or received from the card.

Returns encrypted/decrypted data when the encryption is active.

Parameters
cardApduA byte array containing either the input or output data of a card command APDU.
Returns
null if the encryption is not activate, either the ciphered or deciphered command data if the encryption is active.
Exceptions
SymmetricCryptoExceptionIf an internal error occurred.
SymmetricCryptoIOExceptionIf an IO error occurred when processing a command.
Since
0.1.0

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