LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
logicalaccess::DESFireEV1STidSTRCommands Class Reference

The DESFire EV1 base commands class for STidSTR reader. More...

#include <desfireev1stidstrcommands.hpp>

Inheritance diagram for logicalaccess::DESFireEV1STidSTRCommands:
logicalaccess::Commands logicalaccess::DESFireEV1Commands logicalaccess::ICommands logicalaccess::ICommands

Public Member Functions

 DESFireEV1STidSTRCommands ()
 Constructor.
 
 DESFireEV1STidSTRCommands (std::string)
 
virtual ~DESFireEV1STidSTRCommands ()
 Destructor.
 
ByteVector scanDESFire () const
 Scan the RFID field for DESFire tag.
 
void releaseRFIDField () const
 Release the RFID field.
 
void changePPS (STidDESFireBaudrate readerToChipKbps, STidDESFireBaudrate chipToReaderKbps) const
 Change the communication speed between the reader and the chip.
 
unsigned int getFreeMem () override
 Get the value of available bytes.
 
std::vector< DFNamegetDFNames () override
 Get the ISO DF-Names of all active application.
 
std::vector< unsigned short > getISOFileIDs () override
 Get the ISO FID of all active files within the currently selected application.
 
virtual void erase ()
 Erase the card.
 
virtual void createApplication (unsigned int aid, DESFireKeySettings settings, unsigned char maxNbKeys)
 Create a new application.
 
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()) override
 Create a new application.
 
virtual void deleteApplication (unsigned int aid)
 Delete an application.
 
void selectApplication (unsigned int aid) override
 Select an application.
 
virtual void getKeySettings (DESFireKeySettings &settings, unsigned char &maxNbKeys)
 Get key settings on the current application.
 
void getKeySettings (DESFireKeySettings &settings, unsigned char &maxNbKeys, DESFireKeyType &keyType) override
 Get key settings on the current application.
 
ByteVector getCardUID () override
 Get a random card UID.
 
virtual void createStdDataFile (unsigned char fileno, EncryptionMode comSettings, const DESFireAccessRights &accessRights, unsigned int fileSize)
 Create a new data file in the current application.
 
void createStdDataFile (unsigned char fileno, EncryptionMode comSettings, const DESFireAccessRights &accessRights, unsigned int fileSize, unsigned short isoFID) override
 Create a new data file in the current application.
 
virtual void commitTransaction ()
 Commit the transaction.
 
virtual void abortTransaction ()
 Abort the transaction.
 
virtual void createBackupFile (unsigned char fileno, EncryptionMode comSettings, const DESFireAccessRights &accessRights, unsigned int fileSize)
 Create a new backup file in the current application.
 
void createBackupFile (unsigned char fileno, EncryptionMode comSettings, const DESFireAccessRights &accessRights, unsigned int fileSize, unsigned short isoFID) override
 Create a new backup file in the current application.
 
virtual void createValueFile (unsigned char fileno, EncryptionMode comSettings, const DESFireAccessRights &accessRights, int32_t lowerLimit, int32_t upperLimit, int32_t value, bool limitedCreditEnabled)
 Create a new value file in the current application.
 
virtual void createLinearRecordFile (unsigned char fileno, EncryptionMode comSettings, const DESFireAccessRights &accessRights, unsigned int fileSize, unsigned int maxNumberOfRecords)
 Create a new linear record file in the current application.
 
void createLinearRecordFile (unsigned char fileno, EncryptionMode comSettings, const DESFireAccessRights &accessRights, unsigned int fileSize, unsigned int maxNumberOfRecords, unsigned short isoFID) override
 Create a new linear record file in the current application.
 
virtual void createCyclicRecordFile (unsigned char fileno, EncryptionMode comSettings, const DESFireAccessRights &accessRights, unsigned int fileSize, unsigned int maxNumberOfRecords)
 Create a new cyclic record file in the current application.
 
void createCyclicRecordFile (unsigned char fileno, EncryptionMode comSettings, const DESFireAccessRights &accessRights, unsigned int fileSize, unsigned int maxNumberOfRecords, unsigned short isoFID) override
 Create a new cyclic record file in the current application.
 
virtual void loadKey (std::shared_ptr< DESFireKey > key)
 Load a key in the reader memory.
 
virtual void loadKey (ByteVector key, bool diversify, bool isVolatile)
 Load a key in the reader memory.
 
