Keypop Calypso Crypto Legacy SAM C++ API - 1.0.0
Component of the Keypop C++ API
LegacySamSelectionExtension.hpp
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
3 * *
4 * This program and the accompanying materials are made available under the *
5 * terms of the MIT License which is available at *
6 * https://opensource.org/licenses/MIT. *
7 * *
8 * SPDX-License-Identifier: MIT *
9 ******************************************************************************/
10
11#pragma once
12
13#include <memory>
14#include <string>
15
20#include "keypop/reader/CardReader.hpp"
21#include "keypop/reader/selection/spi/CardSelectionExtension.hpp"
22
23namespace keypop {
24namespace calypso {
25namespace crypto {
26namespace legacysam {
27namespace sam {
28
29using keypop::calypso::crypto::legacysam::spi::
30 LegacySamDynamicUnlockDataProviderSpi;
31using keypop::calypso::crypto::legacysam::spi::
32 LegacySamStaticUnlockDataProviderSpi;
33using keypop::reader::CardReader;
34using keypop::reader::selection::spi::CardSelectionExtension;
35
73class LegacySamSelectionExtension : public CardSelectionExtension {
74public:
92 setUnlockData(const std::string& unlockData)
93 = 0;
94
113 const std::string& unlockData, const LegacySam::ProductType productType)
114 = 0;
115
137 const std::shared_ptr<LegacySamStaticUnlockDataProviderSpi>
138 staticUnlockDataProvider)
139 = 0;
140
163 const std::shared_ptr<LegacySamStaticUnlockDataProviderSpi>
164 staticUnlockDataProvider,
165 const std::shared_ptr<CardReader> targetSamReader)
166 = 0;
167
189 const std::shared_ptr<LegacySamDynamicUnlockDataProviderSpi>
190 dynamicUnlockDataProvider)
191 = 0;
192
215 const std::shared_ptr<LegacySamDynamicUnlockDataProviderSpi>
216 dynamicUnlockDataProvider,
217 const std::shared_ptr<CardReader> targetSamReader)
218 = 0;
219
230
245 = 0;
246
261 prepareReadWorkKeyParameters(const int recordNumber)
262 = 0;
263
277 prepareReadWorkKeyParameters(const uint8_t kif, const uint8_t kvc)
278 = 0;
279
296 prepareReadCounterStatus(int counterNumber)
297 = 0;
298
307
320};
321
322} /* namespace sam */
323} /* namespace legacysam */
324} /* namespace crypto */
325} /* namespace calypso */
326} /* namespace keypop */
ProductType
All Calypso SAM products supported by this API.
Definition: LegacySam.hpp:52
Extends the CardSelectionExtension interface of the "Keypop Reader API" to provide means to define op...
virtual LegacySamSelectionExtension & setUnlockData(const std::string &unlockData, const LegacySam::ProductType productType)=0
Sets the unlock data to be used to unlock a SAM (8 or 16 bytes) and schedules the execution of the "U...
virtual LegacySamSelectionExtension & prepareGetData(GetDataTag tag)=0
Schedules the execution of a "Get Data" command for the specified tag.
virtual LegacySamSelectionExtension & prepareReadWorkKeyParameters(const int recordNumber)=0
Schedules the execution of a "Read Key Parameters" command for a work key referenced by its record nu...
virtual LegacySamSelectionExtension & setDynamicUnlockDataProvider(const std::shared_ptr< LegacySamDynamicUnlockDataProviderSpi > dynamicUnlockDataProvider)=0
Sets the unlock data provider to use for unlocking the SAM in dynamic mode.
virtual LegacySamSelectionExtension & setStaticUnlockDataProvider(const std::shared_ptr< LegacySamStaticUnlockDataProviderSpi > staticUnlockDataProvider, const std::shared_ptr< CardReader > targetSamReader)=0
Sets the unlock data provider and the card reader to use for unlocking the SAM in static mode.
virtual LegacySamSelectionExtension & setStaticUnlockDataProvider(const std::shared_ptr< LegacySamStaticUnlockDataProviderSpi > staticUnlockDataProvider)=0
Sets the unlock data provider to use for unlocking the SAM in static mode.
virtual LegacySamSelectionExtension & prepareReadSystemKeyParameters(const SystemKeyType systemKeyType)=0
Schedules the execution of a "Read Key Parameters" command for a system key.
virtual LegacySamSelectionExtension & setDynamicUnlockDataProvider(const std::shared_ptr< LegacySamDynamicUnlockDataProviderSpi > dynamicUnlockDataProvider, const std::shared_ptr< CardReader > targetSamReader)=0
Sets the unlock data provider and the card reader to use for unlocking the SAM in dynamic mode.
virtual LegacySamSelectionExtension & prepareReadAllCountersStatus()=0
Schedules the execution of a "Read Event Counter" and "Read Ceiling" commands to read the status of a...
virtual LegacySamSelectionExtension & prepareReadWorkKeyParameters(const uint8_t kif, const uint8_t kvc)=0
Schedules the execution of a "Read Key Parameters" command for a work key referenced by its KIF and K...
virtual LegacySamSelectionExtension & prepareReadCounterStatus(int counterNumber)=0
Schedules the execution of a "Read Event Counter" and "Read Ceiling" commands to read the status of a...
virtual LegacySamSelectionExtension & setUnlockData(const std::string &unlockData)=0
Sets the unlock data to be used to unlock a SAM C1 (8 or 16 bytes) and schedules the execution of the...
virtual LegacySamSelectionExtension & prepareReadSamParameters()=0
Schedules the execution of a "Read Parameters" command for the SAM.
GetDataTag
Enumeration of all output data tags.
Definition: GetDataTag.hpp:25
SystemKeyType
Enumeration of the system key types of a Legacy Sam.