18#include "ApduResponseApi.h"
47using namespace calypsonet::terminal::card;
71 const std::shared_ptr<AbstractCardCommand> command,
72 const std::shared_ptr<ApduResponseApi> apduResponse,
73 const bool isSessionOpen);
91 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
92 const std::vector<std::shared_ptr<AbstractApduCommand>>& commands,
93 const std::vector<std::shared_ptr<ApduResponseApi>>& apduResponses,
94 const bool isSessionOpen);
114 static void updateCalypsoCardOpenSession(
115 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
116 std::shared_ptr<CmdCardOpenSession> cmdCardOpenSession,
117 const std::shared_ptr<ApduResponseApi> apduResponse);
127 static void updateCalypsoCardCloseSession(
128 std::shared_ptr<CmdCardCloseSession> cmdCardCloseSession,
129 const std::shared_ptr<ApduResponseApi> apduResponse);
143 static void updateCalypsoCardReadRecords(
144 const std::shared_ptr<CalypsoCardAdapter> calypsoCard,
145 const std::shared_ptr<CmdCardReadRecords> cmdCardReadRecords,
146 const std::shared_ptr<ApduResponseApi> apduResponse,
147 const bool isSessionOpen);
157 static void checkResponseStatusForStrictAndBestEffortMode(
158 const std::shared_ptr<AbstractCardCommand> command,
const bool isSessionOpen);
173 static void updateCalypsoCardSearchRecordMultiple(
174 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
175 std::shared_ptr<CmdCardSearchRecordMultiple> cmdCardSearchRecordMultiple,
176 const std::shared_ptr<ApduResponseApi> apduResponse,
177 const bool isSessionOpen);
191 static void updateCalypsoCardReadRecordMultiple(
192 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
193 std::shared_ptr<CmdCardReadRecordMultiple> cmdCardReadRecordMultiple,
194 const std::shared_ptr<ApduResponseApi> apduResponse,
195 const bool isSessionOpen);
209 static void updateCalypsoCardReadBinary(std::shared_ptr<CalypsoCardAdapter> calypsoCard,
210 std::shared_ptr<CmdCardReadBinary> cmdCardReadBinary,
211 const std::shared_ptr<ApduResponseApi> apduResponse,
212 const bool isSessionOpen);
226 static void updateCalypsoCardWithFcp(
227 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
228 std::shared_ptr<AbstractCardCommand> command,
229 const std::shared_ptr<ApduResponseApi> apduResponse);
244 static void updateCalypsoCardWithEfList(
245 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
246 std::shared_ptr<CmdCardGetDataEfList> command,
247 const std::shared_ptr<ApduResponseApi> apduResponse);
260 static void updateCalypsoCardWithTraceabilityInformation(
261 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
262 std::shared_ptr<CmdCardGetDataTraceabilityInformation> command,
263 const std::shared_ptr<ApduResponseApi> apduResponse);
275 static void updateCalypsoCardUpdateRecord(
276 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
277 std::shared_ptr<CmdCardUpdateRecord> cmdCardUpdateRecord,
278 const std::shared_ptr<ApduResponseApi> apduResponse);
290 static void updateCalypsoCardWriteRecord(
291 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
292 std::shared_ptr<CmdCardWriteRecord> cmdCardWriteRecord,
293 const std::shared_ptr<ApduResponseApi> apduResponse);
305 static void updateCalypsoCardUpdateBinary(
306 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
307 std::shared_ptr<CmdCardUpdateOrWriteBinary> cmdCardUpdateBinary,
308 const std::shared_ptr<ApduResponseApi> apduResponse);
320 static void updateCalypsoCardWriteBinary(
321 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
322 std::shared_ptr<CmdCardUpdateOrWriteBinary> cmdCardWriteBinary,
323 const std::shared_ptr<ApduResponseApi> apduResponse);
336 static void updateCalypsoCardAppendRecord(
337 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
338 std::shared_ptr<CmdCardAppendRecord> cmdCardAppendRecord,
339 const std::shared_ptr<ApduResponseApi> apduResponse);
352 static void updateCalypsoCardIncreaseOrDecrease(
353 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
354 std::shared_ptr<CmdCardIncreaseOrDecrease> cmdCardIncreaseOrDecrease,
355 const std::shared_ptr<ApduResponseApi> apduResponse);
368 static void updateCalypsoCardIncreaseOrDecreaseMultiple(
369 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
370 std::shared_ptr<CmdCardIncreaseOrDecreaseMultiple> cmdCardIncreaseOrDecreaseMultiple,
371 const std::shared_ptr<ApduResponseApi> apduResponse);
383 static void updateCalypsoCardGetChallenge(
384 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
385 std::shared_ptr<CmdCardGetChallenge> cmdCardGetChallenge,
386 const std::shared_ptr<ApduResponseApi> apduResponse);
401 static void updateCalypsoVerifyPin(std::shared_ptr<CalypsoCardAdapter> calypsoCard,
402 std::shared_ptr<CmdCardVerifyPin> cmdCardVerifyPin,
403 const std::shared_ptr<ApduResponseApi> apduResponse);
412 static void updateCalypsoChangePin(std::shared_ptr<CmdCardChangePin> cmdCardChangePin,
413 const std::shared_ptr<ApduResponseApi> apduResponse);
422 static void updateCalypsoChangeKey(std::shared_ptr<CmdCardChangeKey> cmdCardChangeKey,
423 const std::shared_ptr<ApduResponseApi> apduResponse);
437 static void updateCalypsoCardSvGet(
438 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
439 std::shared_ptr<CmdCardSvGet> cmdCardSvGet,
440 const std::shared_ptr<ApduResponseApi> apduResponse);
455 static void updateCalypsoCardSvOperation(
456 std::shared_ptr<CalypsoCardAdapter> calypsoCard,
457 std::shared_ptr<AbstractCardCommand> cmdCardSvOperation,
458 const std::shared_ptr<ApduResponseApi> apduResponse);
468 static void updateCalypsoInvalidateRehabilitate(
469 std::shared_ptr<AbstractCardCommand> cmdCardInvalidateRehabilitate,
470 const std::shared_ptr<ApduResponseApi> apduResponse);
480 static const std::shared_ptr<DirectoryHeader> createDirectoryHeader(
481 const std::vector<uint8_t>& proprietaryInformation);
490 static ElementaryFile::Type getEfTypeFromCardValue(
const uint8_t efType);
500 static const std::shared_ptr<FileHeaderAdapter> createFileHeader(
501 const std::vector<uint8_t>& proprietaryInformation);
static void updateCalypsoCard(std::shared_ptr< CalypsoCardAdapter > calypsoCard, const std::shared_ptr< AbstractCardCommand > command, const std::shared_ptr< ApduResponseApi > apduResponse, const bool isSessionOpen)