virtual void authenticate (STidKeyLocationType keylocation, unsigned char keyno, DESFireKeyType cryptoMethod, unsigned char keyindex)
 Authenticate DESFire according to the key location.
 
virtual void authenticate (unsigned char keyno)
 Authenticate, given a key number.
 
virtual void authenticate (unsigned char keyno, std::shared_ptr< DESFireKey > key)
 Authenticate a block, given a key number.
 
void authenticateISO (unsigned char keyno, DESFireISOAlgorithm algorithm=DF_ALG_2K3DES) override
 AuthenticateISO command.
 
void authenticateAES (unsigned char keyno) override
 AuthenticateAES command.
 
virtual ByteVector readData (unsigned char fileno, unsigned int offset, unsigned int length, EncryptionMode mode)
 Read data from a specific file.
 
virtual void writeData (unsigned char fileno, unsigned int offset, const ByteVector &data, EncryptionMode mode)
 Write data into a specific file.
 
virtual void credit (unsigned char fileno, unsigned int value, EncryptionMode mode)
 Credit a specific value file.
 
virtual void debit (unsigned char fileno, unsigned int value, EncryptionMode mode)
 Debit a specific value file.
 
virtual void limitedCredit (unsigned char fileno, unsigned int value, EncryptionMode mode)
 Limit credit on a specific value file.
 
virtual void writeRecord (unsigned char fileno, unsigned int offset, const ByteVector &data, EncryptionMode mode)
 Write record into a specific record file.
 
virtual ByteVector readRecords (unsigned char fileno, unsigned int offset, unsigned int length, EncryptionMode mode)
 Read record from a specific record file.
 
virtual void clearRecordFile (unsigned char fileno)
 Clear a specific record file.
 
virtual void changeFileSettings (unsigned char fileno, EncryptionMode comSettings, const DESFireAccessRights &accessRights, bool plain)
 Change file settings of a specific file in the current application.
 
virtual void deleteFile (unsigned char fileno)
 Delete a file in the current application.
 
virtual void changeKeySettings (DESFireKeySettings settings)
 Change key settings for the current application.
 
virtual void changeKey (unsigned char keyno, std::shared_ptr< DESFireKey > key)
 Change a key in the current application.
 
void changeKeyIndex (unsigned char keyno, DESFireKeyType cryptoMethod, unsigned char keyversion, unsigned char newkeyindex, unsigned char oldkeyindex) const
 Change the key indexed keyno by a new index or crypto method.
 
unsigned char getKeyVersion (unsigned char keyno) const
 Get the key version.
 
virtual void getVersion (DESFireCommands::DESFireCardVersion &dataVersion)
 Get the card version information.
 
virtual std::vector< unsigned int > getApplicationIDs ()
 Get the current application list.
 
virtual ByteVector getFileIDs ()
 Get the File IDentifiers of all active files within the currently selected application.
 
virtual void getFileSettings (unsigned char fileno, DESFireCommands::FileSetting &fileSetting)
 Get settings of a specific file in the current application.
 
virtual void getValue (unsigned char fileno, EncryptionMode mode, unsigned int &value)
 Get value from a specific value file.
 
void setConfiguration (bool formatCardEnabled, bool randomIdEnabled) override
 Set the card configuration.
 
void setConfiguration (std::shared_ptr< DESFireKey > defaultKey) override
 Set the card configuration default key. param defaultKey The new default key.
 
void setConfiguration (const ByteVector &ats) override
 Set a custom card ATS.
 
std::shared_ptr< ChipgetChip () const override
 Get the chip.
 
std::shared_ptr< ReaderCardAdaptergetReaderCardAdapter () const override
 Get the reader/card adapter.
 
std::shared_ptr< STidSTRReaderCardAdaptergetSTidSTRReaderCardAdapter () const
 Get the STidSTR reader/card adapter.
 
virtual void createApplication (std::shared_ptr< DESFireEV1Location > location, DESFireKeySettings settings, unsigned char maxNbKeys)
 Create a new 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 createStdDataFile (std::shared_ptr< DESFireEV1Location > location, const DESFireAccessRights &accessRights, unsigned int fileSize)
 Create a new data file in the current application.
 
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.
 
- Public Member Functions inherited from logicalaccess::Commands
 Commands ()=delete
 Constructor.
 
