Keypop Calypso Crypto Legacy SAM C++ API 0.6.0
Reference Calypso Crypto Legacy SAM API for C++
LegacySam.hpp
Go to the documentation of this file.
1/**************************************************************************************************
2 * Copyright (c) 2024 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 https://opensource.org/licenses/MIT. *
6 * *
7 * SPDX-License-Identifier: MIT *
8 **************************************************************************************************/
9
10#pragma once
11
12#include <cstdint>
13#include <map>
14#include <memory>
15#include <string>
16#include <vector>
17
21#include "keypop/reader/selection/spi/SmartCard.hpp"
22
23namespace keypop {
24namespace calypso {
25namespace crypto {
26namespace legacysam {
27namespace sam {
28
29using keypop::reader::selection::spi::SmartCard;
30
43class LegacySam : public SmartCard {
44public:
50 enum class ProductType {
56 SAM_C1,
57
63 HSM_C1,
64
71
78
85 };
86
93 virtual ProductType getProductType() const = 0;
94
101 virtual const std::string& getProductInfo() const = 0;
102
109 virtual const std::vector<uint8_t>& getSerialNumber() const = 0;
110
117 virtual uint8_t getPlatform() const = 0;
118
125 virtual uint8_t getApplicationType() const = 0;
126
133 virtual uint8_t getApplicationSubType() const = 0;
134
141 virtual uint8_t getSoftwareIssuer() const = 0;
142
149 virtual uint8_t getSoftwareVersion() const = 0;
150
157 virtual uint8_t getSoftwareRevision() const = 0;
158
166 virtual std::shared_ptr<int> getCounter(const int counterNumber) const = 0;
167
176 virtual const std::map<const int, const int>& getCounters() const = 0;
177
185 virtual CounterIncrementAccess getCounterIncrementAccess(const int counterNumber) const = 0;
186
194 virtual std::shared_ptr<int> getCounterCeiling(const int counterNumber) const = 0;
195
203 virtual const std::map<const int, const int>& getCounterCeilings() const = 0;
204
212 virtual KeyParameter getSystemKeyParameter(const SystemKeyType systemKeyType) const = 0;
213
221 virtual const std::vector<uint8_t>& getCaCertificate() const = 0;
222};
223
224} /* namespace sam */
225} /* namespace legacysam */
226} /* namespace crypto */
227} /* namespace calypso */
228} /* namespace keypop */
virtual KeyParameter getSystemKeyParameter(const SystemKeyType systemKeyType) const =0
virtual const std::vector< uint8_t > & getCaCertificate() const =0
virtual const std::map< const int, const int > & getCounters() const =0
virtual const std::map< const int, const int > & getCounterCeilings() const =0
virtual CounterIncrementAccess getCounterIncrementAccess(const int counterNumber) const =0
virtual const std::string & getProductInfo() const =0
virtual ProductType getProductType() const =0
virtual std::shared_ptr< int > getCounter(const int counterNumber) const =0
virtual std::shared_ptr< int > getCounterCeiling(const int counterNumber) const =0
virtual const std::vector< uint8_t > & getSerialNumber() const =0