uFCoder 2.62
Loading...
Searching...
No Matches
Mifare DESFire Light specific commands

Functions specific to Mifare DESFire® Light cards. More...

Functions

UFR_STATUS DL_API desfire_check_clear_record_transaction_mac (uint8_t file_no, uint32_t trans_mac_counter, IN uint8_t *uid, IN uint8_t *trans_mac_key, IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id)
 From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. Helper function for check transaction MAC in clear record operation. Function also returns decrypted Previous Reader ID. Users must enter file number, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC.
 
UFR_STATUS DL_API desfire_check_write_record_transaction_mac (uint8_t file_no, uint32_t offset, uint32_t data_len, IN uint8_t *data, uint32_t trans_mac_counter, IN uint8_t *uid, IN uint8_t *trans_mac_key, IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id)
 
UFR_STATUS DL_API dfl_change_file_settings (uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no)
 From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. Function changes file settings.
 
UFR_STATUS DL_API dfl_change_file_settings_pk (IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no)
 From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. Function changes file settings.
 
UFR_STATUS DL_API dfl_change_tmc_file_settings (uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, uint8_t new_communication_mode, uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, uint8_t ex_unauth_operation, uint8_t tmc_limit_conf, uint32_t tmc_limit)
 Function changes file settings of the Transaction MAC file.
 
UFR_STATUS DL_API dfl_check_credit_value_transaction_mac (uint8_t file_no, uint32_t value, uint32_t trans_mac_counter, IN uint8_t *uid, IN uint8_t *trans_mac_key, IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id)
 From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. Helper function for check transaction MAC in credit value operation. Function also returns decrypted Previous Reader ID. User must enter file number, value of credit, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC.
 
UFR_STATUS DL_API dfl_check_debit_value_transaction_mac (uint8_t file_no, uint32_t value, uint32_t trans_mac_counter, IN uint8_t *uid, IN uint8_t *trans_mac_key, IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id)
 From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. Helper function for check transaction MAC in debit value operation. Function also returns decrypted Previous Reader ID. User must enter file number, value of credit, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC.
 
UFR_STATUS DL_API dfl_check_write_record_transaction_mac (uint8_t file_no, uint32_t offset, uint32_t data_len, IN uint8_t *data, uint32_t trans_mac_counter, IN uint8_t *uid, IN uint8_t *trans_mac_key, IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id)
 From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. Helper function for check transaction MAC in write record operation. Function also returns decrypted Previous Reader ID. User must enter file number, data offset, data length, array of data, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC.
 
UFR_STATUS DL_API dfl_delete_tmc_file (uint8_t aes_key_no, uint8_t file_no)
 From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. Function delete transaction MAC file. NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application.
 
UFR_STATUS DL_API dfl_delete_tmc_file_pk (IN uint8_t *aes_key_ext, uint8_t file_no)
 From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. Function delete transaction MAC file. NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application.
 
UFR_STATUS DL_API dfl_get_file_settings (uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, VAR uint32_t *file_size, VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, VAR uint8_t *free_get_value, VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, VAR uint8_t *ex_unauth_operation, VAR uint8_t *tmc_limit_conf, VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, VAR uint32_t *tmc_limit)
 From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command.
 

Detailed Description

Functions specific to Mifare DESFire® Light cards.

Function Documentation

◆ desfire_check_clear_record_transaction_mac()

UFR_STATUS DL_API desfire_check_clear_record_transaction_mac ( uint8_t file_no,
uint32_t trans_mac_counter,
IN uint8_t * uid,
IN uint8_t * trans_mac_key,
IN uint8_t * reader_id,
IN uint8_t * prev_enc_reader_id,
IN uint8_t * trans_mac_value,
OUT uint8_t * prev_reader_id )

From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. Helper function for check transaction MAC in clear record operation. Function also returns decrypted Previous Reader ID. Users must enter file number, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC.

Parameters
file_nofile number
trans_mac_countertransaction MAC counter
uidpointer to 7 bytes array containing card UID
trans_mac_keypointer to 16 bytes array containing Transaction MAC key
reader_idpointer to 16 bytes array containing Reader ID
prev_enc_reader_idpointer to 16 bytes array containing Previous Encrypted Reader ID
trans_mac_valuepointer to 8 bytes array containing Transaction MAC
prev_reader_idpointer to 16 bytes array containing Previous Reader ID
Returns
Operation status

◆ desfire_check_write_record_transaction_mac()

UFR_STATUS DL_API desfire_check_write_record_transaction_mac ( uint8_t file_no,
uint32_t offset,
uint32_t data_len,
IN uint8_t * data,
uint32_t trans_mac_counter,
IN uint8_t * uid,
IN uint8_t * trans_mac_key,
IN uint8_t * reader_id,
IN uint8_t * prev_enc_reader_id,
IN uint8_t * trans_mac_value,
OUT uint8_t * prev_reader_id )