virtual ~Commands ()
 
std::shared_ptr< ChipgetChip () const override
 Get the chip.
 
virtual void setChip (std::shared_ptr< Chip > chip)
 Set the chip.
 
std::shared_ptr< ReaderCardAdaptergetReaderCardAdapter () 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.
 
- Public Member Functions inherited from logicalaccess::ICommands
virtual ~ICommands ()=default
 
virtual std::shared_ptr< ChipgetChip () const =0
 Get the chip.
 
virtual std::shared_ptr< ReaderCardAdaptergetReaderCardAdapter () const =0
 Get the reader/card adapter.
 
- Public Member Functions inherited from logicalaccess::DESFireEV1Commands
 DESFireEV1Commands ()=default
 
virtual void selectApplication (std::shared_ptr< DESFireEV1Location > location)
 Select an application.
 
virtual void createApplication (std::shared_ptr< DESFireEV1Location > location, DESFireKeySettings settings, unsigned char maxNbKeys)
 Create a new application.
 
virtual void createStdDataFile (std::shared_ptr< DESFireEV1Location > location, const DESFireAccessRights &accessRights, unsigned int fileSize)
 Create a new data file in the current application.
 
virtual unsigned int getFreeMem ()=0
 Get the value of available bytes.
 
virtual std::vector< DFNamegetDFNames ()=0
 Get the ISO DF-Names of all active application.
 
virtual std::vector< unsigned short > getISOFileIDs ()=0
 Get the ISO FID of all active files within the currently selected application.
 
virtual void selectApplication (unsigned int aid)=0
 Select an 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 getKeySettings (DESFireKeySettings &settings, unsigned char &maxNbKeys, DESFireKeyType &keyType)=0
 Get key settings on the current application.
 
virtual ByteVector getCardUID ()=0
 Get a random card UID.
 
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 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 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 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 authenticateISO (unsigned char keyno, DESFireISOAlgorithm algorithm=DF_ALG_2K3DES)=0
 AuthenticateISO command.
 
virtual void authenticateAES (unsigned char keyno)=0
 AuthenticateAES command.
 
virtual void setConfiguration (bool formatCardEnabled, bool randomIdEnabled)=0
 Read data from a specific file.
 
virtual void setConfiguration (std::shared_ptr< DESFireKey > defaultKey)=0
 Set the card configuration default key. param defaultKey The new default key.
 
virtual void setConfiguration (const ByteVector &ats)=0
 Set a custom card ATS.
 
virtual std::shared_ptr< ISO7816CommandsgetISO7816Commands () const
 

Static Public Member Functions

static std::string STidKeyLocationTypeStr (STidKeyLocationType t)
 Get the STid Key Location Type in string format.
 

Protected Attributes

unsigned int d_currentAid
 
- Protected Attributes inherited from logicalaccess::Commands
std::shared_ptr< ReaderCardAdapterd_readerCardAdapter
 The reader/card adapter.
 
std::weak_ptr< Chipd_chip
 The chip.
 
std::string d_commandtype
 The command type.
 

Additional Inherited Members

- Protected Member Functions inherited from logicalaccess::Commands
 Commands (std::string commandtype)
 Constructor.
 
- Protected Member Functions inherited from logicalaccess::DESFireEV1Commands
std::shared_ptr< DESFireEV1ChipgetDESFireEV1Chip () const
 

Detailed Description

The DESFire EV1 base commands class for STidSTR reader.

Constructor & Destructor Documentation

◆ DESFireEV1STidSTRCommands() [1/2]

logicalaccess::DESFireEV1STidSTRCommands::DESFireEV1STidSTRCommands ( )

Constructor.

◆ DESFireEV1STidSTRCommands() [2/2]

logicalaccess::DESFireEV1STidSTRCommands::DESFireEV1STidSTRCommands ( std::string  ct)
explicit

◆ ~DESFireEV1STidSTRCommands()

logicalaccess::DESFireEV1STidSTRCommands::~DESFireEV1STidSTRCommands ( )
virtual

Destructor.

Member Function Documentation

◆ abortTransaction()

void logicalaccess::DESFireEV1STidSTRCommands::abortTransaction ( )
virtual

Abort the transaction.

◆ authenticate() [1/3]

