Keypop Calypso Crypto Legacy SAM C++ API 0.6.0
Reference Calypso Crypto Legacy SAM API for C++
Public Member Functions | List of all members
keypop::calypso::crypto::legacysam::sam::LegacySamSelectionExtension Class Referenceabstract

#include <LegacySamSelectionExtension.hpp>

Inheritance diagram for keypop::calypso::crypto::legacysam::sam::LegacySamSelectionExtension:
Inheritance graph
[legend]
Collaboration diagram for keypop::calypso::crypto::legacysam::sam::LegacySamSelectionExtension:
Collaboration graph
[legend]

Public Member Functions

virtual LegacySamSelectionExtensionsetUnlockData (const std::string &unlockData)=0
 
virtual LegacySamSelectionExtensionsetUnlockData (const std::string &unlockData, const LegacySam::ProductType productType)=0
 
virtual LegacySamSelectionExtensionsetStaticUnlockDataProvider (const std::shared_ptr< LegacySamStaticUnlockDataProviderSpi > staticUnlockDataProvider)=0
 
virtual LegacySamSelectionExtensionsetStaticUnlockDataProvider (const std::shared_ptr< LegacySamStaticUnlockDataProviderSpi > staticUnlockDataProvider, const std::shared_ptr< CardReader > targetSamReader)=0
 
virtual LegacySamSelectionExtensionsetDynamicUnlockDataProvider (const std::shared_ptr< LegacySamDynamicUnlockDataProviderSpi > dynamicUnlockDataProvider)=0
 
virtual LegacySamSelectionExtensionsetDynamicUnlockDataProvider (LegacySamDynamicUnlockDataProviderSpi dynamicUnlockDataProvider, CardReader targetSamReader)
 
LegacySamSelectionExtension prepareReadSystemKeyParameters (SystemKeyType systemKeyType)
 
LegacySamSelectionExtension prepareReadCounterStatus (int counterNumber)
 
LegacySamSelectionExtension prepareReadAllCountersStatus ()
 
LegacySamSelectionExtension prepareGetData (GetDataTag tag)
 

Detailed Description

Extends the CardSelectionExtension interface of the "Keypop Reader API" to provide means to define optional commands to be executed during the selection phase such as the "Unlock" command.

An instance of this interface can be obtained via the method LegacySamApiFactory::createLegacySamSelectionExtension().

In the case where the SAM is locked, three options are proposed:

All three methods are exclusive.

When the unlocking data is supplied by a provider, a CardReader is needed to perform additional exchanges after the initial selection process. The reader can be provided either at the time of the creation of the selection extension or later depending on the implementation (in the case of dynamic SAM reader allocation for example).

Since
0.3.0

Definition at line 64 of file LegacySamSelectionExtension.hpp.

Member Function Documentation

◆ prepareGetData()

LegacySamSelectionExtension keypop::calypso::crypto::legacysam::sam::LegacySamSelectionExtension::prepareGetData ( GetDataTag  tag)

Schedules the execution of a "Get Data" command for the specified tag.

Once this command is processed, data is accessible using dedicated getter methods, like LegacySam#getCaCertificate().

Parameters
tagThe tag to retrieve the data for.
Returns
The current instance.
Exceptions
IllegalArgumentExceptionIf tag is null.
Since
0.6.0

◆ prepareReadAllCountersStatus()

LegacySamSelectionExtension keypop::calypso::crypto::legacysam::sam::LegacySamSelectionExtension::prepareReadAllCountersStatus ( )

Schedules the execution of a "Read Event Counter" and "Read Ceiling" commands to read the status of all counters.

Returns
The current instance.
Since
0.3.0

◆ prepareReadCounterStatus()

LegacySamSelectionExtension keypop::calypso::crypto::legacysam::sam::LegacySamSelectionExtension::prepareReadCounterStatus ( int  counterNumber)

Schedules the execution of a "Read Event Counter" and "Read Ceiling" commands to read the status of a counter.

Note: the status of each counter of the record to which the targeted counter belongs will be read. The number of commands actually transmitted to the SAM will be optimized before to be transmitted.

Parameters
counterNumberThe number of the counter whose status is to be read (in range [0..26]).
Returns
The current instance.
Exceptions
IllegalArgumentExceptionIf the provided argument is out of range.
Since
0.3.0

◆ prepareReadSystemKeyParameters()

LegacySamSelectionExtension keypop::calypso::crypto::legacysam::sam::LegacySamSelectionExtension::prepareReadSystemKeyParameters ( SystemKeyType  systemKeyType)

Schedules the execution of a "Read Key Parameters" command for a system key.

Once this command is processed, the result is accessible with LegacySam#getSystemKeyParameter(SystemKeyType).

Parameters
systemKeyTypeThe type of system key.
Returns
The current instance.
Exceptions
IllegalArgumentExceptionIf the provided argument is null.
Since
0.3.0

◆ setDynamicUnlockDataProvider() [1/2]

virtual LegacySamSelectionExtension & keypop::calypso::crypto::legacysam::sam::LegacySamSelectionExtension::setDynamicUnlockDataProvider ( const std::shared_ptr< LegacySamDynamicUnlockDataProviderSpi dynamicUnlockDataProvider)
pure virtual

