7#ifndef LOGICALACCESS_ISO7816ISO7816COMMANDS_HPP
8#define LOGICALACCESS_ISO7816ISO7816COMMANDS_HPP
21#define CMD_ISO7816ISO7816 "ISO7816ISO7816"
23#define ISO7816_CLA_ISO_COMPATIBLE 0x00
24#define ISO7816_INS_APPEND_RECORD 0xE2
25#define ISO7816_INS_GET_CHALLENGE 0x84
26#define ISO7816_INS_READ_RECORDS 0xB2
27#define ISO7816_INS_EXTERNAL_AUTHENTICATE 0x82
28#define ISO7816_INS_INTERNAL_AUTHENTICATE 0x88
29#define ISO7816_INS_GENERAL_AUTHENTICATE 0x87
30#define ISO7816_INS_SELECT_FILE 0xA4
31#define ISO7816_INS_READ_BINARY 0xB0
32#define ISO7816_INS_WRITE_BINARY 0xD0
33#define ISO7816_INS_UPDATE_BINARY 0xD6
34#define ISO7816_INS_ERASE_BINARY 0x0E
35#define ISO7816_INS_GET_RESPONSE 0xC0
36#define ISO7816_INS_GET_DATA 0xCA
37#define ISO7816_INS_GET_DATA_LIST 0xCB
38#define ISO7816_INS_PUT_DATA 0xDA
39#define ISO7816_INS_APPLICATION_MANAGEMENT_REQUEST 0x41
40#define ISO7816_INS_REMOVE_APPLICATION 0xED
68 ByteVector readBinary(
size_t length,
size_t offset,
unsigned short efid = 0)
override;
78 void writeBinary(
const ByteVector &data,
size_t offset,
79 unsigned short efid = 0)
override;
89 void updateBinary(
const ByteVector &data,
size_t offset,
90 unsigned short efid = 0)
override;
98 void eraseBinary(
size_t offset,
unsigned short efid = 0)
override;
107 ByteVector getData(
unsigned short dataObject,
size_t length)
override;
125 void putData(
const ByteVector &data,
unsigned short dataObject)
override;
132 ByteVector getResponse(
unsigned char maxlength = 0)
override;
141 void selectFile(
unsigned char p1,
unsigned char p2,
const ByteVector &data)
override;
150 ByteVector readRecords(
unsigned short fid = 0,
unsigned char start_record = 0,
159 unsigned short fid = 0)
override;
166 ByteVector getChallenge(
unsigned int length = 8)
override;
175 void externalAuthenticate(
unsigned char algorithm = 0x00,
176 bool globalReference =
false,
unsigned char keyno = 0x00,
188 ByteVector externalAuthenticate(
unsigned char algorithm,
189 bool globalReference,
unsigned char keyno,
191 unsigned char le)
override;
203 ByteVector internalAuthenticate(
unsigned char algorithm = 0x00,
204 bool globalReference =
false,
205 unsigned char keyno = 0x00,
207 unsigned int length = 16)
override;
219 ByteVector generalAuthenticate(
unsigned char algorithm,
bool globalReference,
222 unsigned char le)
override;
224 ByteVector generalAuthenticate_challenge(
unsigned char algorithm,
225 bool globalReference,
226 unsigned char keyno)
override;
228 ByteVector generalAuthenticate_response(
unsigned char algorithm,
229 bool globalReference,
233 void removeApplication(
241 unsigned char p2 = 0x00)
override;
249 return std::dynamic_pointer_cast<ISO7816ReaderCardAdapter>(
250 getReaderCardAdapter());
261 static void setP1P2(
size_t offset,
unsigned short efid,
unsigned char &p1,
unsigned char &p2);
The ISO7816 commands class.
Definition: iso7816commands.hpp:105
The ISO7816 commands base class.
Definition: iso7816iso7816commands.hpp:46
std::shared_ptr< ISO7816ReaderCardAdapter > getISO7816ReaderCardAdapter() const
Get the ISO7816 reader/card adapter.
Definition: iso7816iso7816commands.hpp:247
ISO7816 commands. See http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-4....
#define ISO7816_DATA_OBJECT_SELECTED
Definition: iso7816commands.hpp:84
Default ISO7816 reader/card adapter.
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
ISORemoveApplicationP1
The P1 of Remove Application command.
Definition: iso7816commands.hpp:53
@ P1_STATE_OPERATIONAL_OR_INITIALIZATION_TO_CREATION
Definition: iso7816commands.hpp:58
ISORecords
The ISO record transmission mode.
Definition: iso7816commands.hpp:79
@ ISO_RECORD_ONERECORD
Definition: iso7816commands.hpp:80
ISOApplicationManagementRequestP1
The P1 of Application Management Request command.
Definition: iso7816commands.hpp:66
@ P1_STATE_CREATION_TO_OPERATIONAL
Definition: iso7816commands.hpp:71