void logicalaccess::DESFireEV1STidSTRCommands::authenticate ( STidKeyLocationType  keylocation,
unsigned char  keyno,
DESFireKeyType  cryptoMethod,
unsigned char  keyindex 
)
virtual

Authenticate DESFire according to the key location.

Parameters
keylocationThe key location on reader.
keynoThe key number, previously loaded.
cryptoMethodThe cryptographic method.
keyindexThe key index (if key location is indexed).

◆ authenticate() [2/3]

void logicalaccess::DESFireEV1STidSTRCommands::authenticate ( unsigned char  keyno)
virtual

Authenticate, given a key number.

Parameters
keynoThe key number.

◆ authenticate() [3/3]

void logicalaccess::DESFireEV1STidSTRCommands::authenticate ( unsigned char  keyno,
std::shared_ptr< DESFireKey key 
)
virtual

Authenticate a block, given a key number.

Parameters
keynoThe key number.
keyThe key.

◆ authenticateAES()

void logicalaccess::DESFireEV1STidSTRCommands::authenticateAES ( unsigned char  keyno)
overridevirtual

AuthenticateAES command.

Parameters
keynoThe key number.

Implements logicalaccess::DESFireEV1Commands.

◆ authenticateISO()

void logicalaccess::DESFireEV1STidSTRCommands::authenticateISO ( unsigned char  keyno,
DESFireISOAlgorithm  algorithm = DF_ALG_2K3DES 
)
overridevirtual

AuthenticateISO command.

Parameters
keynoThe key number.
algorithmThe ISO algorithm to use for authentication.

Implements logicalaccess::DESFireEV1Commands.

◆ changeFileSettings()

void logicalaccess::DESFireEV1STidSTRCommands::changeFileSettings ( unsigned char  fileno,
EncryptionMode  comSettings,
const DESFireAccessRights accessRights,
bool  plain 
)
virtual

Change file settings of a specific file in the current application.

Parameters
filenoThe file number
comSettingsThe file communication setting
accessRightsThe file access rights
plainCommunication is currently in plain data.

◆ changeKey()

void logicalaccess::DESFireEV1STidSTRCommands::changeKey ( unsigned char  keyno,
std::shared_ptr< DESFireKey key 
)
virtual

Change a key in the current application.

Parameters
keynoThe key number to change
keyThe new key

◆ changeKeyIndex()

void logicalaccess::DESFireEV1STidSTRCommands::changeKeyIndex ( unsigned char  keyno,
DESFireKeyType  cryptoMethod,
unsigned char  keyversion,
unsigned char  newkeyindex,
unsigned char  oldkeyindex 
) const

Change the key indexed keyno by a new index or crypto method.

Parameters
keynoThe key number into the application.
cryptoMethodThe cryptographic method.
keyversionThe key version (AES only).
newkeyindexThe new key index.
oldkeyindexThe old key index.

◆ changeKeySettings()

void logicalaccess::DESFireEV1STidSTRCommands::changeKeySettings ( DESFireKeySettings  settings)
virtual

Change key settings for the current application.

Parameters
settingsThe new key settings

◆ changePPS()

void logicalaccess::DESFireEV1STidSTRCommands::changePPS ( STidDESFireBaudrate  readerToChipKbps,
STidDESFireBaudrate  chipToReaderKbps 
) const

Change the communication speed between the reader and the chip.

Parameters
readerToChipKbpsThe reader to chip kbps to use.
chipToReaderKbpsThe chip to reader kbps to use.

◆ clearRecordFile()

void logicalaccess::DESFireEV1STidSTRCommands::clearRecordFile ( unsigned char  fileno)
virtual

Clear a specific record file.

Parameters
filenoThe file number.

◆ commitTransaction()

void logicalaccess::DESFireEV1STidSTRCommands::commitTransaction ( )
virtual

Commit the transaction.

◆ createApplication() [1/4]

void logicalaccess::DESFireEV1Commands::createApplication ( std::shared_ptr< DESFireEV1Location location,
DESFireKeySettings  settings,
unsigned char  maxNbKeys 
)
virtual

Create a new application.

Parameters
locationThe DESFire location
settingsKey settings
maxNbKeysMaximum number of keys

Reimplemented from logicalaccess::DESFireEV1Commands.

◆ createApplication() [2/4]

void logicalaccess::DESFireEV1STidSTRCommands::createApplication ( unsigned int  aid,
DESFireKeySettings  settings,
unsigned char  maxNbKeys 
)
virtual