Sets the unlock data provider to use for unlocking the SAM in dynamic mode.

This method must be used when the card reader needed to communicate with the target SAM is provided at a later point within the interface's implementation process.

The "Unlock" command is initiated once the filtering is successfully completed, followed by a request to the provider to obtain the needed unlocking data.

Parameters
dynamicUnlockDataProviderAn implementation of LegacySamDynamicUnlockDataProviderSpi.
Returns
The current instance.
Exceptions
IllegalArgumentExceptionIf the provided argument is null.
IllegalStateExceptionIf an unlocking setting has already been set.
Since
0.4.0

◆ setDynamicUnlockDataProvider() [2/2]

virtual LegacySamSelectionExtension & keypop::calypso::crypto::legacysam::sam::LegacySamSelectionExtension::setDynamicUnlockDataProvider ( LegacySamDynamicUnlockDataProviderSpi  dynamicUnlockDataProvider,
CardReader  targetSamReader 
)
virtual

Sets the unlock data provider and the card reader to use for unlocking the SAM in dynamic mode.

This method must be used when the card reader is known at the time of creating the SAM selection extension.

The "Unlock" command is initiated once the filtering is successfully completed, followed by a request to the provider to obtain the needed unlocking data.

Parameters
dynamicUnlockDataProviderAn implementation of LegacySamDynamicUnlockDataProviderSpi.
targetSamReaderThe card reader used to communicate with the target SAM.
Returns
The current instance.
Exceptions
IllegalArgumentExceptionIf one of the provided arguments is null.
IllegalStateExceptionIf an unlocking setting has already been set.
Since
0.4.0

◆ setStaticUnlockDataProvider() [1/2]

virtual LegacySamSelectionExtension & keypop::calypso::crypto::legacysam::sam::LegacySamSelectionExtension::setStaticUnlockDataProvider ( const std::shared_ptr< LegacySamStaticUnlockDataProviderSpi staticUnlockDataProvider)
pure virtual

Sets the unlock data provider to use for unlocking the SAM in static mode.

This method must be used when the card reader needed to communicate with the target SAM is provided at a later point within the interface's implementation process.

The "Unlock" command is initiated once the filtering is successfully completed, followed by a request to the provider to obtain the needed unlocking data.

Parameters
staticUnlockDataProviderAn implementation of LegacySamStaticUnlockDataProviderSpi.
Returns
The current instance.
Exceptions
IllegalArgumentExceptionIf the provided argument is null.
IllegalStateExceptionIf an unlocking setting has already been set.
Since
0.4.0

◆ setStaticUnlockDataProvider() [2/2]

virtual LegacySamSelectionExtension & keypop::calypso::crypto::legacysam::sam::LegacySamSelectionExtension::setStaticUnlockDataProvider ( const std::shared_ptr< LegacySamStaticUnlockDataProviderSpi staticUnlockDataProvider,
const std::shared_ptr< CardReader >  targetSamReader 
)
pure virtual

Sets the unlock data provider and the card reader to use for unlocking the SAM in static mode.

This method must be used when the card reader is known at the time of creating the SAM selection extension.

The "Unlock" command is initiated once the filtering is successfully completed, followed by a request to the provider to obtain the needed unlocking data.

Parameters
staticUnlockDataProviderAn implementation of LegacySamStaticUnlockDataProviderSpi.
targetSamReaderThe card reader used to communicate with the target SAM.
Returns
The current instance.
Exceptions
IllegalArgumentExceptionIf one of the provided arguments is null.
IllegalStateExceptionIf an unlocking setting has already been set.
Since
0.4.0

◆ setUnlockData() [1/2]

virtual LegacySamSelectionExtension & keypop::calypso::crypto::legacysam::sam::LegacySamSelectionExtension::setUnlockData ( const std::string &  unlockData)
pure virtual

Sets the unlock data to be used to unlock a SAM C1 (8 or 16 bytes) and schedules the execution of the "Unlock data" command in the first position.

The "Unlock" command will be executed only after a successful filtering.

Parameters
unlockDataUnlock data as a 32-character hexadecimal string.
Returns
The current instance.
Exceptions
IllegalArgumentExceptionIf the provided unlock data is null, malformed or out of range.
IllegalStateExceptionIf an unlocking setting has already been set.
Since
0.1.0

◆ setUnlockData() [2/2]

virtual LegacySamSelectionExtension & keypop::calypso::crypto::legacysam::sam::LegacySamSelectionExtension::setUnlockData ( const std::string &  unlockData,
const LegacySam::ProductType  productType 
)
pure virtual

Sets the unlock data to be used to unlock a SAM (8 or 16 bytes) and schedules the execution of the "Unlock data" command in the first position.

The "Unlock" command will be executed only after a successful filtering.

Parameters
unlockDataUnlock data as a 32-character hexadecimal string.
productTypeThe targeted product type.
Returns
The current instance.
Exceptions
IllegalArgumentExceptionIf the provided unlock data or product type is null, malformed or out of range.
IllegalStateExceptionIf an unlocking setting has already been set.
Since
0.3.0

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