8#ifndef LOGICALACCESS_DESFIREEV1STIDSTRCOMMANDS_HPP
9#define LOGICALACCESS_DESFIREEV1STIDSTRCOMMANDS_HPP
21#define CMD_DESFIREEV1STIDSTR "DESFireEV1STidSTR"
73 void releaseRFIDField()
const;
87 unsigned int getFreeMem()
override;
93 std::vector<DFName> getDFNames()
override;
100 std::vector<unsigned short> getISOFileIDs()
override;
105 virtual void erase();
107 using DESFireEV1Commands::createApplication;
117 unsigned char maxNbKeys);
128 unsigned short isoFID = 0x00,
135 virtual void deleteApplication(
unsigned int aid);
141 void selectApplication(
unsigned int aid)
override;
165 using DESFireEV1Commands::createStdDataFile;
175 virtual void createStdDataFile(
unsigned char fileno,
EncryptionMode comSettings,
177 unsigned int fileSize);
186 void createStdDataFile(
unsigned char fileno,
EncryptionMode comSettings,
188 unsigned short isoFID)
override;
193 virtual void commitTransaction();
198 virtual void abortTransaction();
207 virtual void createBackupFile(
unsigned char fileno,
EncryptionMode comSettings,
209 unsigned int fileSize);
218 void createBackupFile(
unsigned char fileno,
EncryptionMode comSettings,
220 unsigned short isoFID)
override;
232 virtual void createValueFile(
unsigned char fileno,
EncryptionMode comSettings,
234 int32_t lowerLimit, int32_t upperLimit,
235 int32_t value,
bool limitedCreditEnabled);
245 virtual void createLinearRecordFile(
unsigned char fileno,
EncryptionMode comSettings,
247 unsigned int fileSize,
248 unsigned int maxNumberOfRecords);
259 void createLinearRecordFile(
unsigned char fileno,
EncryptionMode comSettings,
261 unsigned int fileSize,
unsigned int maxNumberOfRecords,
262 unsigned short isoFID)
override;
272 virtual void createCyclicRecordFile(
unsigned char fileno,
EncryptionMode comSettings,
274 unsigned int fileSize,
275 unsigned int maxNumberOfRecords);
285 void createCyclicRecordFile(
unsigned char fileno,
EncryptionMode comSettings,
287 unsigned int fileSize,
unsigned int maxNumberOfRecords,
288 unsigned short isoFID)
override;
294 virtual void loadKey(std::shared_ptr<DESFireKey> key);
302 virtual void loadKey(
ByteVector key,
bool diversify,
bool isVolatile);
318 virtual void authenticate(
unsigned char keyno);
325 virtual void authenticate(
unsigned char keyno, std::shared_ptr<DESFireKey> key);
332 void authenticateISO(
unsigned char keyno,
339 void authenticateAES(
unsigned char keyno)
override;
349 virtual ByteVector readData(
unsigned char fileno,
unsigned int offset,
359 virtual void writeData(
unsigned char fileno,
unsigned int offset,
368 virtual void credit(
unsigned char fileno,
unsigned int value,
EncryptionMode mode);
376 virtual void debit(
unsigned char fileno,
unsigned int value,
EncryptionMode mode);
386 virtual void limitedCredit(
unsigned char fileno,
unsigned int value,
397 virtual void writeRecord(
unsigned char fileno,
unsigned int offset,
409 virtual ByteVector readRecords(
unsigned char fileno,
unsigned int offset,
416 virtual void clearRecordFile(
unsigned char fileno);
425 virtual void changeFileSettings(
unsigned char fileno,
EncryptionMode comSettings,
432 virtual void deleteFile(
unsigned char fileno);
445 virtual void changeKey(
unsigned char keyno, std::shared_ptr<DESFireKey> key);
455 void changeKeyIndex(
unsigned char keyno,
DESFireKeyType cryptoMethod,
456 unsigned char keyversion,
unsigned char newkeyindex,
457 unsigned char oldkeyindex)
const;
464 unsigned char getKeyVersion(
unsigned char keyno)
const;
476 virtual std::vector<unsigned int> getApplicationIDs();
490 virtual void getFileSettings(
unsigned char fileno,
499 virtual void getValue(
unsigned char fileno,
EncryptionMode mode,
unsigned int &value);
506 void setConfiguration(
bool formatCardEnabled,
bool randomIdEnabled)
override;
512 void setConfiguration(std::shared_ptr<DESFireKey> defaultKey)
override;
518 void setConfiguration(
const ByteVector &ats)
override;
524 std::shared_ptr<Chip>
getChip()
const override
526 return Commands::getChip();
535 return Commands::getReaderCardAdapter();
545 return std::dynamic_pointer_cast<STidSTRReaderCardAdapter>(
546 getReaderCardAdapter());
The base commands class for all card commands.
Definition: commands.hpp:21
The DESFire EV1 base commands class.
Definition: desfireev1commands.hpp:76
The DESFire EV1 base commands class for STidSTR reader.
Definition: desfireev1stidstrcommands.hpp:49
std::shared_ptr< Chip > getChip() const override
Get the chip.
Definition: desfireev1stidstrcommands.hpp:524
unsigned int d_currentAid
Definition: desfireev1stidstrcommands.hpp:556
std::shared_ptr< ReaderCardAdapter > getReaderCardAdapter() const override
Get the reader/card adapter.
Definition: desfireev1stidstrcommands.hpp:533
std::shared_ptr< STidSTRReaderCardAdapter > getSTidSTRReaderCardAdapter() const
Get the STidSTR reader/card adapter.
Definition: desfireev1stidstrcommands.hpp:543
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
STidKeyLocationType
The STid DESFire baudrates.
Definition: desfireev1stidstrcommands.hpp:35
@ STID_DF_KEYLOC_INDEXED
Definition: desfireev1stidstrcommands.hpp:38
@ STID_DF_KEYLOC_EEPROM
Definition: desfireev1stidstrcommands.hpp:37
@ STID_DF_KEYLOC_RAM
Definition: desfireev1stidstrcommands.hpp:36
FidSupport
The FID Support for ISO 7816.
Definition: desfireev1commands.hpp:49
@ FIDS_NO_ISO_FID
Definition: desfireev1commands.hpp:49
EncryptionMode
The file communication mode (or encryption mode)
Definition: desfirelocation.hpp:18
DESFireKeySettings
The key settings.
Definition: desfirecommands.hpp:69
STidDESFireBaudrate
The STid DESFire baudrates.
Definition: desfireev1stidstrcommands.hpp:26
@ STID_DF_BR_106KBPS
Definition: desfireev1stidstrcommands.hpp:27
@ STID_DF_BR_424KBPS
Definition: desfireev1stidstrcommands.hpp:29
@ STID_DF_BR_212KBPS
Definition: desfireev1stidstrcommands.hpp:28
DESFireISOAlgorithm
The DESFire EV1 algorithm.
Definition: desfireev1commands.hpp:63
@ DF_ALG_2K3DES
Definition: desfireev1commands.hpp:65
DESFireKeyType
The DESFire key type.
Definition: desfirekey.hpp:33
Default STidSTR reader/card adapter.
Access rights on DESFire file.
Definition: desfirecommands.hpp:106
Card information about software and hardware version.
Definition: desfirecommands.hpp:212
Describe file setting.
Definition: desfirecommands.hpp:191