Create a new application.

Parameters
aidThe Application ID to create
settingsKey settings
maxNbKeysMaximum number of keys

◆ createApplication() [3/4]

void logicalaccess::DESFireEV1STidSTRCommands::createApplication ( unsigned int  aid,
DESFireKeySettings  settings,
unsigned char  maxNbKeys,
DESFireKeyType  cryptoMethod,
FidSupport  fidSupported = FIDS_NO_ISO_FID,
unsigned short  isoFID = 0x00,
ByteVector  isoDFName = ByteVector() 
)
overridevirtual

Create a new application.

Parameters
aidThe Application ID to create
settingsKey settings
maxNbKeysMaximum number of keys

Implements logicalaccess::DESFireEV1Commands.

◆ createApplication() [4/4]

virtual void logicalaccess::DESFireEV1Commands::createApplication ( unsigned int  aid,
DESFireKeySettings  settings,
unsigned char  maxNbKeys,
DESFireKeyType  cryptoMethod,
FidSupport  fidSupported = FIDS_NO_ISO_FID,
unsigned short  isoFID = 0x00,
ByteVector  isoDFName = ByteVector() 
)
virtual

Create a new application.

Parameters
aidThe Application ID to create
settingsKey settings
maxNbKeysMaximum number of keys

Implements logicalaccess::DESFireEV1Commands.

◆ createBackupFile() [1/2]

void logicalaccess::DESFireEV1STidSTRCommands::createBackupFile ( unsigned char  fileno,
EncryptionMode  comSettings,
const DESFireAccessRights accessRights,
unsigned int  fileSize 
)
virtual

Create a new backup file in the current application.

Parameters
filenoThe new file number
comSettingsThe file communication setting
accessRightsThe file access rights
fileSizeThe file size.

◆ createBackupFile() [2/2]

void logicalaccess::DESFireEV1STidSTRCommands::createBackupFile ( unsigned char  fileno,
EncryptionMode  comSettings,
const DESFireAccessRights accessRights,
unsigned int  fileSize,
unsigned short  isoFID 
)
overridevirtual

Create a new backup file in the current application.

Parameters
filenoThe new file number
comSettingsThe file communication setting
accessRightsThe file access rights
fileSizeThe file size (in bytes).

Implements logicalaccess::DESFireEV1Commands.

◆ createCyclicRecordFile() [1/2]

void logicalaccess::DESFireEV1STidSTRCommands::createCyclicRecordFile ( unsigned char  fileno,
EncryptionMode  comSettings,
const DESFireAccessRights accessRights,
unsigned int  fileSize,
unsigned int  maxNumberOfRecords 
)
virtual

Create a new cyclic record file in the current application.

Parameters
filenoThe new file number
comSettingsThe file communication setting
accessRightsThe file access rights
fileSizeThe file size.
maxNumberOfRecordsMax number of records in the file.

◆ createCyclicRecordFile() [2/2]

void logicalaccess::DESFireEV1STidSTRCommands::createCyclicRecordFile ( unsigned char  fileno,
EncryptionMode  comSettings,
const DESFireAccessRights accessRights,
unsigned int  fileSize,
unsigned int  maxNumberOfRecords,
unsigned short  isoFID 
)
overridevirtual

Create a new cyclic record file in the current application.

Parameters
filenoThe new file number
comSettingsThe file communication setting
accessRightsThe file access rights
fileSizeThe file size (in bytes).
maxNumberOfRecordsMax number of records in the file.

Implements logicalaccess::DESFireEV1Commands.

◆ createLinearRecordFile() [1/2]

void logicalaccess::DESFireEV1STidSTRCommands::createLinearRecordFile ( unsigned char  fileno,
EncryptionMode  comSettings,
const DESFireAccessRights accessRights,
unsigned int  fileSize,
unsigned int  maxNumberOfRecords 
)
virtual

Create a new linear record file in the current application.

Parameters
filenoThe new file number
comSettingsThe file communication setting
accessRightsThe file access rights
fileSizeThe file size.
maxNumberOfRecordsMax number of records in the file.

◆ createLinearRecordFile() [2/2]

