C API for BALTECH SDK
desfire.h File Reference
#include "../typedefs.h"

Go to the source code of this file.

Macros

#define BRP_Desfire_ErrIso14NoTag   BRP_ERR_STATUS(0x1B00, 0x01)
 
#define BRP_Desfire_ErrBreak   BRP_ERR_STATUS(0x1B00, 0x03)
 
#define BRP_Desfire_ErrIso14Hf   BRP_ERR_STATUS(0x1B00, 0x04)
 
#define BRP_Desfire_ErrIso14CardInvalid   BRP_ERR_STATUS(0x1B00, 0x05)
 
#define BRP_Desfire_ErrReaderChipCommunication   BRP_ERR_STATUS(0x1B00, 0x06)
 
#define BRP_Desfire_ErrIso14ApduCmd   BRP_ERR_STATUS(0x1B00, 0x07)
 
#define BRP_Desfire_ErrIso14InvalidResponse   BRP_ERR_STATUS(0x1B00, 0x08)
 
#define BRP_Desfire_ErrPcdAuthentication   BRP_ERR_STATUS(0x1B00, 0x09)
 
#define BRP_Desfire_ErrIntegrity   BRP_ERR_STATUS(0x1B00, 0x0A)
 
#define BRP_Desfire_ErrPcdKey   BRP_ERR_STATUS(0x1B00, 0x0B)
 
#define BRP_Desfire_ErrNoChanges   BRP_ERR_STATUS(0x1B00, 0x0C)
 
#define BRP_Desfire_ErrPcdParam   BRP_ERR_STATUS(0x1B00, 0x0D)
 
#define BRP_Desfire_VcsAndProxCheckError   BRP_ERR_STATUS(0x1B00, 0x0F)
 
#define BRP_Desfire_ErrFirmwareNotSupported   BRP_ERR_STATUS(0x1B00, 0x10)
 
#define BRP_Desfire_ErrSamCommunication   BRP_ERR_STATUS(0x1B00, 0x11)
 
#define BRP_Desfire_ErrSamUnlock   BRP_ERR_STATUS(0x1B00, 0x12)
 
#define BRP_Desfire_ErrHardwareNotSupported   BRP_ERR_STATUS(0x1B00, 0x13)
 
#define BRP_Desfire_ErrIllegalCmdLegacy   BRP_ERR_STATUS(0x1B00, 0x1C)
 
#define BRP_Desfire_ErrLength   BRP_ERR_STATUS(0x1B00, 0x20)
 
#define BRP_Desfire_ErrPermissionDenied   BRP_ERR_STATUS(0x1B00, 0x21)
 
#define BRP_Desfire_ErrParameter   BRP_ERR_STATUS(0x1B00, 0x22)
 
#define BRP_Desfire_ErrAppNotFound   BRP_ERR_STATUS(0x1B00, 0x23)
 
#define BRP_Desfire_ErrAppIntegrity   BRP_ERR_STATUS(0x1B00, 0x24)
 
#define BRP_Desfire_ErrAuthentication   BRP_ERR_STATUS(0x1B00, 0x25)
 
#define BRP_Desfire_ErrBoundary   BRP_ERR_STATUS(0x1B00, 0x27)
 
#define BRP_Desfire_ErrPiccIntegrity   BRP_ERR_STATUS(0x1B00, 0x28)
 
#define BRP_Desfire_ErrCommandAborted   BRP_ERR_STATUS(0x1B00, 0x29)
 
#define BRP_Desfire_ErrPiccDisabled   BRP_ERR_STATUS(0x1B00, 0x2A)
 
#define BRP_Desfire_ErrCount   BRP_ERR_STATUS(0x1B00, 0x2B)
 
#define BRP_Desfire_ErrDuplicate   BRP_ERR_STATUS(0x1B00, 0x2C)
 
#define BRP_Desfire_ErrEeprom   BRP_ERR_STATUS(0x1B00, 0x2D)
 
#define BRP_Desfire_ErrFileNotFound   BRP_ERR_STATUS(0x1B00, 0x2E)
 
#define BRP_Desfire_ErrFileIntegrity   BRP_ERR_STATUS(0x1B00, 0x2F)
 
#define BRP_Desfire_ErrNoSuchKey   BRP_ERR_STATUS(0x1B00, 0x30)
 
#define BRP_Desfire_ErrOutOfMemory   BRP_ERR_STATUS(0x1B00, 0x32)
 
#define BRP_Desfire_ErrIllegalCmd   BRP_ERR_STATUS(0x1B00, 0x33)
 
#define BRP_Desfire_ErrCmdOverflow   BRP_ERR_STATUS(0x1B00, 0x34)
 

Functions

