Keyple Card Calypso C++ Library 2.2.2
Reference Terminal Reader API for C++
TraceableSignatureComputationDataAdapter.cpp
Go to the documentation of this file.
1/**************************************************************************************************
2 * Copyright (c) 2022 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
14
15/* Keyple Core Util */
16#include "IllegalStateException.h"
17
18namespace keyple {
19namespace card {
20namespace calypso {
21
22using namespace keyple::core::util::cpp::exception;
23
24TraceableSignatureComputationData&
26 const int offset, const bool usePartialSamSerialNumber)
27{
28 mIsSamTraceabilityMode = true;
29 mTraceabilityOffset = offset;
30 mIsPartialSamSerialNumber = usePartialSamSerialNumber;
31
32 return *this;
33}
34
36{
37 mIsBusyMode = false;
38
39 return *this;
40}
41
43{
44 if (!mSignedDataPresent) {
45 throw IllegalStateException("The command has not yet been processed");
46 }
47
48 return mSignedData;
49}
50
52{
53 return mIsSamTraceabilityMode;
54}
55
57{
58 return mTraceabilityOffset;
59}
60
62{
63 return mIsPartialSamSerialNumber;
64}
65
67{
68 return mIsBusyMode;
69}
70
72 const std::vector<uint8_t>& signedData)
73{
74 mSignedData = signedData;
75 mSignedDataPresent = true;
76}
77
78}
79}
80}
TraceableSignatureComputationData & withSamTraceabilityMode(const int offset, const bool usePartialSamSerialNumber) override