void logicalaccess::DESFireEV1STidSTRCommands::createLinearRecordFile ( unsigned char  fileno,
EncryptionMode  comSettings,
const DESFireAccessRights accessRights,
unsigned int  fileSize,
unsigned int  maxNumberOfRecords,
unsigned short  isoFID 
)
overridevirtual

Create a new linear record file in the current application.

Parameters
filenoThe new file number
comSettingsThe file communication setting
accessRightsThe file access rights
fileSizeThe file size (in bytes).
maxNumberOfRecordsMax number of records in the file.
Returns
True on success, false otherwise.

Implements logicalaccess::DESFireEV1Commands.

◆ createStdDataFile() [1/4]

void logicalaccess::DESFireEV1Commands::createStdDataFile ( std::shared_ptr< DESFireEV1Location location,
const DESFireAccessRights accessRights,
unsigned int  fileSize 
)
virtual

Create a new data file in the current application.

Parameters
locationThe DESFire location
accessRightsThe file access rights
fileSizeThe file size.

Reimplemented from logicalaccess::DESFireEV1Commands.

◆ createStdDataFile() [2/4]

void logicalaccess::DESFireEV1STidSTRCommands::createStdDataFile ( unsigned char  fileno,
EncryptionMode  comSettings,
const DESFireAccessRights accessRights,
unsigned int  fileSize 
)
virtual

Create a new data file in the current application.

Parameters
filenoThe new file number
comSettingsThe file communication setting
accessRightsThe file access rights
fileSizeThe file size.

◆ createStdDataFile() [3/4]

void logicalaccess::DESFireEV1STidSTRCommands::createStdDataFile ( unsigned char  fileno,
EncryptionMode  comSettings,
const DESFireAccessRights accessRights,
unsigned int  fileSize,
unsigned short  isoFID 
)
overridevirtual

Create a new data file in the current application.

Parameters
filenoThe new file number
comSettingsThe file communication setting
accessRightsThe file access rights
fileSizeThe file size (in bytes).

Implements logicalaccess::DESFireEV1Commands.

◆ createStdDataFile() [4/4]

virtual void logicalaccess::DESFireEV1Commands::createStdDataFile ( unsigned char  fileno,
EncryptionMode  comSettings,
const DESFireAccessRights accessRights,
unsigned int  fileSize,
unsigned short  isoFID = 0x00 
)
virtual

Create a new data file in the current application.

Parameters
filenoThe new file number
comSettingsThe file communication setting
accessRightsThe file access rights
fileSizeThe file size (in bytes).

Implements logicalaccess::DESFireEV1Commands.

◆ createValueFile()

void logicalaccess::DESFireEV1STidSTRCommands::createValueFile ( unsigned char  fileno,
EncryptionMode  comSettings,
const DESFireAccessRights accessRights,
int32_t  lowerLimit,
int32_t  upperLimit,
int32_t  value,
bool  limitedCreditEnabled 
)
virtual

Create a new value file in the current application.

Parameters
filenoThe new file number
comSettingsThe file communication setting
accessRightsThe file access rights
lowerLimitThe file size (in bytes)
upperLimitThe file size (in bytes)
valueThe default value
limitedCreditEnabledSet if the limited credit is enabled

◆ credit()

void logicalaccess::DESFireEV1STidSTRCommands::credit ( unsigned char  fileno,
unsigned int  value,
EncryptionMode  mode 
)
virtual

Credit a specific value file.

Parameters
filenoThe file number
valueThe value to credit
modeThe communication mode

◆ debit()

void logicalaccess::DESFireEV1STidSTRCommands::debit ( unsigned char  fileno,
unsigned int  value,
EncryptionMode  mode 
)
virtual

Debit a specific value file.

Parameters
filenoThe file number
valueThe value to debit
modeThe communication mode

◆ deleteApplication()

void logicalaccess::DESFireEV1STidSTRCommands::deleteApplication ( unsigned int  aid)
virtual

Delete an application.

Parameters
aidThe Application ID to delete

◆ deleteFile()

void logicalaccess::DESFireEV1STidSTRCommands::deleteFile ( unsigned char  fileno)
virtual

Delete a file in the current application.

Parameters
filenoThe file number to delete

◆ erase()

void logicalaccess::DESFireEV1STidSTRCommands::erase ( )
virtual

Erase the card.

◆ getApplicationIDs()

std::vector< unsigned int > logicalaccess::DESFireEV1STidSTRCommands::getApplicationIDs ( )
virtual

