BALTECH SDK wrapper functions reference
desfire.h File Reference

With this command group, you can access MIFARE DESFire cards in low-level mode. More...

#include "../typedefs.h"

Go to the source code of this file.

Data Structures

struct  brp_Desfire_ExecCommand_t
 
struct  brp_Desfire_Authenticate_t
 
struct  brp_Desfire_AuthExtKey_t
 
struct  brp_Desfire_SelectApplication_t
 
struct  brp_Desfire_ReadData_t
 
struct  brp_Desfire_WriteData_t
 
struct  brp_Desfire_ChangeExtKey_t
 
struct  brp_Desfire_ChangeKey_t
 
struct  brp_Desfire_SetFraming_t
 
struct  brp_Desfire_ResetAuthentication_t
 
struct  brp_Desfire_CreateDam_t
 
struct  brp_Desfire_GetOriginalitySignature_t
 
struct  brp_Desfire_VirtualCardSelect_t
 
struct  brp_Desfire_ProxCheck_t
 
struct  brp_Desfire_GetDfNames_t
 

Macros

#define BRP_Desfire_ErrIso14NoTag   BRP_ERR_STATUS(0x1B00, 0x01)
 There's no card in the HF field, or the card doesn't respond. More...
 
#define BRP_Desfire_ErrBreak   BRP_ERR_STATUS(0x1B00, 0x03)
 The command has been aborted because the HF interface has been requested by another task or command. More...
 
#define BRP_Desfire_ErrIso14Hf   BRP_ERR_STATUS(0x1B00, 0x04)
 The response frame received from the PICC is invalid, e.g. More...
 
#define BRP_Desfire_ErrIso14CardInvalid   BRP_ERR_STATUS(0x1B00, 0x05)
 The card behaves in an unspecified way or is corrupted. More...
 
#define BRP_Desfire_ErrReaderChipCommunication   BRP_ERR_STATUS(0x1B00, 0x06)
 Communication with the reader's HF interface has failed. More...
 
#define BRP_Desfire_ErrIso14ApduCmd   BRP_ERR_STATUS(0x1B00, 0x07)
 ISO 14443-4 error: The command or parameters are invalid. More...
 
#define BRP_Desfire_ErrIso14InvalidResponse   BRP_ERR_STATUS(0x1B00, 0x08)
 ISO 14443-4 error: The card returned an invalid response, e.g. More...
 
#define BRP_Desfire_ErrPcdAuthentication   BRP_ERR_STATUS(0x1B00, 0x09)
 Authentication with the PICC has failed, e.g. More...
 
#define BRP_Desfire_ErrIntegrity   BRP_ERR_STATUS(0x1B00, 0x0A)
 Secure messaging error: The CRC or MAC checksum doesn't match the transmitted data. More...
 
#define BRP_Desfire_ErrPcdKey   BRP_ERR_STATUS(0x1B00, 0x0B)
 The key in the SAM/crypto memory is invalid or missing. More...
 
#define BRP_Desfire_ErrNoChanges   BRP_ERR_STATUS(0x1B00, 0x0C)
 Card error as per DESFire specification: No changes done to backup files, CommitTransaction / AbortTransaction not necessary. More...
 
#define BRP_Desfire_ErrPcdParam   BRP_ERR_STATUS(0x1B00, 0x0D)
 The BRP command contains an invalid parameter. More...
 
#define BRP_Desfire_VcsAndProxCheckError   BRP_ERR_STATUS(0x1B00, 0x0F)
 The proximity check has timed out. More...
 
#define BRP_Desfire_ErrFirmwareNotSupported   BRP_ERR_STATUS(0x1B00, 0x10)
 This command or parameter isn't supported by the reader firmware. More...
 
#define BRP_Desfire_ErrSamCommunication   BRP_ERR_STATUS(0x1B00, 0x11)
 Communication with the SAM has failed. More...
 
#define BRP_Desfire_ErrSamUnlock   BRP_ERR_STATUS(0x1B00, 0x12)
 Unlocking/authenticating with the SAM has failed. More...
 
#define BRP_Desfire_ErrHardwareNotSupported   BRP_ERR_STATUS(0x1B00, 0x13)
 This command isn't supported by the reader hardware. More...
 
#define BRP_Desfire_ErrIllegalCmdLegacy   BRP_ERR_STATUS(0x1B00, 0x1C)
 Card error as per DESFire specification: Command code not supported by card. More...
 
#define BRP_Desfire_ErrLength   BRP_ERR_STATUS(0x1B00, 0x20)
 Card error as per DESFire specification: Length of command string invalid. More...
 
#define BRP_Desfire_ErrPermissionDenied   BRP_ERR_STATUS(0x1B00, 0x21)
 Card error as per DESFire specification: Current configuration/state does not allow the requested command. More...
 
#define BRP_Desfire_ErrParameter   BRP_ERR_STATUS(0x1B00, 0x22)
 Card error as per DESFire specification: Value of the parameter invalid. More...
 
#define BRP_Desfire_ErrAppNotFound   BRP_ERR_STATUS(0x1B00, 0x23)
 Card error as per DESFire specification: Requested AID not present on PICC. More...
 
#define BRP_Desfire_ErrAppIntegrity   BRP_ERR_STATUS(0x1B00, 0x24)
 Card error as per DESFire specification: Unrecoverable error in application. More...
 
#define BRP_Desfire_ErrAuthentication   BRP_ERR_STATUS(0x1B00, 0x25)
 Card error as per DESFire specification: Current authentication status does not allow execution of requested command. More...
 
