Keyple Card Calypso C++ Library 2.2.2
Reference Terminal Reader API for C++
CalypsoExtensionService.h
Go to the documentation of this file.
1/**************************************************************************************************
2 * Copyright (c) 2021 Calypso Networks Association https://calypsonet.org/ *
3 * *
4 * See the NOTICE file(s) distributed with this work for additional information regarding *
5 * copyright ownership. *
6 * *
7 * This program and the accompanying materials are made available under the terms of the Eclipse *
8 * Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 *
9 * *
10 * SPDX-License-Identifier: EPL-2.0 *
11 **************************************************************************************************/
12
13#pragma once
14
15#include <memory>
16#include <string>
17
18/* Calypsonet Terminal Calypso */
19#include "BasicSignatureComputationData.h"
20#include "BasicSignatureVerificationData.h"
21#include "CalypsoCard.h"
22#include "CalypsoCardSelection.h"
23#include "CalypsoSamSelection.h"
24#include "CardSecuritySetting.h"
25#include "CardTransactionManager.h"
26#include "CommonSignatureComputationData.h"
27#include "CommonSignatureVerificationData.h"
28#include "SamSecuritySetting.h"
29#include "SamTransactionManager.h"
30#include "SearchCommandData.h"
31
32/* Keyple Card Calypso */
39#include "TraceableSignatureComputationData.h"
40#include "TraceableSignatureVerificationData.h"
41
42/* Keyple Core Common */
43#include "KeypleCardExtension.h"
44
45/* Keyple Core Service */
46#include "CardResourceProfileExtension.h"
47
48namespace keyple {
49namespace card {
50namespace calypso {
51
52using namespace calypsonet::terminal::calypso::card;
53using namespace calypsonet::terminal::calypso::sam;
54using namespace calypsonet::terminal::calypso::transaction;
55using namespace keyple::core::common;
56using namespace keyple::core::service::resource::spi;
57
58
64class KEYPLECARDCALYPSO_API CalypsoExtensionService final : public KeypleCardExtension {
65public:
66 // static {
67 // // Register additional JSON adapters.
68 // JsonUtil.registerTypeAdapter(ElementaryFile.class, new ElementaryFileJsonAdapter(), false);
69 // JsonUtil.registerTypeAdapter(FileHeader.class, new FileHeaderJsonAdapter(), false);
70 // JsonUtil.registerTypeAdapter(SvLoadLogRecord.class, new SvLoadLogRecordJsonAdapter(), false);
71 // JsonUtil.registerTypeAdapter(SvDebitLogRecord.class, new SvDebitLogRecordJsonAdapter(), false);
72 // }
73
80 static std::shared_ptr<CalypsoExtensionService> getInstance();
81
87 const std::string& getReaderApiVersion() const override;
88
94 const std::string& getCardApiVersion() const override;
95
101 const std::string& getCommonApiVersion() const override;
102
110 std::shared_ptr<SearchCommandData> createSearchCommandData() const;
111
121 std::shared_ptr<BasicSignatureComputationData> createBasicSignatureComputationData() const;
122
131 std::shared_ptr<TraceableSignatureComputationData> createTraceableSignatureComputationData()
132 const;
133
142 std::shared_ptr<BasicSignatureVerificationData> createBasicSignatureVerificationData() const;
143
152 std::shared_ptr<TraceableSignatureVerificationData>
153 createTraceableSignatureVerificationData() const;
154
162 std::shared_ptr<CalypsoCardSelection> createCardSelection() const;
163
170 std::shared_ptr<CalypsoSamSelection> createSamSelection() const;
171
184 std::shared_ptr<CardResourceProfileExtension> createSamResourceProfileExtension(
185 const std::shared_ptr<CalypsoSamSelection> calypsoSamSelection) const;
186
193 std::shared_ptr<CardSecuritySetting> createCardSecuritySetting() const;
194
210 std::shared_ptr<CardTransactionManager> createCardTransaction(
211 std::shared_ptr<CardReader> cardReader,
212 const std::shared_ptr<CalypsoCard> calypsoCard,
213 const std::shared_ptr<CardSecuritySetting> cardSecuritySetting) const;
214
225 std::shared_ptr<CardTransactionManager> createCardTransactionWithoutSecurity(
226 std::shared_ptr<CardReader> cardReader,
227 const std::shared_ptr<CalypsoCard> calypsoCard) const;
228
235 std::shared_ptr<SamSecuritySetting> createSamSecuritySetting() const;
236
252 std::shared_ptr<SamTransactionManager> createSamTransaction(
253 std::shared_ptr<CardReader> samReader,
254 const std::shared_ptr<CalypsoSam> calypsoSam,
255 const std::shared_ptr<SamSecuritySetting> samSecuritySetting) const;
256
267 std::shared_ptr<SamTransactionManager> createSamTransactionWithoutSecurity(
268 std::shared_ptr<CardReader> samReader,
269 const std::shared_ptr<CalypsoSam> calypsoSam) const;
270
271private:
275 static std::shared_ptr<CalypsoExtensionService> mInstance;
276
277
282
295 std::shared_ptr<CardTransactionManagerAdapter> createCardTransactionManagerAdapter(
296 std::shared_ptr<CardReader> cardReader,
297 const std::shared_ptr<CalypsoCard> calypsoCard,
298 const std::shared_ptr<CardSecuritySetting> cardSecuritySetting,
299 const bool isSecureMode) const;
300
313 std::shared_ptr<SamTransactionManagerAdapter> createSamTransactionManagerAdapter(
314 std::shared_ptr<CardReader> samReader,
315 const std::shared_ptr<CalypsoSam> calypsoSam,
316 const std::shared_ptr<SamSecuritySetting> samSecuritySetting,
317 const bool isSecureMode) const;
318};
319
320}
321}
322}
#define KEYPLECARDCALYPSO_API