uFCoder 2.62
Loading...
Searching...
No Matches
NT4H (Type 4) specific commands

Functions specific to NT4H (Type 4) chips (e.g NTAG424DNA, with TagTamper support) More...

Functions

UFR_STATUS DL_API nt4h_change_key (uint8_t auth_key_no, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key)
 Function changes AES key.
 
UFR_STATUS DL_API nt4h_change_key_pk (IN uint8_t *auth_key, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key)
 Provided Key mode (PK) Function changes AES key.
 
UFR_STATUS DL_API nt4h_change_sdm_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, uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit)
 Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file.
 
UFR_STATUS DL_API nt4h_change_sdm_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, uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit)
 Provided Key mode (PK) Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file.
 
UFR_STATUS DL_API nt4h_change_standard_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)
 The function changes the access parameters of an existing standard data file.
 
UFR_STATUS DL_API nt4h_change_standard_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)
 Provided Key mode (PK) The function changes the access parameters of an existing standard data file.
 
UFR_STATUS DL_API nt4h_check_sdm_mac (uint32_t smd_read_counter, IN uint8_t *uid, IN uint8_t *auth_key, IN uint8_t *mac_in_data, IN uint8_t mac_in_len, IN uint8_t *sdm_mac)
 Helper function for the MAC of SDM checking.
 
UFR_STATUS DL_API nt4h_decrypt_picc_data (IN uint8_t *picc_data, IN uint8_t *auth_key, IN uint8_t *picc_data_tag, IN uint8_t *uid, IN uint32_t *smd_read_cnt)
 Helper function for decryption of encrypted PICC data.
 
UFR_STATUS DL_API nt4h_decrypt_sdm_enc_file_data (uint32_t smd_read_counter, IN uint8_t *uid, IN uint8_t *auth_key, IN uint8_t *enc_file_data, IN uint8_t enc_file_data_len)
 Helper function for decryption of encrypted file data.
 
UFR_STATUS DL_API nt4h_enable_tt (uint8_t aes_key_no, uint8_t tt_status_key_no)
 NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. Function enabling tag tamper feature. Authentication with application master key (key number 0) required. Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled.
 
UFR_STATUS DL_API nt4h_enable_tt_pk (IN uint8_t *aes_key_ext, uint8_t tt_status_key_no)
 Provided Key mode (PK) NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. Function enabling tag tamper feature. Authentication with application master key (key number 0) required. Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled.
 
UFR_STATUS DL_API nt4h_get_file_settings (uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, 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 uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit)
 Function returns file settings.
 
UFR_STATUS DL_API nt4h_get_sdm_ctr (uint8_t auth_key_no, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr)
 Function supports retrieving of the current values of SDM reading counter.
 
UFR_STATUS DL_API nt4h_get_sdm_ctr_no_auth (uint8_t file_no, VAR uint32_t *sdm_read_ctr)
 No authentication. Function supports retrieving of the current values of SDM reading counter.
 
UFR_STATUS DL_API nt4h_get_sdm_ctr_pk (IN uint8_t *auth_key, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr)
 Provided Key mode (PK) Function supports retrieving of the current values of SDM reading counter.
 
UFR_STATUS DL_API nt4h_get_tt_status (uint8_t aes_key_no, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status)
 NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. Function supports retrieving of the permanent and current Tag Tamper Status.
 
UFR_STATUS DL_API nt4h_get_tt_status_no_auth (VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status)
 No authentication NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. Function supports retrieving of the permanent and current Tag Tamper Status.
 
UFR_STATUS DL_API nt4h_get_uid (uint8_t auth_key_no, uint8_t key_no, OUT uint8_t *uid)
 Function returns card UID if Random ID activated. Valid authentication is required.
 
UFR_STATUS DL_API nt4h_get_uid_pk (IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid)
 Provided Key mode (PK) Function returns card UID if Random ID activated.
 
