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) 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 <cstdint>
14#include <map>
15#include <memory>
16#include <string>
17#include <vector>
18
22#include "keypop/reader/selection/spi/SmartCard.hpp"
23
24namespace keypop {
25namespace calypso {
26namespace crypto {
27namespace legacysam {
28namespace sam {
29
30using keypop::reader::selection::spi::SmartCard;
31
44class LegacySam : public SmartCard {
45public:
51 enum class ProductType {
57 SAM_C1,
58
64 HSM_C1,
65
72
79
86 };
87
94 virtual ProductType getProductType() const = 0;
95
102 virtual const std::string& getProductInfo() const = 0;
103
110 virtual const std::vector<uint8_t>& getSerialNumber() const = 0;
111
118 virtual uint8_t getPlatform() const = 0;
119
126 virtual uint8_t getApplicationType() const = 0;
127
134 virtual uint8_t getApplicationSubType() const = 0;
135
142 virtual uint8_t getSoftwareIssuer() const = 0;
143
150 virtual uint8_t getSoftwareVersion() const = 0;
151
158 virtual uint8_t getSoftwareRevision() const = 0;
159
167 virtual std::shared_ptr<int> getCounter(const int counterNumber) const = 0;
168
177 virtual const std::map<const int, const int>& getCounters() const = 0;
178
187 getCounterIncrementAccess(const int counterNumber) const = 0;
188
197 virtual std::shared_ptr<int>
198 getCounterCeiling(const int counterNumber) const = 0;
199
207 virtual const std::map<const int, const int>&
209
218 virtual KeyParameter
219 getSystemKeyParameter(const SystemKeyType systemKeyType) const = 0;
220
228 virtual const std::vector<uint8_t>& getCaCertificate() const = 0;
229};
230
231} /* namespace sam */
232} /* namespace legacysam */
233} /* namespace crypto */
234} /* namespace calypso */
235} /* 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