#define BRP_Desfire_ErrBoundary   BRP_ERR_STATUS(0x1B00, 0x27)
 Card error as per DESFire specification: Attempted to read/write beyond the limits of the file. More...
 
#define BRP_Desfire_ErrPiccIntegrity   BRP_ERR_STATUS(0x1B00, 0x28)
 Card error as per DESFire specification: Unrecoverable error within PICC, PICC will be disabled. More...
 
#define BRP_Desfire_ErrCommandAborted   BRP_ERR_STATUS(0x1B00, 0x29)
 Card error as per DESFire specification: Previous command was not fully completed. More...
 
#define BRP_Desfire_ErrPiccDisabled   BRP_ERR_STATUS(0x1B00, 0x2A)
 Card error as per DESFire specification: PICC was disabled by an unrecoverable error. More...
 
#define BRP_Desfire_ErrCount   BRP_ERR_STATUS(0x1B00, 0x2B)
 Card error as per DESFire specification: Number of applications limited to 28, no additional CreateApplication possible. More...
 
#define BRP_Desfire_ErrDuplicate   BRP_ERR_STATUS(0x1B00, 0x2C)
 Card error as per DESFire specification: Creation of file/application failed because file/application with same number already exists. More...
 
#define BRP_Desfire_ErrEeprom   BRP_ERR_STATUS(0x1B00, 0x2D)
 Card error as per DESFire specification: Could not complete NV-write operation due to loss of power, internal backup/rollback mechanism activated. More...
 
#define BRP_Desfire_ErrFileNotFound   BRP_ERR_STATUS(0x1B00, 0x2E)
 Card error as per DESFire specification: Specified file number does not exist. More...
 
#define BRP_Desfire_ErrFileIntegrity   BRP_ERR_STATUS(0x1B00, 0x2F)
 Card error as per DESFire specification: Unrecoverable error within file, file will be disabled. More...
 
#define BRP_Desfire_ErrNoSuchKey   BRP_ERR_STATUS(0x1B00, 0x30)
 Card error as per DESFire specification: Invalid key number specified. More...
 
#define BRP_Desfire_ErrOutOfMemory   BRP_ERR_STATUS(0x1B00, 0x32)
 Card error as per DESFire specification: Insufficient NV-Memory to complete command . More...
 
#define BRP_Desfire_ErrIllegalCmd   BRP_ERR_STATUS(0x1B00, 0x33)
 Card error as per DESFire specification: Command code not supported by card. More...
 
#define BRP_Desfire_ErrCmdOverflow   BRP_ERR_STATUS(0x1B00, 0x34)
 Card error as per DESFire specification: Too many commands in the session or transaction. More...
 

Functions

brp_errcode brp_Desfire_ExecCommand (brp_Desfire_ExecCommand_t params)
 Generic command to communicate to a DESFire card. More...
 
brp_errcode brp_Desfire_Authenticate (brp_Desfire_Authenticate_t params)
 This command authenticates a card with the reader. More...
 
brp_errcode brp_Desfire_AuthExtKey (brp_Desfire_AuthExtKey_t params)
 This command authenticates a card with the reader, similarly to the brp_Desfire_Authenticate() command, but uses an external authentication key provided as a parameter. More...
 
brp_errcode brp_Desfire_SelectApplication (brp_Desfire_SelectApplication_t params)
 Selects an application of the DESFire card. More...
 
brp_errcode brp_Desfire_ReadData (brp_Desfire_ReadData_t params)
 Reads data from a Standard or Backup data file. More...
 
brp_errcode brp_Desfire_WriteData (brp_Desfire_WriteData_t params)
 Writes data to a Standard or a Backup data file. More...
 
brp_errcode brp_Desfire_ChangeExtKey (brp_Desfire_ChangeExtKey_t params)
 This command allows to change any key stored on the card. More...
 
brp_errcode brp_Desfire_ChangeKey (brp_Desfire_ChangeKey_t params)
 Modifies a DESFire card key defined in the SAM or crypto memory. More...
 
brp_errcode brp_Desfire_SetFraming (brp_Desfire_SetFraming_t params)
 This command switches the DESFire communication protocol mode to use (std, iso_wrapping). More...
 
brp_errcode brp_Desfire_ResetAuthentication (brp_Desfire_ResetAuthentication_t params)
 This command resets the reader's authentication state until the next call of the brp_Desfire_Authenticate() or brp_Desfire_AuthExtKey() commands. More...
 
brp_errcode brp_Desfire_CreateDam (brp_Desfire_CreateDam_t params)
 This command creates a delegated application. More...
 
brp_errcode brp_Desfire_GetOriginalitySignature (brp_Desfire_GetOriginalitySignature_t params)
 This command returns the NXP originality signature of a desfire card. More...
 
brp_errcode brp_Desfire_VirtualCardSelect (brp_Desfire_VirtualCardSelect_t params)
 This command selects a virtual card. More...
 
brp_errcode brp_Desfire_ProxCheck (brp_Desfire_ProxCheck_t params)
 This command executes a proximity check of the card. More...
 
brp_errcode brp_Desfire_GetDfNames (brp_Desfire_GetDfNames_t params)
 This command returns the application identifiers together with file IDs and (optionally) DF names of all applications with ISO7816-4 support. More...
 

Detailed Description

With this command group, you can access MIFARE DESFire cards in low-level mode.

You can use these commands to completely manage the card's cryptographic functionality and to simplify the handling of DESFire cards.

Definition in file desfire.h.