UFR_STATUS DL_API nt4h_rid_read_ecc_signature (uint8_t auth_key_nr, uint8_t key_no, OUT uint8_t *uid, OUT uint8_t *ecc_signature, OUT uint8_t *dlogic_card_type)
 From library version 5.0.43 and firmware version 5.0.43. Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required.
 
UFR_STATUS DL_API nt4h_rid_read_ecc_signature_pk (IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid, OUT uint8_t *ecc_signature, VAR uint8_t *dlogic_card_type)
 Provided Key mode (PK) From library version 5.0.43 and firmware version 5.0.43. Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required.
 
UFR_STATUS DL_API nt4h_set_global_parameters (uint8_t file_no, uint8_t key_no, uint8_t communication_mode)
 Function sets file number, key number, and communication mode, before the using functions for reading and writing data into cards which are used for NTAG 2xx cards.
 
UFR_STATUS DL_API nt4h_set_rid (uint8_t aes_key_no)
 Function enables card Random ID. Authentication with application master key (key number 0) required.
 
UFR_STATUS DL_API nt4h_set_rid_pk (IN uint8_t *aes_key_ext)
 Provided Key mode (PK) Function enables card Random ID.
 
UFR_STATUS DL_API nt4h_tt_change_sdm_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, uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, uint8_t tt_status_enable, uint32_t tt_status_offset)
 Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file.
 
UFR_STATUS DL_API nt4h_tt_change_sdm_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, uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, uint8_t tt_status_enable, uint32_t tt_status_offset)
 Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file.
 
UFR_STATUS DL_API nt4h_tt_get_file_settings (uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, 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 uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, VAR uint8_t *tt_status_enable, VAR uint32_t *tt_status_offset)
 Function returns file settings.
 

Detailed Description

Functions specific to NT4H (Type 4) chips (e.g NTAG424DNA, with TagTamper support)

Function Documentation

◆ nt4h_change_key()

UFR_STATUS DL_API nt4h_change_key ( uint8_t auth_key_no,
uint8_t key_no,
IN uint8_t * new_key,
IN uint8_t * old_key )

Function changes AES key.

Authentication with the application master key is required.

Parameters
auth_key_noordinal number of AES key into reader (0 - 15)
key_nokey number 0 - 2 or 0 - 4
new_keypointer to array contained new AES key
old_keypointer to array contained current AES key
Returns
Operation status

◆ nt4h_change_key_pk()

UFR_STATUS DL_API nt4h_change_key_pk ( IN uint8_t * auth_key,
uint8_t key_no,
IN uint8_t * new_key,
IN uint8_t * old_key )

Provided Key mode (PK) Function changes AES key.

Authentication with the application master key is required.

Parameters
auth_keypointer to array contained AES key
key_nokey number 0 - 2 or 0 - 4
new_keypointer to array contained new AES key
old_keypointer to array contained current AES key
Returns
Operation status

◆ nt4h_change_sdm_file_settings()

UFR_STATUS DL_API nt4h_change_sdm_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,
uint8_t uid_enable,
uint8_t read_ctr_enable,
uint8_t read_ctr_limit_enable,
uint8_t enc_file_data_enable,
uint8_t meta_data_key_no,
uint8_t file_data_read_key_no,
uint8_t read_ctr_key_no,
uint32_t uid_offset,
uint32_t read_ctr_offset,
uint32_t picc_data_offset,
uint32_t mac_input_offset,
uint32_t enc_offset,
uint32_t enc_length,
uint32_t mac_offset,
uint32_t read_ctr_limit )

Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file.

Due to the large number of parameters, the function is separated from the function for creating a standard data file.