Get the current application list.

Returns
The application list.

◆ getCardUID()

ByteVector logicalaccess::DESFireEV1STidSTRCommands::getCardUID ( )
overridevirtual

Get a random card UID.

Returns
The card UID.

Implements logicalaccess::DESFireEV1Commands.

◆ getChip()

std::shared_ptr< Chip > logicalaccess::DESFireEV1STidSTRCommands::getChip ( ) const
inlineoverridevirtual

Get the chip.

Returns
The chip.

Reimplemented from logicalaccess::Commands.

◆ getDFNames()

std::vector< DFName > logicalaccess::DESFireEV1STidSTRCommands::getDFNames ( )
overridevirtual

Get the ISO DF-Names of all active application.

Returns
The DF-Names list.

Implements logicalaccess::DESFireEV1Commands.

◆ getFileIDs()

ByteVector logicalaccess::DESFireEV1STidSTRCommands::getFileIDs ( )
virtual

Get the File IDentifiers of all active files within the currently selected application.

Returns
The file ID list.

◆ getFileSettings()

void logicalaccess::DESFireEV1STidSTRCommands::getFileSettings ( unsigned char  fileno,
DESFireCommands::FileSetting fileSetting 
)
virtual

Get settings of a specific file in the current application.

Parameters
filenoThe file number
fileSettingThe file setting

◆ getFreeMem()

unsigned int logicalaccess::DESFireEV1STidSTRCommands::getFreeMem ( )
overridevirtual

Get the value of available bytes.

Returns
The available memory in bytes.

Implements logicalaccess::DESFireEV1Commands.

◆ getISOFileIDs()

std::vector< unsigned short > logicalaccess::DESFireEV1STidSTRCommands::getISOFileIDs ( )
overridevirtual

Get the ISO FID of all active files within the currently selected application.

Returns
The ISO FID list.

Implements logicalaccess::DESFireEV1Commands.

◆ getKeySettings() [1/2]

void logicalaccess::DESFireEV1STidSTRCommands::getKeySettings ( DESFireKeySettings settings,
unsigned char &  maxNbKeys 
)
virtual

Get key settings on the current application.

Parameters
settingsKey settings
maxNbKeysMaximum number of keys

◆ getKeySettings() [2/2]

void logicalaccess::DESFireEV1STidSTRCommands::getKeySettings ( DESFireKeySettings settings,
unsigned char &  maxNbKeys,
DESFireKeyType keyType 
)
overridevirtual

Get key settings on the current application.

Parameters
settingsKey settings
maxNbKeysMaximum number of keys
keyTypeThe key type

Implements logicalaccess::DESFireEV1Commands.

◆ getKeyVersion()

unsigned char logicalaccess::DESFireEV1STidSTRCommands::getKeyVersion ( unsigned char  keyno) const

Get the key version.

Parameters
keynoThe key number on the application.
Returns
The key version.

◆ getReaderCardAdapter()

std::shared_ptr< ReaderCardAdapter > logicalaccess::DESFireEV1STidSTRCommands::getReaderCardAdapter ( ) const
inlineoverridevirtual

Get the reader/card adapter.

Returns
The reader/card adapter.

Reimplemented from logicalaccess::Commands.

◆ getSTidSTRReaderCardAdapter()

std::shared_ptr< STidSTRReaderCardAdapter > logicalaccess::DESFireEV1STidSTRCommands::getSTidSTRReaderCardAdapter ( ) const
inline

Get the STidSTR reader/card adapter.

Returns
The STidSTR reader/card adapter.

◆ getValue()

void logicalaccess::DESFireEV1STidSTRCommands::getValue ( unsigned char  fileno,
EncryptionMode  mode,
unsigned int &  value 
)
virtual

Get value from a specific value file.

Parameters
filenoThe file number
modeThe communication mode
valueThe value stored in the card

◆ getVersion()

void logicalaccess::DESFireEV1STidSTRCommands::getVersion ( DESFireCommands::DESFireCardVersion dataVersion)
virtual

Get the card version information.

Parameters
dataVersionThe card version information structure that will be filled

◆ limitedCredit()

void logicalaccess::DESFireEV1STidSTRCommands::limitedCredit ( unsigned char  fileno,
unsigned int  value,
EncryptionMode  mode 
)
virtual

Limit credit on a specific value file.

