Keypop Storage Card C++ API - 1.2.0
Component of the Keypop C++ API
StorageCardTransactionManager.hpp
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2026 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 <vector>
15
16#include "keypop/reader/transaction/spi/CardTransactionManager.hpp"
19
20namespace keypop {
21namespace storagecard {
22namespace transaction {
23
24using keypop::reader::transaction::spi::CardTransactionManager;
26
63: public CardTransactionManager<StorageCardTransactionManager> {
64public:
68 virtual ~StorageCardTransactionManager() = default;
69
89
123 prepareWriteSystemBlock(const std::vector<uint8_t>& data) = 0;
124
141
170 prepareSt25WriteSystemBlock(const std::vector<uint8_t>& data) = 0;
171
187 = 0;
188
205 prepareReadBlocks(int fromBlockAddress, int toBlockAddress) = 0;
206
236 prepareWriteBlocks(int fromBlockAddress, const std::vector<uint8_t>& data)
237 = 0;
238
279 int blockAddress,
280 MifareClassicKeyType mifareClassicKeyType,
281 const std::vector<uint8_t>& key) = 0;
282
312 int blockAddress,
313 MifareClassicKeyType mifareClassicKeyType,
314 int keyNumber) = 0;
315};
316
317} /* namespace transaction */
318} /* namespace storagecard */
319} /* namespace keypop */
Provides methods to manage APDU exchanges with a storage card.
virtual StorageCardTransactionManager & prepareSt25WriteSystemBlock(const std::vector< uint8_t > &data)=0
Prepares the writing of data to the system block of an ST25/SRT512 storage card.
virtual StorageCardTransactionManager & prepareWriteBlocks(int fromBlockAddress, const std::vector< uint8_t > &data)=0
Prepares the writing of blocks of data to the storage card starting from a specific block number offs...
virtual StorageCardTransactionManager & prepareWriteSystemBlock(const std::vector< uint8_t > &data)=0
Prepares the writing of data to the system block of the storage card when present.
virtual StorageCardTransactionManager & prepareMifareClassicAuthenticate(int blockAddress, MifareClassicKeyType mifareClassicKeyType, int keyNumber)=0
Prepares a Mifare Classic authentication command using a key stored in the reader.
virtual StorageCardTransactionManager & prepareReadSystemBlock()=0
Prepares the reading of the system block from the storage card when present.
virtual StorageCardTransactionManager & prepareReadBlock(int blockAddress)=0
Prepares the reading of a specific block from the storage card.
virtual StorageCardTransactionManager & prepareMifareClassicAuthenticate(int blockAddress, MifareClassicKeyType mifareClassicKeyType, const std::vector< uint8_t > &key)=0
Prepares a Mifare Classic authentication command using a provided key.
virtual StorageCardTransactionManager & prepareReadBlocks(int fromBlockAddress, int toBlockAddress)=0
Prepares the reading of a range of blocks from the storage card.
virtual StorageCardTransactionManager & prepareSt25ReadSystemBlock()=0
Prepares the reading of the system block from an ST25/SRT512 storage card.
MifareClassicKeyType
Enumeration of the Mifare Classic key types used for authentication.