Parameters
aes_key_noordinal number of AES key into reader (0 - 15)
file_noNTAG 413 - 1 or 2 NTAG 424 - 1 to 3
key_nocurrent change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4
curr_communication_modecurrent communication mode 0 - plain, 1 - MACed, 3 - enciphered
new_communication_modenew communication mode 0 - plain
read_key_noreading key number (14 free access)
write_key_nowriting key number
read_write_key_noreading and writing key number
change_key_nonew change key number
uid_enableUID mirroring (0 - disabled, 1 - enabled)
read_ctr_enableSDM reading counter (0 - disabled, 1 - enabled)
read_ctr_limit_enableSDM reading counter limit (0 - disabled, 1 - enabled)
enc_file_data_enableusing encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled)
meta_data_key_nokey number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data
file_data_read_key_nokey number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC
read_ctr_key_nokey number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access
uid_offsetmirror position of UID if PICC data aren’t encrypted
read_ctr_offsetmirror position of SDM reading counter if PICC data aren’t encrypted
picc_data_offsetmirror position of encrypted PICC data (NTAG 424 only)
mac_input_offsetoffset in the file where the SDM MAC computation starts
enc_offsetmirror position of encrypted part of file data (NTAG 424 only)
enc_lengthlength of encrypted part of file data (NTAG 424 only)
mac_offsetmirror position of SDM MAC read_crt_limit value of SDM reading counter limit
read_ctr_limitread_ctr_limit
Returns
Operation status

◆ nt4h_change_sdm_file_settings_pk()

UFR_STATUS DL_API nt4h_change_sdm_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,
uint8_t uid_enable,
uint8_t read_ctr_enable,
uint8_t read_ctr_limit_enable,
uint8_t enc_file_data_enable,
uint8_t meta_data_key_no,
uint8_t file_data_read_key_no,
uint8_t read_ctr_key_no,
uint32_t uid_offset,
uint32_t read_ctr_offset,
uint32_t picc_data_offset,
uint32_t mac_input_offset,
uint32_t enc_offset,
uint32_t enc_length,
uint32_t mac_offset,
uint32_t read_ctr_limit )

Provided Key mode (PK) Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file.

Due to the large number of parameters, the function is separated from the function for creating a standard data file.

Parameters
aes_key_extpointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15)
file_noNTAG 413 - 1 or 2 NTAG 424 - 1 to 3
key_nocurrent change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4
curr_communication_modecurrent communication mode 0 - plain, 1 - MACed, 3 - enciphered
new_communication_modenew communication mode 0 - plain
read_key_noreading key number (14 free access)
write_key_nowriting key number
read_write_key_noreading and writing key number
change_key_nonew change key number
uid_enableUID mirroring (0 - disabled, 1 - enabled)
read_ctr_enableSDM reading counter (0 - disabled, 1 - enabled)
read_ctr_limit_enableSDM reading counter limit (0 - disabled, 1 - enabled)
enc_file_data_enableusing encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled)
meta_data_key_nokey number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data
file_data_read_key_nokey number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC
read_ctr_key_nokey number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access
uid_offsetmirror position of UID if PICC data aren’t encrypted
read_ctr_offsetmirror position of SDM reading counter if PICC data aren’t encrypted
picc_data_offsetmirror position of encrypted PICC data (NTAG 424 only)
mac_input_offsetoffset in the file where the SDM MAC computation starts
enc_offsetmirror position of encrypted part of file data (NTAG 424 only)
enc_lengthlength of encrypted part of file data (NTAG 424 only)
mac_offsetmirror position of SDM MAC read_crt_limit value of SDM reading counter limit
read_ctr_limitvalue of SDM reading counter limit
Returns
Operation status

◆ nt4h_change_standard_file_settings()

UFR_STATUS DL_API nt4h_change_standard_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 )

The function changes the access parameters of an existing standard data file.

The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards.

Parameters
aes_key_noordinal number of AES key into reader (0 - 15)
file_noNTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3
key_nocurrent change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4
curr_communication_modecurrent communication mode 0 - plain, 1 - MACed, 3 - enciphered
new_communication_modenew communication mode 0 - plain, 1 - MACed, 3 - enciphered
read_key_noreading key number
write_key_nowriting key number
read_write_key_noreading and writing key number
change_key_nonew change key number
Returns
Operation status

◆ nt4h_change_standard_file_settings_pk()

UFR_STATUS DL_API nt4h_change_standard_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 )

Provided Key mode (PK) The function changes the access parameters of an existing standard data file.

The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards.

Parameters
aes_key_extpointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15)
file_noNTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3
key_nocurrent change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4
curr_communication_modecurrent communication mode 0 - plain, 1 - MACed, 3 - enciphered
new_communication_modenew communication mode 0 - plain, 1 - MACed, 3 - enciphered
read_key_noreading key number
write_key_nowriting key number
read_write_key_noreading and writing key number
change_key_nonew change key number
Returns
Operation status

◆ nt4h_check_sdm_mac()

UFR_STATUS DL_API nt4h_check_sdm_mac ( uint32_t smd_read_counter,
IN uint8_t * uid,
IN uint8_t * auth_key,
IN uint8_t * mac_in_data,
IN uint8_t mac_in_len,
IN uint8_t * sdm_mac )

Helper function for the MAC of SDM checking.

Users need to know the SDM counter, UID and AES key for file data read.

Parameters
smd_read_countervalue of SDM reading counter
uidpointer to array contained 7 bytes UID
auth_keypointer to array contained AES meta data read key
mac_in_datadata from mac_input_offset to mac_offset
mac_in_lenmac_input_offset - mac_offset
sdm_macpointer to array contained 8 bytes SDM MAC
Returns
Operation status

◆ nt4h_decrypt_picc_data()

UFR_STATUS DL_API nt4h_decrypt_picc_data ( IN uint8_t * picc_data,
IN uint8_t * auth_key,
IN uint8_t * picc_data_tag,
IN uint8_t * uid,
IN uint32_t * smd_read_cnt )

Helper function for decryption of encrypted PICC data.

Function returns UID and SDM reading counter. Users need to know the AES key for metadata read (PICC data).

Parameters
picc_datapointer to array contained encrypted PICC data
auth_keypointer to array contained AES meta data read key
picc_data_tagif bit 7 set exist UID mirroring if bit 6 set exist SDM reading counter
uidpointer to array contained 7 bytes UID
smd_read_cntpointer to value of SDM reading counter
Returns
Operation status

◆ nt4h_decrypt_sdm_enc_file_data()

UFR_STATUS DL_API nt4h_decrypt_sdm_enc_file_data ( uint32_t smd_read_counter,
IN uint8_t * uid,
IN uint8_t * auth_key,
IN uint8_t * enc_file_data,
IN uint8_t enc_file_data_len )

Helper function for decryption of encrypted file data.

Users need to know the SDM counter, UID and AES key for file data read.

Parameters
smd_read_countervalue of SDM reading counter
uidpointer to array contained 7 bytes UID
auth_keypointer to array contained AES meta data read key
enc_file_datapointer to array contained encrypted part of file data
enc_file_data_lenlength of encrypted part of file data
Returns
Operation status

◆ nt4h_enable_tt()

UFR_STATUS DL_API nt4h_enable_tt ( uint8_t aes_key_no,
uint8_t tt_status_key_no )

NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. Function enabling tag tamper feature. Authentication with application master key (key number 0) required. Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled.

Parameters
aes_key_noordinal number of AES key into reader (0 - 15)
tt_status_key_no0 - 4, 14 free access
Returns
Operation status

◆ nt4h_enable_tt_pk()

UFR_STATUS DL_API nt4h_enable_tt_pk ( IN uint8_t * aes_key_ext,
uint8_t tt_status_key_no )

Provided Key mode (PK) NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. Function enabling tag tamper feature. Authentication with application master key (key number 0) required. Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled.

Parameters
aes_key_extordinal number of AES key into reader (0 - 15)
tt_status_key_no0 - 4, 14 free access
Returns
Operation status

◆ nt4h_get_file_settings()