Parameters
handleThe SCardHandle
filenoThe file number
valueThe value to limit credit
modeThe communication mode
Returns
True on success, false otherwise.

◆ loadKey() [1/2]

void logicalaccess::DESFireEV1STidSTRCommands::loadKey ( ByteVector  key,
bool  diversify,
bool  isVolatile 
)
virtual

Load a key in the reader memory.

Parameters
keyThe key buffer to load.
diversifyTrue to diversify the key, false otherwise.
isVolatileTrue to store it in RAM, false to store it in EEPROM.

◆ loadKey() [2/2]

void logicalaccess::DESFireEV1STidSTRCommands::loadKey ( std::shared_ptr< DESFireKey key)
virtual

Load a key in the reader memory.

Parameters
keyThe key object to load.

◆ readData()

ByteVector logicalaccess::DESFireEV1STidSTRCommands::readData ( unsigned char  fileno,
unsigned int  offset,
unsigned int  length,
EncryptionMode  mode 
)
virtual

Read data from a specific file.

Parameters
filenoThe file number
offsetThe byte offset
lengthThe data length to read
modeThe communication mode
Returns
The bytes readed.

◆ readRecords()

ByteVector logicalaccess::DESFireEV1STidSTRCommands::readRecords ( unsigned char  fileno,
unsigned int  offset,
unsigned int  length,
EncryptionMode  mode 
)
virtual

Read record from a specific record file.

Parameters
filenoThe file number
offsetThe byte offset
lengthThe length to read
dataThe data buffer
modeThe communication mode
Returns
The number of bytes read.

◆ releaseRFIDField()

void logicalaccess::DESFireEV1STidSTRCommands::releaseRFIDField ( ) const

Release the RFID field.

◆ scanDESFire()

ByteVector logicalaccess::DESFireEV1STidSTRCommands::scanDESFire ( ) const

Scan the RFID field for DESFire tag.

Returns
The tag uid if present.

◆ selectApplication()

void logicalaccess::DESFireEV1STidSTRCommands::selectApplication ( unsigned int  aid)
overridevirtual

Select an application.

Parameters
aidThe Application ID

Implements logicalaccess::DESFireEV1Commands.

◆ setConfiguration() [1/3]

void logicalaccess::DESFireEV1STidSTRCommands::setConfiguration ( bool  formatCardEnabled,
bool  randomIdEnabled 
)
overridevirtual

Set the card configuration.

Parameters
formatCardEnabledIf true, the format card command is enabled.
randomIdEnabledIf true, the CSN is random.

Implements logicalaccess::DESFireEV1Commands.

◆ setConfiguration() [2/3]

void logicalaccess::DESFireEV1STidSTRCommands::setConfiguration ( const ByteVector ats)
overridevirtual

Set a custom card ATS.

Parameters
atsThe new card ATS.

Implements logicalaccess::DESFireEV1Commands.

◆ setConfiguration() [3/3]

void logicalaccess::DESFireEV1STidSTRCommands::setConfiguration ( std::shared_ptr< DESFireKey defaultKey)
overridevirtual

Set the card configuration default key. param defaultKey The new default key.

Implements logicalaccess::DESFireEV1Commands.

◆ STidKeyLocationTypeStr()

std::string logicalaccess::DESFireEV1STidSTRCommands::STidKeyLocationTypeStr ( STidKeyLocationType  t)
static

Get the STid Key Location Type in string format.

Returns
The key location type in string.

◆ writeData()

void logicalaccess::DESFireEV1STidSTRCommands::writeData ( unsigned char  fileno,
unsigned int  offset,
const ByteVector data,
EncryptionMode  mode 
)
virtual

Write data into a specific file.

Parameters
filenoThe file number
offsetThe byte offset
dataThe data buffer
modeThe communication mode

◆ writeRecord()

void logicalaccess::DESFireEV1STidSTRCommands::writeRecord ( unsigned char  fileno,
unsigned int  offset,
const ByteVector data,
EncryptionMode  mode 
)
virtual

Write record into a specific record file.

Parameters
filenoThe file number
offsetThe byte offset
lengthThe length to write
dataThe data buffer
modeThe communication mode

Member Data Documentation

◆ d_currentAid

unsigned int logicalaccess::DESFireEV1STidSTRCommands::d_currentAid
protected

The documentation for this class was generated from the following files: