Keypop Calypso Crypto Symmetric C++ API 0.1.1
Reference Calypso Crypto Symmetric API for C++
SymmetricCryptoCardTransactionManagerSpi.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 <memory>
13#include <vector>
14
18
19namespace keypop {
20namespace calypso {
21namespace crypto {
22namespace symmetric {
23namespace spi {
24
38public:
48 virtual std::vector<uint8_t>& initTerminalSecureSessionContext() = 0;
49
61 const std::vector<uint8_t>& openSecureSessionDataOut, const uint8_t kif, const uint8_t kvc)
62 = 0;
63
77 virtual const std::vector<uint8_t>&
78 updateTerminalSessionMac(const std::vector<uint8_t>& cardApdu)
79 = 0;
80
89 virtual const std::vector<uint8_t>& finalizeTerminalSessionMac() = 0;
90
99 virtual const std::vector<uint8_t>& generateTerminalSessionMac() = 0;
100
108 virtual void activateEncryption() = 0;
109
117 virtual void deactivateEncryption() = 0;
118
128 virtual bool isCardSessionMacValid(const std::vector<uint8_t>& cardSessionMac) = 0;
129
138 virtual void computeSvCommandSecurityData(const std::shared_ptr<SvCommandSecurityDataApi> data)
139 = 0;
140
150 virtual bool isCardSvMacValid(const std::vector<uint8_t>& cardSvMac) = 0;
151
167 virtual const std::vector<uint8_t>& cipherPinForPresentation(
168 const std::vector<uint8_t>& cardChallenge,
169 const std::vector<uint8_t>& pin,
170 const std::shared_ptr<uint8_t> kif,
171 const std::shared_ptr<uint8_t> kvc)
172 = 0;
173
190 virtual const std::vector<uint8_t>& cipherPinForModification(
191 const std::vector<uint8_t>& cardChallenge,
192 const std::vector<uint8_t>& currentPin,
193 const std::vector<uint8_t>& newPin,
194 const std::shared_ptr<uint8_t> kif,
195 const std::shared_ptr<uint8_t> kvc)
196 = 0;
197
211 virtual const std::vector<uint8_t>& generateCipheredCardKey(
212 const std::vector<uint8_t>& cardChallenge,
213 const uint8_t issuerKeyKif,
214 const uint8_t issuerKeyKvc,
215 const uint8_t targetKeyKif,
216 const uint8_t targetKeyKvc)
217 = 0;
218
226 virtual void synchronize() = 0;
227};
228
229} /* namespace spi */
230} /* namespace symmetric */
231} /* namespace crypto */
232} /* namespace calypso */
233} /* namespace keypop */
virtual const std::vector< uint8_t > & generateCipheredCardKey(const std::vector< uint8_t > &cardChallenge, const uint8_t issuerKeyKif, const uint8_t issuerKeyKvc, const uint8_t targetKeyKif, const uint8_t targetKeyKvc)=0
virtual void computeSvCommandSecurityData(const std::shared_ptr< SvCommandSecurityDataApi > data)=0
virtual const std::vector< uint8_t > & cipherPinForPresentation(const std::vector< uint8_t > &cardChallenge, const std::vector< uint8_t > &pin, const std::shared_ptr< uint8_t > kif, const std::shared_ptr< uint8_t > kvc)=0
virtual bool isCardSvMacValid(const std::vector< uint8_t > &cardSvMac)=0
virtual void initTerminalSessionMac(const std::vector< uint8_t > &openSecureSessionDataOut, const uint8_t kif, const uint8_t kvc)=0
virtual bool isCardSessionMacValid(const std::vector< uint8_t > &cardSessionMac)=0
virtual const std::vector< uint8_t > & updateTerminalSessionMac(const std::vector< uint8_t > &cardApdu)=0
virtual const std::vector< uint8_t > & cipherPinForModification(const std::vector< uint8_t > &cardChallenge, const std::vector< uint8_t > &currentPin, const std::vector< uint8_t > &newPin, const std::shared_ptr< uint8_t > kif, const std::shared_ptr< uint8_t > kvc)=0