UFR_STATUS DL_API nt4h_get_file_settings ( uint8_t file_no,
VAR uint8_t * file_type,
VAR uint8_t * communication_mode,
VAR uint8_t * sdm_enable,
VAR uint32_t * file_size,
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 uint8_t * uid_enable,
VAR uint8_t * read_ctr_enable,
VAR uint8_t * read_ctr_limit_enable,
VAR uint8_t * enc_file_data_enable,
VAR uint8_t * meta_data_key_no,
VAR uint8_t * file_data_read_key_no,
VAR uint8_t * read_ctr_key_no,
VAR uint32_t * uid_offset,
VAR uint32_t * read_ctr_offset,
VAR uint32_t * picc_data_offset,
VAR uint32_t * mac_input_offset,
VAR uint32_t * enc_offset,
VAR uint32_t * enc_length,
VAR uint32_t * mac_offset,
VAR uint32_t * read_ctr_limit )

Function returns file settings.

Parameters
file_noNTAG 413 - 1 or 2, NTAG 424 - 1 to 3
file_type0 - standard data file
communication_modecommunication mode, 0 - plain, 1 - MACed, 3 - enciphered
sdm_enable0 - SDM disabled, 1 - SDM enabled
file_sizefile size in bytes
read_key_noreading key number
write_key_nowriting key number
read_write_key_noreading and writing key number
change_key_nonew change key number
uid_enableUID mirroring (0 - disabled, 1 - enabled)
read_ctr_enableSDM reading counter (0 - disabled, 1 - enabled)
read_ctr_limit_enableSDM reading counter limit (0 - disabled, 1 - enabled)
enc_file_data_enableusing encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled)
meta_data_key_nokey number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data
file_data_read_key_nokey number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC
read_ctr_key_nokey number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access
uid_offsetmirror position of UID if PICC data aren’t encrypted
read_ctr_offsetmirror position of SDM reading counter if PICC data aren’t encrypted
picc_data_offsetmirror position of encrypted PICC data (NTAG 424 only)
mac_input_offsetoffset in the file where the SDM MAC computation starts
enc_offsetmirror position of encrypted part of file data (NTAG 424 only)
enc_lengthlength of encrypted part of file data (NTAG 424 only)
mac_offsetmirror position of SDM MAC
read_ctr_limitvalue of SDM reading counter limit
Returns
Operation status

◆ nt4h_get_sdm_ctr()

UFR_STATUS DL_API nt4h_get_sdm_ctr ( uint8_t auth_key_no,
uint8_t file_no,
uint8_t key_no,
VAR uint32_t * sdm_read_ctr )

Function supports retrieving of the current values of SDM reading counter.

Parameters
auth_key_noordinal number of AES key into reader (0 - 15)
file_nofile number of SDM file (2)
key_nokey number 0 - 2 or 0 - 4
sdm_read_ctrpointer to value of SDM reading counter
Returns
Operation status

◆ nt4h_get_sdm_ctr_no_auth()

UFR_STATUS DL_API nt4h_get_sdm_ctr_no_auth ( uint8_t file_no,
VAR uint32_t * sdm_read_ctr )

No authentication. Function supports retrieving of the current values of SDM reading counter.

Parameters
file_nofile number of SDM file (2)
sdm_read_ctrpointer to value of SDM reading counter
Returns
Operation status

◆ nt4h_get_sdm_ctr_pk()

UFR_STATUS DL_API nt4h_get_sdm_ctr_pk ( IN uint8_t * auth_key,
uint8_t file_no,
uint8_t key_no,
VAR uint32_t * sdm_read_ctr )

Provided Key mode (PK) Function supports retrieving of the current values of SDM reading counter.

Parameters
auth_keypointer to array contained AES key
file_nofile number of SDM file (2)
key_nokey number 0 - 2 or 0 - 4
sdm_read_ctrpointer to value of SDM reading counter
Returns
Operation status

◆ nt4h_get_tt_status()

UFR_STATUS DL_API nt4h_get_tt_status ( uint8_t aes_key_no,
uint8_t key_no,
VAR uint8_t * tt_perm_status,
VAR uint8_t * tt_curr_status )

NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. Function supports retrieving of the permanent and current Tag Tamper Status.

Parameters
aes_key_noordinal number of AES key into reader (0 - 15)
key_no0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type
tt_perm_statustamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened
tt_curr_statustag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened
Returns
Operation status

◆ nt4h_get_tt_status_no_auth()

UFR_STATUS DL_API nt4h_get_tt_status_no_auth ( VAR uint8_t * tt_perm_status,
VAR uint8_t * tt_curr_status )

No authentication NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. Function supports retrieving of the permanent and current Tag Tamper Status.

Parameters
tt_perm_statustag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened
tt_curr_statustag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened
Returns
Operation status

◆ nt4h_get_uid()

UFR_STATUS DL_API nt4h_get_uid ( uint8_t auth_key_no,
uint8_t key_no,
OUT uint8_t * uid )

Function returns card UID if Random ID activated. Valid authentication is required.

Parameters
auth_key_noordinal number of AES key into reader (0 - 15)
key_noordinal number of AES key into reader (0 - 15)
uidpointer to array contained UID
Returns
Operation status

◆ nt4h_get_uid_pk()

UFR_STATUS DL_API nt4h_get_uid_pk ( IN uint8_t * auth_key,
uint8_t key_no,
OUT uint8_t * uid )

Provided Key mode (PK) Function returns card UID if Random ID activated.

Valid authentication is required.

Parameters
auth_keypointer to array contained AES key
key_noordinal number of AES key into reader (0 - 15)
uidpointer to array contained UID
Returns
Operation status

◆ nt4h_rid_read_ecc_signature()

UFR_STATUS DL_API nt4h_rid_read_ecc_signature ( uint8_t auth_key_nr,
uint8_t key_no,
OUT uint8_t * uid,
OUT uint8_t * ecc_signature,
OUT uint8_t * dlogic_card_type )

From library version 5.0.43 and firmware version 5.0.43. Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required.

Parameters
auth_key_nrordinal number of AES key into reader (0 - 15)
key_no0 - 4
uid7 bytes UID length
ecc_signature56 bytes ECC signature
dlogic_card_typecard type value based on DLogic CardType enumeration
Returns
Operation status

◆ nt4h_rid_read_ecc_signature_pk()

UFR_STATUS DL_API nt4h_rid_read_ecc_signature_pk ( IN uint8_t * auth_key,
uint8_t key_no,
OUT uint8_t * uid,
OUT uint8_t * ecc_signature,
VAR uint8_t * dlogic_card_type )

Provided Key mode (PK) From library version 5.0.43 and firmware version 5.0.43. Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required.

Parameters
auth_keypointer to array contained AES key auth_key_nr ordinal number of AES key into reader (0 - 15)
key_no0 - 4
uid7 bytes UID length
ecc_signature56 bytes ECC signature
dlogic_card_typecard type value based on DLogic CardType enumeration
Returns
Operation status

◆ nt4h_set_global_parameters()

UFR_STATUS DL_API nt4h_set_global_parameters ( uint8_t file_no,
uint8_t key_no,
uint8_t communication_mode )

Function sets file number, key number, and communication mode, before the using functions for reading and writing data into cards which are used for NTAG 2xx cards.

This makes it possible to use existing functions for the block and linear reading and writing.

Parameters
file_noNTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3
key_noNTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4
communication_mode0 - plain, 1 - MACed, 3 - enciphered
Returns
Operation status

◆ nt4h_set_rid()

UFR_STATUS DL_API nt4h_set_rid ( uint8_t aes_key_no)

Function enables card Random ID. Authentication with application master key (key number 0) required.

Warning. This operation is ireversibile.

Parameters
aes_key_noordinal number of AES key into reader (0 - 15)
Returns
Operation status