brp_errcode brp_Desfire_ExecCommand (brp_protocol protocol, unsigned Cmd, brp_buf Header, size_t Header_len, brp_buf Param, size_t Param_len, brp_Desfire_ExecCommand_CryptoMode CryptoMode, unsigned ResponseLen, brp_buf *Resp, size_t *Resp_len, brp_mempool *mempool)
 
brp_errcode brp_Desfire_Authenticate (brp_protocol protocol, brp_Desfire_Authenticate_SecureMessaging SecureMessaging, unsigned DesKeynr, unsigned KeyId, bool KeyHasDivData, brp_Desfire_Authenticate_KeyDivMode KeyDivMode, bool KeyHasExtIdx, brp_buf KeyDivData, size_t KeyDivData_len, unsigned KeyExtIdx)
 
brp_errcode brp_Desfire_AuthExtKey (brp_protocol protocol, brp_Desfire_AuthExtKey_SecureMessaging SecureMessaging, unsigned DesKeyNr, brp_Desfire_AuthExtKey_CryptoMode CryptoMode, brp_buf Key, size_t Key_len)
 
brp_errcode brp_Desfire_SelectApplication (brp_protocol protocol, unsigned AppId)
 
brp_errcode brp_Desfire_ReadData (brp_protocol protocol, unsigned FileId, unsigned Adr, unsigned Len, brp_Desfire_ReadData_Mode Mode, brp_buf *Data, size_t *Data_len, brp_mempool *mempool)
 
brp_errcode brp_Desfire_WriteData (brp_protocol protocol, unsigned FileId, unsigned Adr, brp_buf Data, size_t Data_len, brp_Desfire_WriteData_Mode Mode)
 
brp_errcode brp_Desfire_ChangeExtKey (brp_protocol protocol, brp_Desfire_ChangeExtKey_MasterKeyType MasterKeyType, bool IsKeySet, bool IsAesKey, bool IsVersion, bool IsChangeKey, unsigned KeyNo, unsigned KeyVersion, brp_buf NewKey, size_t NewKey_len, brp_buf OldKey, size_t OldKey_len, unsigned KeySet)
 
brp_errcode brp_Desfire_ChangeKey (brp_protocol protocol, bool IsKeySet, bool IsMasterKey, bool IsChangeKey, unsigned KeyNr, brp_Desfire_ChangeKey_NewKeyDivMode NewKeyDivMode, bool NewKeyHasDivData, bool NewKeyHasExtIdx, unsigned NewKeyIdx, brp_Desfire_ChangeKey_CurKeyDivMode CurKeyDivMode, bool CurKeyHasDivData, bool CurKeyHasExtIdx, unsigned CurKeyIdx, brp_buf NewKeyDivData, size_t NewKeyDivData_len, brp_buf CurKeyDivData, size_t CurKeyDivData_len, unsigned NewKeyExtIdx, unsigned CurKeyExtIdx, unsigned KeySet)
 
brp_errcode brp_Desfire_SetFraming (brp_protocol protocol, brp_Desfire_SetFraming_CommMode CommMode)
 
brp_errcode brp_Desfire_ResetAuthentication (brp_protocol protocol)
 
brp_errcode brp_Desfire_CreateDam (brp_protocol protocol, unsigned AppId, brp_buf AppParams, size_t AppParams_len, brp_buf EncryptedDefaultDamKey, size_t EncryptedDefaultDamKey_len, brp_buf DamMacKey, size_t DamMacKey_len)
 
brp_errcode brp_Desfire_GetOriginalitySignature (brp_protocol protocol, brp_buf *Signature, size_t *Signature_len, brp_mempool *mempool)
 
brp_errcode brp_Desfire_VirtualCardSelect (brp_protocol protocol, bool ForceVcsAuthentication, bool UseExtVcSelectKeys, unsigned DiversifyMacKey, bool DiversifyEncKey, bool UseVcSelectKeys, brp_buf IID, size_t IID_len, unsigned EncKeyIdx, unsigned MacKeyIdx, brp_buf DivData, size_t DivData_len, brp_buf EncKey, size_t EncKey_len, brp_buf MacKey, size_t MacKey_len, unsigned *FciType, brp_buf *Fci, size_t *Fci_len, brp_mempool *mempool)
 
brp_errcode brp_Desfire_ProxCheck (brp_protocol protocol, unsigned M, bool UseExtProxKey, bool DiversifyProxKey, bool UseProxKey, unsigned ProxKeyIdx, brp_buf DivData, size_t DivData_len, brp_buf ProxKey, size_t ProxKey_len)
 
brp_errcode brp_Desfire_GetDfNames (brp_protocol protocol, brp_Desfire_GetDfNames_AppNr_Entry **AppNr, size_t *AppNr_len, brp_mempool *mempool)
 

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.