LibLogicalAccess
2.5.0
An Open Source RFID Library
|
The ISO7816 commands class. More...
#include <iso7816commands.hpp>
Public Member Functions | |
ISO7816Commands () | |
ISO7816Commands (std::string ct) | |
virtual | ~ISO7816Commands () |
virtual ByteVector | readBinary (size_t length, size_t offset, unsigned short efid=0)=0 |
Read binary data. | |
virtual void | writeBinary (const ByteVector &data, size_t offset, unsigned short efid=0)=0 |
Write binary data. | |
virtual void | updateBinary (const ByteVector &data, size_t offset, unsigned short efid=0)=0 |
Update binary data. | |
virtual void | eraseBinary (size_t offset, unsigned short efid=0)=0 |
Erase binary data. | |
virtual ByteVector | getData (unsigned short dataObject, size_t length=0)=0 |
Get data. | |
virtual ByteVector | getDataList (int64_t dataObject, unsigned short efid=ISO7816_DATA_OBJECT_SELECTED, unsigned char listtag=ISO7816_DATA_OBJECT_HEADERLIST, size_t length=0) |
Get data. | |
virtual ByteVector | getDataList (TLVPtr tlv, size_t length=0, unsigned short efid=ISO7816_DATA_OBJECT_SELECTED) |
Get data. | |
virtual ByteVector | getDataList (const ByteVector &data, size_t length=0, unsigned short efid=ISO7816_DATA_OBJECT_SELECTED)=0 |
Get data. | |
virtual void | putData (const ByteVector &data, unsigned short dataObject)=0 |
Put data. | |
virtual ByteVector | getResponse (unsigned char maxlength=0)=0 |
Get response. | |
virtual void | selectFile (ISOSelectFileP1 p1, ISOSelectFileP2 p2, unsigned short efid) |
Select a file under current DF by the file identifier. | |
virtual void | selectFile (unsigned short efid) |
Select a file under current DF by the file identifier. | |
virtual void | selectFile (const ByteVector &dfname) |
Select a file by the DF name. | |
virtual void | selectFile (unsigned char p1, unsigned char p2, const ByteVector &data)=0 |
Select a file. | |
virtual ByteVector | readRecords (unsigned short fid=0, unsigned char start_record=0, ISORecords record_number=ISO_RECORD_ONERECORD)=0 |
Read records. | |
virtual void | appendrecord (const ByteVector &data=ByteVector(), unsigned short fid=0)=0 |
Append a record to a file. | |
virtual ByteVector | getChallenge (unsigned int length=8)=0 |
Get the ISO challenge for authentication. | |
virtual void | externalAuthenticate (unsigned char algorithm=0x00, bool globalReference=false, unsigned char keyno=0x00, const ByteVector &data=ByteVector())=0 |
ISO external authenticate. | |
virtual ByteVector | externalAuthenticate (unsigned char algorithm, bool globalReference, unsigned char keyno, const ByteVector &data, unsigned char le)=0 |
ISO external authenticate. | |
virtual ByteVector | internalAuthenticate (unsigned char algorithm=0x00, bool globalReference=false, unsigned char keyno=0x00, const ByteVector &RPCD2=ByteVector(), unsigned int length=16)=0 |
ISO internal authenticate. | |
virtual ByteVector | generalAuthenticate (unsigned char algorithm, bool globalReference, unsigned char keyno, const ByteVector &dataField, unsigned char le)=0 |
ISO general authenticate. | |
virtual ByteVector | generalAuthenticate_challenge (unsigned char algorithm, bool globalReference, unsigned char keyno)=0 |
virtual ByteVector | generalAuthenticate_response (unsigned char algorithm, bool globalReference, unsigned char keyno, const ByteVector &data)=0 |
virtual void | removeApplication (const ByteVector &data, ISORemoveApplicationP1 p1=P1_STATE_OPERATIONAL_OR_INITIALIZATION_TO_CREATION)=0 |
virtual void | removeApplication (TLVPtr tlv, ISORemoveApplicationP1 p1=P1_STATE_OPERATIONAL_OR_INITIALIZATION_TO_CREATION) |
virtual ByteVector | applicationManagementRequest (const ByteVector &data, ISOApplicationManagementRequestP1 p1=P1_STATE_CREATION_TO_OPERATIONAL, unsigned char p2=0x00)=0 |
virtual ByteVector | applicationManagementRequest (TLVPtr tlv, ISOApplicationManagementRequestP1 p1=P1_STATE_CREATION_TO_OPERATIONAL, unsigned char p2=0x00) |
![]() | |
Commands ()=delete | |
Constructor. | |
virtual | ~Commands () |
std::shared_ptr< Chip > | getChip () const override |
Get the chip. | |
virtual void | setChip (std::shared_ptr< Chip > chip) |
Set the chip. | |
std::shared_ptr< ReaderCardAdapter > | getReaderCardAdapter () const override |
Get the reader/card adapter. | |
virtual void | setReaderCardAdapter (std::shared_ptr< ReaderCardAdapter > adapter) |
Set the reader/card adapter. | |
virtual const std::string & | getCmdType () const |
Get the cmd name. | |
virtual void | setCmdType (const std::string &command_type) |
Set the cmd name. | |
![]() | |
virtual | ~ICommands ()=default |
virtual std::shared_ptr< Chip > | getChip () const =0 |
Get the chip. | |
virtual std::shared_ptr< ReaderCardAdapter > | getReaderCardAdapter () const =0 |
Get the reader/card adapter. | |
Additional Inherited Members | |
![]() | |
Commands (std::string commandtype) | |
Constructor. | |
![]() | |
std::shared_ptr< ReaderCardAdapter > | d_readerCardAdapter |
The reader/card adapter. | |
std::weak_ptr< Chip > | d_chip |
The chip. | |
std::string | d_commandtype |
The command type. | |
The ISO7816 commands class.
|
inline |
|
inlineexplicit |
|
virtual |
|
pure virtual |
Append a record to a file.
data | The record data |
fid | The FID |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
virtual |
|
pure virtual |
Erase binary data.
offset | The erase offset. |
efid | The EF identifier to set as current. |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
ISO external authenticate.
algorithm | The ISO algorithm to use for authentication. |
globalReference | True if the referenced key to authenticate is global (e.g. an MF secific key), false otherwise (e.g. DF specific key). false otherwise. |
keyno | The key number. |
data | The data. |
le | Expected response length. |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
ISO external authenticate.
algorithm | The ISO algorithm to use for authentication. |
globalReference | True if the referenced key to authenticate is global (e.g. an MF secific key), false otherwise (e.g. DF specific key). |
keyno | The key number. |
data | The data. |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
ISO general authenticate.
algorithm | The ISO algorithm to use for authentication. |
globalReference | True if the referenced key to authenticate is global (e.g. an MF secific key), false otherwise (e.g. DF specific key). false otherwise. |
keyno | The key number. |
dataField | The data. |
le | Expected response length. |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
Get the ISO challenge for authentication.
length | The challenge length (8 = 2K3DES, 16 = 3K3DES and AES) |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
Get data.
dataObject | The data object to get. |
length | The expected object length. |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
Get data.
data | The data object list to get. |
length | The expected object length. |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
virtual |
Get data.
dataObject | The data object to get. |
listtag | The list tag. |
length | The expected object length. |
|
virtual |
Get data.
tlv | The tlv with data object list to get. |
length | The expected object length. |
|
pure virtual |
Get response.
maxlength | The maximum expected length. |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
ISO internal authenticate.
algorithm | The ISO algorithm to use for authentication. |
globalReference | True if the referenced key to authenticate is global (e.g. an MF secific key), false otherwise (e.g. DF specific key). |
keyno | The key number. |
RPCD2 | The RPCD2. |
length | The length. |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
Put data.
data | The buffer that contains data. |
dataLength | The buffer length. |
dataObject | The data object to get. |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
Read binary data.
data | The buffer that will contains data. |
dataLength | The buffer length. |
offset | The read offset. |
efid | The EF identifier to set as current. |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
Read records.
fid | The FID |
start_record | The start record (0 = read last written record) |
record_number | The number of records to read |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
virtual |
|
virtual |
Select a file by the DF name.
dfname | The DF name. |
|
virtual |
Select a file under current DF by the file identifier.
p1 | The P1 parameter. |
p2 | The P2 parameter. |
efid | The file identifier. |
|
pure virtual |
Select a file.
p1 | The parameter 1. |
p2 | The parameter 2. |
data | The data buffer. |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
virtual |
Select a file under current DF by the file identifier.
efid | The file identifier. |
|
pure virtual |
Update binary data.
data | The buffer that contains data to update. |
dataLength | The buffer length. |
offset | The update offset. |
efid | The EF identifier to set as current. |
Implemented in logicalaccess::ISO7816ISO7816Commands.
|
pure virtual |
Write binary data.
data | The buffer that contains data to write. |
dataLength | The buffer length. |
offset | The write offset. |
efid | The EF identifier to set as current. |
Implemented in logicalaccess::ISO7816ISO7816Commands.