◆ nt4h_set_rid_pk()

UFR_STATUS DL_API nt4h_set_rid_pk ( IN uint8_t * aes_key_ext)

Provided Key mode (PK) Function enables card Random ID.

Authentication with application master key (key number 0) required. Warning. This operation is ireversibile.

Parameters
aes_key_extpointer to array contained AES key
Returns
Operation status

◆ nt4h_tt_change_sdm_file_settings()

UFR_STATUS DL_API nt4h_tt_change_sdm_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,
uint8_t uid_enable,
uint8_t read_ctr_enable,
uint8_t read_ctr_limit_enable,
uint8_t enc_file_data_enable,
uint8_t meta_data_key_no,
uint8_t file_data_read_key_no,
uint8_t read_ctr_key_no,
uint32_t uid_offset,
uint32_t read_ctr_offset,
uint32_t picc_data_offset,
uint32_t mac_input_offset,
uint32_t enc_offset,
uint32_t enc_length,
uint32_t mac_offset,
uint32_t read_ctr_limit,
uint8_t tt_status_enable,
uint32_t tt_status_offset )

Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file.

NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43.

Due to the large number of parameters, the function is separated from the function for creating a standard data file.

Parameters
aes_key_noordinal number of AES key into reader (0 - 15)
file_no1 - 3
key_nocurrent change key number 0 - 4
curr_communication_modecurrent communication mode 0 - plain, 1 - MACed, 3 - enciphered
new_communication_modenew communication mode 0 - plain
read_key_noreading key number (14 free access)
write_key_nowriting key number
read_write_key_noreading and writing key number
change_key_nonew change key number
uid_enableUID mirroring (0 - disabled, 1 - enabled)
read_ctr_enableSDM reading counter (0 - disabled, 1 - enabled)
read_ctr_limit_enableSDM reading counter limit (0 - disabled, 1 - enabled)
enc_file_data_enableusing encrypted part of file data (0 - disabled, 1 - enabled)
meta_data_key_nokey number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data
file_data_read_key_nokey number for MAC and encrypted part of file data 0 - 4, 15 no MAC
read_ctr_key_nokey number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access
uid_offsetmirror position of UID if PICC data aren’t encrypted
read_ctr_offsetmirror position of SDM reading counter if PICC data aren’t encrypted
picc_data_offsetmirror position of encrypted PICC data
mac_input_offsetoffset in the file where the SDM MAC computation starts
enc_offsetmirror position of encrypted part of file data
enc_lengthlength of encrypted part of file data
mac_offsetmirror position of SDM MAC
read_ctr_limitvalue of SDM reading counter limit
tt_status_enabletag tamper status mirroring (0 - disabled, 1 - enabled)
tt_status_offsetmirror position of tag tamper status
Returns
Operation status

◆ nt4h_tt_change_sdm_file_settings_pk()

UFR_STATUS DL_API nt4h_tt_change_sdm_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,
uint8_t uid_enable,
uint8_t read_ctr_enable,
uint8_t read_ctr_limit_enable,
uint8_t enc_file_data_enable,
uint8_t meta_data_key_no,
uint8_t file_data_read_key_no,
uint8_t read_ctr_key_no,
uint32_t uid_offset,
uint32_t read_ctr_offset,
uint32_t picc_data_offset,
uint32_t mac_input_offset,
uint32_t enc_offset,
uint32_t enc_length,
uint32_t mac_offset,
uint32_t read_ctr_limit,
uint8_t tt_status_enable,
uint32_t tt_status_offset )

Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file.

Provided Key mode (PK) NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43.

Due to the large number of parameters, the function is separated from the function for creating a standard data file.

