7#ifndef LOGICALACCESS_DESFIREEV1COMMANDS_HPP
8#define LOGICALACCESS_DESFIREEV1COMMANDS_HPP
19#define DFEV1_DESFIRE_AID "\xd2\x76\x00\x00\x85\x01\x00"
21#define DFEV1_INS_FREE_MEM 0x6E
22#define DFEV1_INS_GET_DF_NAMES 0x6D
23#define DFEV1_INS_GET_CARD_UID 0x51
24#define DFEV1_INS_GET_ISO_FILE_IDS 0x61
25#define DFEV1_INS_SET_CONFIGURATION 0x5C
27#define DFEV1_INS_AUTHENTICATE_ISO 0x1A
28#define DFEV1_INS_AUTHENTICATE_AES 0xAA
30#define SELECT_FILE_BY_AID 0x04
31#define SELECT_FILE_BY_FID 0x00
34#define CMD_DESFIRE_EV1 "DESFireEV1"
84 virtual void selectApplication(std::shared_ptr<DESFireEV1Location> location);
92 virtual void createApplication(std::shared_ptr<DESFireEV1Location> location,
101 virtual void createStdDataFile(std::shared_ptr<DESFireEV1Location> location,
103 unsigned int fileSize);
139 unsigned short isoFID = 0x00,
166 unsigned int fileSize,
167 unsigned short isoFID = 0x00) = 0;
178 unsigned int fileSize,
179 unsigned short isoFID = 0x00) = 0;
191 unsigned int fileSize,
192 unsigned int maxNumberOfRecords,
193 unsigned short isoFID = 0x00) = 0;
205 unsigned int fileSize,
206 unsigned int maxNumberOfRecords,
207 unsigned short isoFID = 0x00) = 0;
324 return std::shared_ptr<ISO7816Commands>();
LLA_CARDS_DESFIRE_API void getDESFireEV1Chip(std::shared_ptr< logicalaccess::Chip > *chip)
Definition: libraryentry.cpp:19
The DESFire EV1 base commands class.
Definition: desfireev1commands.hpp:76
virtual void createStdDataFile(unsigned char fileno, EncryptionMode comSettings, const DESFireAccessRights &accessRights, unsigned int fileSize, unsigned short isoFID=0x00)=0
Create a new data file in the current application.
virtual void authenticateAES(unsigned char keyno)=0
AuthenticateAES command.
DESFireEV1Commands()=default
virtual ByteVector getCardUID()=0
Get a random card UID.
virtual std::shared_ptr< ISO7816Commands > getISO7816Commands() const
Definition: desfireev1commands.hpp:322
virtual void createLinearRecordFile(unsigned char fileno, EncryptionMode comSettings, const DESFireAccessRights &accessRights, unsigned int fileSize, unsigned int maxNumberOfRecords, unsigned short isoFID=0x00)=0
Create a new linear record file in the current application.
virtual void getKeySettings(DESFireKeySettings &settings, unsigned char &maxNbKeys, DESFireKeyType &keyType)=0
Get key settings on the current application.
virtual void createBackupFile(unsigned char fileno, EncryptionMode comSettings, const DESFireAccessRights &accessRights, unsigned int fileSize, unsigned short isoFID=0x00)=0
Create a new backup file in the current application.
virtual void createCyclicRecordFile(unsigned char fileno, EncryptionMode comSettings, const DESFireAccessRights &accessRights, unsigned int fileSize, unsigned int maxNumberOfRecords, unsigned short isoFID=0x00)=0
Create a new cyclic record file in the current application.
virtual void setConfiguration(bool formatCardEnabled, bool randomIdEnabled)=0
Read data from a specific file.
virtual std::vector< unsigned short > getISOFileIDs()=0
Get the ISO FID of all active files within the currently selected application.
virtual void authenticateISO(unsigned char keyno, DESFireISOAlgorithm algorithm=DF_ALG_2K3DES)=0
AuthenticateISO command.
virtual unsigned int getFreeMem()=0
Get the value of available bytes.
virtual std::vector< DFName > getDFNames()=0
Get the ISO DF-Names of all active application.
virtual void createApplication(unsigned int aid, DESFireKeySettings settings, unsigned char maxNbKeys, DESFireKeyType cryptoMethod, FidSupport fidSupported=FIDS_NO_ISO_FID, unsigned short isoFID=0x00, ByteVector isoDFName=ByteVector())=0
Create a new application.
virtual void setConfiguration(const ByteVector &ats)=0
Set a custom card ATS.
virtual void setConfiguration(std::shared_ptr< DESFireKey > defaultKey)=0
Set the card configuration default key. param defaultKey The new default key.
virtual void selectApplication(unsigned int aid)=0
Select an application.
The base abstract commands class for all card commands.
Definition: icommands.hpp:20
ISO7816 commands. See http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-4....
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
FidSupport
The FID Support for ISO 7816.
Definition: desfireev1commands.hpp:49
@ FIDS_ISO_FID
Definition: desfireev1commands.hpp:49
@ FIDS_NO_ISO_FID
Definition: desfireev1commands.hpp:49
DESFireEV1TransmissionMode
The DESFire EV1 transmission mode.
Definition: desfireev1commands.hpp:54
@ DFEV1_CMD_MACV
Definition: desfireev1commands.hpp:57
@ DFEV1_CMD_PLAIN
Definition: desfireev1commands.hpp:55
@ DFEV1_CMD_NOMACV
Definition: desfireev1commands.hpp:56
EncryptionMode
The file communication mode (or encryption mode)
Definition: desfirelocation.hpp:18
DESFireKeySettings
The key settings.
Definition: desfirecommands.hpp:69
DESFireISOAlgorithm
The DESFire EV1 algorithm.
Definition: desfireev1commands.hpp:63
@ DF_ALG_3K3DES
Definition: desfireev1commands.hpp:66
@ DF_ALG_AES
Definition: desfireev1commands.hpp:67
@ DF_ALG_2K3DES
Definition: desfireev1commands.hpp:65
@ DF_ALG_BY_CONTEXT
Definition: desfireev1commands.hpp:64
DESFireKeyType
The DESFire key type.
Definition: desfirekey.hpp:33
Access rights on DESFire file.
Definition: desfirecommands.hpp:106
The ISO DFName and FID.
Definition: desfireev1commands.hpp:40
unsigned short FID
Definition: desfireev1commands.hpp:42
char DF_Name[64]
Definition: desfireev1commands.hpp:43
unsigned int AID
Definition: desfireev1commands.hpp:41