From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. Helper function for check transaction MAC in write record operation. Function also returns decrypted Previous Reader ID. User must enter file number, data offset, data length, array of data, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC.

Parameters
file_nofile number
offsetdata offset
data_lenlength of array of data
datapointer to data array
trans_mac_countertransaction MAC counter
uidpointer to 7 bytes array containing card UID
trans_mac_keypointer to 16 bytes array containing Transaction MAC key
reader_idpointer to 16 bytes array containing Reader ID
prev_enc_reader_idpointer to 16 bytes array containing Previous Encrypted Reader ID
trans_mac_valuepointer to 8 bytes array containing Transaction MAC
prev_reader_idpointer to 16 bytes array containing Previous Reader ID
Returns
Operation status

◆ dfl_change_file_settings()

UFR_STATUS DL_API dfl_change_file_settings ( uint8_t aes_key_no,
uint8_t file_no,
uint8_t key_no,
uint8_t curr_communication_mode,
uint8_t new_communication_mode,
uint8_t read_key_no,
uint8_t write_key_no,
uint8_t read_write_key_no,
uint8_t change_key_no )

From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. Function changes file settings.

Parameters
aes_key_noreader key number of AES key (0 - 15)
file_nofile number 0, 1, 3, 4, 15 or 31
key_nocurrnent change key no
curr_communication_modecurrent communication mode 0 - plain, 1 - MACed, 3 - enciphered
new_communication_modenew communication mode 0 - plain, 1 - MACed, 3 - enciphered
read_key_noread key number (0 - 4)
write_key_nowrite key number (0 - 4)
read_write_key_noread write key number (0 - 4)
change_key_nochange key number (0 - 4)
Returns
Operation status

◆ dfl_change_file_settings_pk()

UFR_STATUS DL_API dfl_change_file_settings_pk ( IN uint8_t * aes_key_ext,
uint8_t file_no,
uint8_t key_no,
uint8_t curr_communication_mode,
uint8_t new_communication_mode,
uint8_t read_key_no,
uint8_t write_key_no,
uint8_t read_write_key_no,
uint8_t change_key_no )

From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. Function changes file settings.

Parameters
aes_key_extpointer to array contained AES key aes_key_no reader key number of AES key (0 - 15)
file_nofile number 0, 1, 3, 4, 15 or 31 curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered read_key_no read key number (0 - 4) write_key_no write key number (0 - 4) read_write_key_no read write key number (0 - 4) change_key_no change key number (0 - 4)
key_noDESCRIPTION
curr_communication_modecurrent communication mode 0 - plain, 1 - MACed, 3 - enciphered
new_communication_modenew communication mode 0 - plain, 1 - MACed, 3 - enciphered
read_key_noread key number (0 - 4)
write_key_nowrite key number (0 - 4)
read_write_key_noread write key number (0 - 4)
change_key_nochange key number (0 - 4)
Returns
Operation status

◆ dfl_change_tmc_file_settings()

UFR_STATUS DL_API dfl_change_tmc_file_settings ( uint8_t aes_key_no,
uint8_t file_no,
uint8_t key_no,
uint8_t curr_communication_mode,
uint8_t new_communication_mode,
uint8_t read_key_no,
uint8_t commit_reader_id_key_no,
uint8_t change_key_no,
uint8_t ex_unauth_operation,
uint8_t tmc_limit_conf,
uint32_t tmc_limit )

Function changes file settings of the Transaction MAC file.

Parameters
aes_key_noaes_key_no
file_nofile_no
key_nokey_no
curr_communication_modecurr_communication_mode
new_communication_modenew_communication_mode
read_key_noread_key_no
commit_reader_id_key_nocommit_reader_id_key_no
change_key_nochange_key_no
ex_unauth_operationex_unauth_operation
tmc_limit_conftmc_limit_conf
tmc_limittmc_limit
Returns
Operation status

◆ dfl_check_credit_value_transaction_mac()

UFR_STATUS DL_API dfl_check_credit_value_transaction_mac ( uint8_t file_no,
uint32_t value,
uint32_t trans_mac_counter,
IN uint8_t * uid,
IN uint8_t * trans_mac_key,
IN uint8_t * reader_id,
IN uint8_t * prev_enc_reader_id,
IN uint8_t * trans_mac_value,
OUT uint8_t * prev_reader_id )

From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. Helper function for check transaction MAC in credit value operation. Function also returns decrypted Previous Reader ID. User must enter file number, value of credit, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC.

Parameters
file_nofile number
valuevalue of credit
trans_mac_countertransaction MAC counter uid pointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID
uidpointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID
trans_mac_keypointer to 16 bytes array containing Transaction MAC key
reader_idpointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID
prev_enc_reader_idpointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID
trans_mac_valuepointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID
prev_reader_idpointer to 16 bytes array containing Previous Reader ID
Returns
Operation status

◆ dfl_check_debit_value_transaction_mac()