Parameters
aes_key_extpointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15)
file_no1 - 3
key_nocurrent change key number 0 - 4
curr_communication_modecurrent communication mode 0 - plain, 1 - MACed, 3 - enciphered
new_communication_modenew communication mode 0 - plain
read_key_noreading key number (14 free access)
write_key_nowriting key number
read_write_key_noreading and writing key number
change_key_nonew change key number
uid_enableUID mirroring (0 - disabled, 1 - enabled)
read_ctr_enableSDM reading counter (0 - disabled, 1 - enabled)
read_ctr_limit_enableSDM reading counter limit (0 - disabled, 1 - enabled)
enc_file_data_enableusing encrypted part of file data (0 - disabled, 1 - enabled)
meta_data_key_nokey number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data
file_data_read_key_nokey number for MAC and encrypted part of file data 0 - 4, 15 no MAC
read_ctr_key_nokey number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access
uid_offsetmirror position of UID if PICC data aren’t encrypted
read_ctr_offsetmirror position of SDM reading counter if PICC data aren’t encrypted
picc_data_offsetmirror position of encrypted PICC data
mac_input_offsetoffset in the file where the SDM MAC computation starts
enc_offsetmirror position of encrypted part of file data
enc_lengthlength of encrypted part of file data
mac_offsetmirror position of SDM MAC
read_ctr_limitvalue of SDM reading counter limit
tt_status_enabletag tamper status mirroring (0 - disabled, 1 - enabled)
tt_status_offsetmirror position of tag tamper status
Returns
Operation status

◆ nt4h_tt_get_file_settings()

UFR_STATUS DL_API nt4h_tt_get_file_settings ( uint8_t file_no,
VAR uint8_t * file_type,
VAR uint8_t * communication_mode,
VAR uint8_t * sdm_enable,
VAR uint32_t * file_size,
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 uint8_t * uid_enable,
VAR uint8_t * read_ctr_enable,
VAR uint8_t * read_ctr_limit_enable,
VAR uint8_t * enc_file_data_enable,
VAR uint8_t * meta_data_key_no,
VAR uint8_t * file_data_read_key_no,
VAR uint8_t * read_ctr_key_no,
VAR uint32_t * uid_offset,
VAR uint32_t * read_ctr_offset,
VAR uint32_t * picc_data_offset,
VAR uint32_t * mac_input_offset,
VAR uint32_t * enc_offset,
VAR uint32_t * enc_length,
VAR uint32_t * mac_offset,
VAR uint32_t * read_ctr_limit,
VAR uint8_t * tt_status_enable,
VAR uint32_t * tt_status_offset )

Function returns file settings.

NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43.

Parameters
file_no413 - 1 or 2; NTAG 424 - 1 to 3
file_type0 - standard data file
communication_modecommunication mode, 0 - plain, 1 - MACed, 3 - enciphered
sdm_enable0 - SDM disabled, 1 - SDM enabled
file_sizefile size in bytes
read_key_noreading key number
write_key_nowriting key number
read_write_key_noreading and writing key number
change_key_nonew change key number
uid_enableUID mirroring (0 - disabled, 1 - enabled)
read_ctr_enableSDM reading counter (0 - disabled, 1 - enabled)
read_ctr_limit_enableSDM reading counter limit (0 - disabled, 1 - enabled)
enc_file_data_enableusing encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled)
meta_data_key_nokey number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data
file_data_read_key_nokey number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC
read_ctr_key_nokey number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access
uid_offsetmirror position of UID if PICC data aren’t encrypted
read_ctr_offsetmirror position of SDM reading counter if PICC data aren’t encrypted
picc_data_offsetmirror position of encrypted PICC data (NTAG 424 only)
mac_input_offsetoffset in the file where the SDM MAC computation starts
enc_offsetmirror position of encrypted part of file data (NTAG 424 only)
enc_lengthlength of encrypted part of file data (NTAG 424 only)
mac_offsetmirror position of SDM MAC
read_ctr_limitvalue of SDM reading counter limit
tt_status_enabletag tamper status (0 - disabled, 1 - enabled)
tt_status_offsetmirror position of tag tamper status
Returns
Operation status