UFR_STATUS DL_API dfl_check_debit_value_transaction_mac ( uint8_t file_no,
uint32_t value,
uint32_t trans_mac_counter,
IN uint8_t * uid,
IN uint8_t * trans_mac_key,
IN uint8_t * reader_id,
IN uint8_t * prev_enc_reader_id,
IN uint8_t * trans_mac_value,
OUT uint8_t * prev_reader_id )

From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. Helper function for check transaction MAC in debit value operation. Function also returns decrypted Previous Reader ID. User must enter file number, value of credit, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC.

Parameters
file_nofile number
valuevalue of debit
trans_mac_countertransaction MAC counter uid pointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID
uidpointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID
trans_mac_keypointer to 16 bytes array containing Transaction MAC key
reader_idpointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID
prev_enc_reader_idpointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID
trans_mac_valuepointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID
prev_reader_idpointer to 16 bytes array containing Previous Reader ID
Returns
Operation status

◆ dfl_check_write_record_transaction_mac()

UFR_STATUS DL_API dfl_check_write_record_transaction_mac ( uint8_t file_no,
uint32_t offset,
uint32_t data_len,
IN uint8_t * data,
uint32_t trans_mac_counter,
IN uint8_t * uid,
IN uint8_t * trans_mac_key,
IN uint8_t * reader_id,
IN uint8_t * prev_enc_reader_id,
IN uint8_t * trans_mac_value,
OUT uint8_t * prev_reader_id )

From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. Helper function for check transaction MAC in write record operation. Function also returns decrypted Previous Reader ID. User must enter file number, data offset, data length, array of data, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC.

Parameters
file_nofile number
offsetdata offset
data_lenlength of array of data
datapointer to data array
trans_mac_countertransaction MAC counter
uidpointer to 7 bytes array containing card UID
trans_mac_keypointer to 16 bytes array containing Transaction MAC key
reader_idpointer to 16 bytes array containing Reader ID
prev_enc_reader_idpointer to 16 bytes array containing Previous Encrypted Reader ID
trans_mac_valuepointer to 8 bytes array containing Transaction MAC
prev_reader_idpointer to 16 bytes array containing Previous Reader ID
Returns
Operation status

◆ dfl_delete_tmc_file()

UFR_STATUS DL_API dfl_delete_tmc_file ( uint8_t aes_key_no,
uint8_t file_no )

From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. Function delete transaction MAC file. NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application.

Parameters
aes_key_noreader key number of AES key (0 - 15)
file_nofile number
Returns
Operation status

◆ dfl_delete_tmc_file_pk()

UFR_STATUS DL_API dfl_delete_tmc_file_pk ( IN uint8_t * aes_key_ext,
uint8_t file_no )

From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. Function delete transaction MAC file. NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application.

Parameters
aes_key_extpointer to array contained AES key aes_key_no reader key number of AES key (0 - 15)
file_nofile number
Returns
Operation status

◆ dfl_get_file_settings()

UFR_STATUS DL_API dfl_get_file_settings ( uint8_t file_no,
VAR uint8_t * file_type,
VAR uint8_t * communication_mode,
VAR uint8_t * read_key_no,
VAR uint8_t * write_key_no,
VAR uint8_t * read_write_key_no,
VAR uint8_t * change_key_no,
VAR uint32_t * file_size,
VAR int32_t * lower_limit,
VAR int32_t * upper_limit,
VAR uint32_t * limited_credit_value,
VAR uint8_t * limited_credit_enable,
VAR uint8_t * free_get_value,
VAR uint32_t * record_size,
VAR uint32_t * max_number_of_rec,
VAR uint32_t * curr_number_of_rec,
VAR uint8_t * ex_unauth_operation,
VAR uint8_t * tmc_limit_conf,
VAR uint8_t * tm_key_type,
VAR uint8_t * tm_key_version,
VAR uint32_t * tmc_limit )

From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command.

Parameters
file_nofile number 0, 1, 3, 4, 15 or 31
file_typefile type 0 - standard data file, 2 - value file, 4 - cyclic record file, 5 - transaction MAC file
communication_modecommunication mode 0 - plain, 1 - MACed, 3 - enciphered
read_key_noread key number (0 - 4)
write_key_nowrite key number (0 - 4)
read_write_key_noread write key number (0 - 4)
change_key_nochange key number (0 - 4)
file_sizestandard data file size
lower_limitvalue file lower limit
upper_limitvalue file upper limit
limited_credit_valuevalue file limited credit value
limited_credit_enablevalue file limited credit enable (0 - disabled, 1 - enabled)
free_get_valuevalue file get value without authentication (0 - disabled, 1 - enabled)
record_sizecyclic record file size of record
max_number_of_reccyclic record file maximal number of record
curr_number_of_reccyclic record file number of used record
ex_unauth_operationTMC file exclude unauthorized operation
tmc_limit_confTMC file limit configuration
tm_key_typeTMC file key type AES
tm_key_versionTMC key version
tmc_limitTMC file counter limit
Returns
Operation status