SpringCard PC/SC Helpers for .NET  18.10.10
High-level access to a few current cards and to advanced coupler features
SpringCard.PCSC.CardHelpers.Desfire Class Reference

Description of DESFire. More...

Classes

struct  DF_DATA_FILE_SETTINGS
 
class  DF_FILE_SETTINGS
 
struct  DF_ISO_APPLICATION_ST
 
class  DF_RAW_FILE_SETTINGS
 
struct  DF_RECORD_FILE_SETTINGS
 
struct  DF_VALUE_FILE_SETTINGS
 
struct  DF_VERSION_INFO
 

Public Member Functions

bool ExportContext (ref byte TisoWrapping, ref UInt32 Tcurrent_aid, ref byte Tsession_type, out byte[] Tsession_key, ref int Tsession_key_id, out byte[] Tinit_vector, out byte[] Tcmac_subkey_1, out byte[] Tcmac_subkey_2)
 
bool ImportContext (byte TisoWrapping, UInt32 Tcurrent_aid, byte Tsession_type, byte[] Tsession_key, int Tsession_key_id, byte[] Tinit_vector, byte[] Tcmac_subkey_1, byte[] Tcmac_subkey_2)
 
void IsoWrapping (byte mode)
 
 Desfire (ICardTransmitter transmitter, byte isoWrapping=DF_ISO_WRAPPING_OFF)
 Instanciate a Desfire card object over a card channel. The channel must already be connected.
 
long Authenticate (byte bKeyNumber, byte[] pbAccessKey)
 
long AuthenticateIso (byte bKeyNumber, byte[] pbAccessKey)
 
long AuthenticateIso24 (byte bKeyNumber, byte[] pbAccessKey)
 
long AuthenticateAes (byte bKeyNumber, byte[] pbAccessKey)
 
void PrepareCreateFileCommand (byte create_cmd, byte file_id, Int32 iso_ef_id, byte comm_mode, UInt16 access_rights)
 
long CreateStdDataFile (byte file_id, byte comm_mode, UInt16 access_rights, UInt32 file_size)
 
long CreateIsoStdDataFile (byte file_id, UInt16 iso_ef_id, byte comm_mode, UInt16 access_rights, UInt32 file_size)
 
long CreateBackupDataFile (byte file_id, byte comm_mode, UInt16 access_rights, UInt32 file_size)
 
long CreateIsoBackupDataFile (byte file_id, UInt16 iso_ef_id, byte comm_mode, UInt16 access_rights, UInt32 file_size)
 
long CreateValueFile (byte file_id, byte comm_mode, UInt16 access_rights, long lower_limit, long upper_limit, long initial_value, byte limited_credit_enabled)
 
long CreateLinearRecordFile (byte file_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records)
 
long CreateIsoLinearRecordFile (byte file_id, UInt16 iso_ef_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records)
 
long CreateCyclicRecordFile (byte file_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records)
 
long CreateIsoCyclicRecordFile (byte file_id, UInt16 iso_ef_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records)
 
long DeleteFile (byte file_id)
 
long GetFileSettings (byte file_id, out byte file_type, out byte comm_mode, out UInt16 access_rights, out DF_FILE_SETTINGS additionnal_settings)
 
long ChangeFileSettings (byte file_id, byte comm_mode, UInt16 access_rights)
 
long GetFileIDs (byte fid_max_count, byte[] fid_list, ref byte fid_count)
 
long GetIsoFileIDs (byte fid_max_count, UInt16[] fid_list, ref byte fid_count)
 
long ChangeKeySettings (byte key_settings)
 
long GetKeySettings (ref byte key_settings, ref byte key_count)
 
long ChangeKey (byte key_number, byte[] new_key, byte[] old_key)
 
long ChangeKey24 (byte key_number, byte[] new_key, byte[] old_key)
 
long ChangeKeyAes (byte key_number, byte key_version, byte[] new_key, byte[] old_key)
 
long GetKeyVersion (byte bKeyNumber, ref byte pbKeyVersion)
 
long VerifyMacRecv (byte[] recv_buffer, ref UInt32 recv_length)
 
long GetFreeMemory (ref UInt32 pdwFreeBytes)
 
long GetCardUID (out byte[] uid)
 
long FormatPICC ()
 
long CreateApplication (UInt32 aid, byte key_setting_1, byte key_setting_2)
 
long CreateIsoApplication (UInt32 aid, byte key_setting_1, byte key_setting_2, UInt16 iso_df_id, byte[] iso_df_name, byte iso_df_namelen)
 
long DeleteApplication (UInt32 aid)
 
long GetApplicationIDs (byte aid_max_count, ref UInt32[] aid_list, ref byte aid_count)
 
long GetIsoApplications (byte app_max_count, List< DF_ISO_APPLICATION_ST > app_list, ref byte app_count)
 
long SelectApplication (UInt32 aid)
 
long GetVersion (out DF_VERSION_INFO VersionInfo)
 
long SetConfiguration (byte option, byte[] data, byte length)
 
long ReadDataEx (byte read_command, byte file_id, byte comm_mode, UInt32 from_offset, UInt32 item_count, UInt32 item_size, ref byte[] data, ref UInt32 done_size)
 
long ReadData (byte file_id, byte comm_mode, UInt32 from_offset, UInt32 max_count, ref byte[] data, ref UInt32 done_count)
 
long ReadData2 (byte file_id, UInt32 from_offset, UInt32 max_count, ref byte[] data, ref UInt32 done_count)
 
long ClearRecordFile (byte file_id)
 
long ReadRecords (byte file_id, byte comm_mode, UInt32 from_record, UInt32 max_record_count, UInt32 record_size, ref byte[] data, ref UInt32 record_count)
 
long ReadRecords2 (byte file_id, UInt32 from_record, UInt32 max_record_count, UInt32 record_size, ref byte[] data, ref UInt32 record_count)
 
long WriteRecord (byte file_id, byte comm_mode, UInt32 from_offset, UInt32 size, byte[] data)
 
long WriteRecord2 (byte file_id, UInt32 from_offset, UInt32 size, byte[] data)
 
long CommitTransaction ()
 
long AbortTransaction ()
 
long WriteData (byte file_id, byte comm_mode, UInt32 from_offset, UInt32 size, byte[] data)
 
long WriteData2 (byte file_id, UInt32 from_offset, UInt32 size, byte[] data)
 
long WriteDataEx (byte write_command, byte file_id, byte comm_mode, UInt32 from_offset, UInt32 size, byte[] data)
 

Public Attributes

const byte DF_STANDARD_DATA_FILE = 0x00
 
const byte DF_BACKUP_DATA_FILE = 0x01
 
const byte DF_VALUE_FILE = 0x02
 
const byte DF_LINEAR_RECORD_FILE = 0x03
 
const byte DF_CYCLIC_RECORD_FILE = 0x04
 
const byte DF_COMM_MODE_PLAIN = 0x00
 
const byte DF_COMM_MODE_MACED = 0x01
 
const byte DF_COMM_MODE_PLAIN2 = 0x02
 
const byte DF_COMM_MODE_ENCIPHERED = 0x03
 
const byte DF_APPLSETTING1_MASTER_CHANGEABLE = 0x01
 
const byte DF_APPLSETTING1_FREE_LISTING = 0x02
 
const byte DF_APPLSETTING1_FREE_CREATE_DELETE = 0x04
 
const byte DF_APPLSETTING1_CONFIG_CHANGEABLE = 0x08
 
const byte DF_APPLSETTING1_SAME_KEY_NEEDED = 0xE0
 
const byte DF_APPLSETTING1_ALL_KEYS_FROZEN = 0xF0
 
const byte DF_APPLSETTING2_ISO_EF_IDS = 0x20
 
const byte DF_APPLSETTING2_DES_OR_3DES2K = 0x00
 
const byte DF_APPLSETTING2_3DES3K = 0x40
 
const byte DF_APPLSETTING2_AES = 0x80
 
const int DF_ISO_WRAPPING_OFF = 0
 
const int DF_ISO_WRAPPING_CARD = 1
 
const int DF_ISO_WRAPPING_READER = 2
 

Detailed Description

Description of DESFire.

Description of DESFire_write.

Description of DESFire_wrap.

Description of DESFire_types.

Description of DESFire_trans.

Description of DESFire_records.

Description of DESFire_read.

Description of DESFire_mgmt.

Description of DESFire_mac.

Description of DESFire_keys.

Description of DESFire_files.

Description of DESFire_crc.

Description of DESFire_const.

Description of DESFire_core.

Description of DESFire_auth.

Member Function Documentation

◆ AbortTransaction()

long SpringCard.PCSC.CardHelpers.Desfire.AbortTransaction ( )

f* DesfireAPI/AbortTransaction

NAME AbortTransaction

SYNOPSIS

[[sprox_desfire.dll]] SWORD SPROX_Desfire_AbortTransaction(void);

[[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_AbortTransaction(SPROX_INSTANCE rInst);

[[pcsc_desfire.dll]] LONG SSCardDesfire_AbortTransaction(SCARDHANDLE hCard);

DESCRIPTION Invalidates all previous write access' on Backup Data Files, Value Files and Record Files within one application

RETURNS DF_OPERATION_OK : operation succeeded Other code if internal or communication error has occured.

NOTES Invalidates all write access to files with integrated backup mechanisms without changing the authentication status
SEE ALSO CommitTransaction

◆ Authenticate()

long SpringCard.PCSC.CardHelpers.Desfire.Authenticate ( byte  bKeyNumber,
byte []  pbAccessKey 
)

f* DesfireAPI/Authenticate

NAME Authenticate

DESCRIPTION Perform authentication using the specified DES or 3DES key on the currently selected DESFIRE application. This is the legacy function, available even on DESFIRE EV0. The generated session key is afterwards used for non-ISO ciphering or macing.

SYNOPSIS

[[sprox_desfire.dll]] SWORD SPROX_Desfire_Authenticate(BYTE bKeyNumber, const BYTE pbAccessKey[16]);

[[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_Authenticate(SPROX_INSTANCE rInst, BYTE bKeyNumber, const BYTE pbAccessKey[16]);

[[pcsc_desfire.dll]] LONG SCardDesfire_Authenticate(SCARDHANDLE hCard, BYTE bKeyNumber, const BYTE pbAccessKey[16]);

INPUTS BYTE bKeyNumber : number of the key (KeyNo) const BYTE pbAccessKey[16] : 16-byte Access Key (DES/3DES2K keys)

RETURNS DF_OPERATION_OK : authentication succeed Other code if internal or communication error has occured.

NOTES Both DES and 3DES keys are stored in strings consisting of 16 bytes :

  • If the 2nd half of the key string is equal to the 1st half, the key is handled as a single DES key by the DESFIRE card.
  • If the 2nd half of the key string is NOT equal to the 1st half, the key is handled as a 3DES key.

SEE ALSO AuthenticateIso24 AuthenticateIso AuthenticateAes ChangeKeySettings GetKeySettings ChangeKey GetKeyVersion

◆ AuthenticateAes()

long SpringCard.PCSC.CardHelpers.Desfire.AuthenticateAes ( byte  bKeyNumber,
byte []  pbAccessKey 
)

f* DesfireAPI/AuthenticateAes

NAME AuthenticateAes

DESCRIPTION Perform authentication using the specified AES key on the currently selected DESFIRE application. This function is not available on DESFIRE EV0 cards. The generated session key is afterwards used for ISO ciphering or CMACing.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_AuthenticateAes(byte bKeyNumber, const byte pbAccessKey[16]);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_AuthenticateAes(SPROX_INSTANCE rInst, byte bKeyNumber, const byte pbAccessKey[16]);

[[pcsc_desfire.dll]] LONG SCardDesfire_AuthenticateAes(SCARDHANDLE hCard, byte bKeyNumber, const byte pbAccessKey[16]);

INPUTS byte bKeyNumber : number of the key (KeyNo) const byte pbAccessKey[16] : 16-byte Access Key (AES)

RETURNS DF_OPERATION_OK : authentication succeed Other code if internal or communication error has occured.

NOTES AES keys are always 128-bit long.

SEE ALSO Authenticate AuthenticateIso24 AuthenticateIso ChangeKeySettings GetKeySettings ChangeKey GetKeyVersion

◆ AuthenticateIso()

long SpringCard.PCSC.CardHelpers.Desfire.AuthenticateIso ( byte  bKeyNumber,
byte []  pbAccessKey 
)

f* DesfireAPI/AuthenticateIso

NAME AuthenticateIso

DESCRIPTION Perform authentication using the specified 3DES key on the currently selected DESFIRE application. The generated session key is afterwards used for ISO ciphering or CMACing. This function is not available on DESFIRE EV0 cards.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_AuthenticateIso(byte bKeyNumber, const byte pbAccessKey[16]);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_AuthenticateIso(SPROX_INSTANCE rInst, byte bKeyNumber, const byte pbAccessKey[16]);

[[pcsc_desfire.dll]] LONG SCardDesfire_AuthenticateIso(SCARDHANDLE hCard, byte bKeyNumber, const byte pbAccessKey[16]);

INPUTS byte bKeyNumber : number of the key (KeyNo) const byte pbAccessKey[16] : 16-byte Access Key (DES/3DES2K keys)

RETURNS DF_OPERATION_OK : authentication succeed Other code if internal or communication error has occured.

NOTES Both DES and 3DES keys are stored in strings consisting of 16 bytes :

  • If the 2nd half of the key string is equal to the 1st half, the 64-bit key is handled as a single DES key by the DESFIRE card (well, actually there are only 56 significant bits).
  • If the 2nd half of the key string is NOT equal to the 1st half, the key is a 128 bit 3DES key (well, actually there are only 112 significant bits).

SEE ALSO Authenticate AuthenticateIso24 AuthenticateAes ChangeKeySettings GetKeySettings ChangeKey GetKeyVersion

◆ AuthenticateIso24()

long SpringCard.PCSC.CardHelpers.Desfire.AuthenticateIso24 ( byte  bKeyNumber,
byte []  pbAccessKey 
)

f* DesfireAPI/AuthenticateIso24

NAME AuthenticateIso24

DESCRIPTION Perform authentication using the specified 3DES key on the currently selected DESFIRE application. The generated session key is afterwards used for ISO ciphering or CMACing. This function is not available on DESFIRE EV0 cards.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_AuthenticateIso24(byte bKeyNumber, const byte pbAccessKey[24]);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_AuthenticateIso24(SPROX_INSTANCE rInst, byte bKeyNumber, const byte pbAccessKey[24]);

[[pcsc_desfire.dll]] LONG SCardDesfire_AuthenticateIso24(SCARDHANDLE hCard, byte bKeyNumber, const byte pbAccessKey[24]);

INPUTS byte bKeyNumber : number of the key (KeyNo) const byte pbAccessKey[24] : 24-byte Access Key (DES/3DES2K/3DES3K keys)

RETURNS DF_OPERATION_OK : authentication succeed Other code if internal or communication error has occured.

NOTES Both DES and 3DES keys are stored in strings consisting of 24 bytes :

  • If the 2nd third of the key string is equal to the 1st third, the 64-bit key is handled as a single DES key by the DESFIRE card (well, actually there are only 56 significant bits).
  • If the 2nd third of the key string is NOT equal to the 1st third AND the 3rd third is equal to the 1st third, the key is a 128 bit 3DES key (well, actually there are only 112 significant bits).
  • Overwise, the key is a 192 bit 3DES key "3DES3K mode" (well, actually (well, actually there are only 168 significant bits).

SEE ALSO Authenticate AuthenticateIso AuthenticateAes ChangeKeySettings GetKeySettings ChangeKey GetKeyVersion

◆ ChangeFileSettings()

long SpringCard.PCSC.CardHelpers.Desfire.ChangeFileSettings ( byte  file_id,
byte  comm_mode,
UInt16  access_rights 
)

f* DesfireAPI/ChangeFileSettings

NAME ChangeFileSettings

DESCRIPTION Changes the access parameters of an existing file

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_ChangeFileSettings(byte file_id, byte comm_mode, UInt16 access_rights);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_ChangeFileSettings(SPROX_INSTANCE rInst, byte file_id, byte comm_mode, UInt16 access_rights);

[[pcsc_desfire.dll]] LONG SCardDesfire_ChangeFileSettings(SCARDHANDLE hCard, byte file_id, byte comm_mode, UInt16 access_rights);

INPUTS byte file_id : DESFIRE File IDentifier byte comm_mode : file's Communication Settings UInt16 access_rights : file's Access Rights

RETURNS DF_OPERATION_OK : change succeeded Other code if internal or communication error has occured.

NOTES Please refer to DESFIRE datasheet for details regarding this function and its acceptable parameters.

SEE ALSO GetFileIDs GetFileSettings

◆ ChangeKey()

long SpringCard.PCSC.CardHelpers.Desfire.ChangeKey ( byte  key_number,
byte []  new_key,
byte []  old_key 
)

f* DesfireAPI/ChangeKey

NAME ChangeKey

DESCRIPTION Change a DES, or 3DES2K key in the selected Desfire application.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_ChangeKey(byte key_number, const byte new_key[16], const byte old_key[16]);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_ChangeKey(SPROX_INSTANCE rInst, byte key_number, const byte new_key[16], const byte old_key[16]);

[[pcsc_desfire.dll]] LONG SCardDesfire_ChangeKey(SCARDHANDLE hCard, byte key_number, const byte new_key[16], const byte old_key[16]);

INPUTS byte key_number : number of the key (KeyNo) const byte new_key[16] : 16-byte New Key (DES/3DES keys) const byte old_key[16] : 16-byte Old Key (DES/3DES keys)

RETURNS DF_OPERATION_OK : change succeeded Other code if internal or communication error has occured.

NOTES Both DES and 3DES keys are stored in strings consisting of 16 bytes :

  • If the 2nd half of the key string is equal to the 1st half, the key is handled as a single DES key by the DesFire card.
  • If the 2nd half of the key string is NOT equal to the 1st half, the key is handled as a 3DES key.

After a successful change of the key used to reach the current authentication status, this authentication is invalidated, an authentication with the new key is necessary for subsequent operations.

If authentication has been performed before calling ChangeKey with the old key, use null instead of old_key.

SEE ALSO ChangeKey24 ChangeKeyAes Authenticate ChangeKeySettings GetKeySettings GetKeyVersion

◆ ChangeKey24()

long SpringCard.PCSC.CardHelpers.Desfire.ChangeKey24 ( byte  key_number,
byte []  new_key,
byte []  old_key 
)

f* DesfireAPI/ChangeKey24

NAME ChangeKey24

DESCRIPTION Change a 3DES3K key in the selected Desfire application.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_ChangeKey24(byte key_number, const byte new_key[24], const byte old_key[24]);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_ChangeKey24(SPROX_INSTANCE rInst, byte key_number, const byte new_key[24], const byte old_key[24]);

[[pcsc_desfire.dll]] LONG SCardDesfire_ChangeKey24(SCARDHANDLE hCard, byte key_number, const byte new_key[24], const byte old_key[24]);

INPUTS byte key_number : number of the key (KeyNo) const byte new_key[24] : 24-byte New Key (3DES keys) const byte old_key[24] : 24-byte Old Key (3DES keys)

RETURNS DF_OPERATION_OK : change succeeded Other code if internal or communication error has occured.

SEE ALSO ChangeKey16 ChangeKeyAes Authenticate ChangeKeySettings GetKeySettings GetKeyVersion

◆ ChangeKeyAes()

long SpringCard.PCSC.CardHelpers.Desfire.ChangeKeyAes ( byte  key_number,
byte  key_version,
byte []  new_key,
byte []  old_key 
)

f* DesfireAPI/ChangeKeyAes

NAME ChangeKeyAes

DESCRIPTION Change an AES key in the selected Desfire application.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_ChangeKeyAes(byte key_number, byte key_version, const byte new_key[16], const byte old_key[16]);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_ChangeKeyAes(SPROX_INSTANCE rInst, byte key_number, byte key_version, const byte new_key[16], const byte old_key[16]);

[[pcsc_desfire.dll]] LONG SCardDesfire_ChangeKeyAes(SCARDHANDLE hCard, byte key_number, byte key_version, const byte new_key[16], const byte old_key[16]);

INPUTS byte key_number : number of the key (KeyNo) byte key_version : version number to be stored together with the key const byte new_key[16] : 16-byte New Key (AES key) const byte old_key[16] : 16-byte Old Key (AES key)

RETURNS DF_OPERATION_OK : change succeeded Other code if internal or communication error has occured.

SEE ALSO ChangeKey ChangeKey24 Authenticate ChangeKeySettings GetKeySettings GetKeyVersion

◆ ChangeKeySettings()

long SpringCard.PCSC.CardHelpers.Desfire.ChangeKeySettings ( byte  key_settings)

h* DesfireAPI/Keys

NAME DesfireAPI :: Key management functions

COPYRIGHT (c) 2009 SpringCard - www.springcard.com

DESCRIPTION Implementation of management functions to change keys or key settings withing a DESFIRE application.f* DesfireAPI/ChangeKeySettings

NAME ChangeKeySettings

DESCRIPTION Changes the key settings of the currently selected application (or of card's master key if root application is selected)

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_ChangeKeySettings (byte key_settings);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_ChangeKeySettings(SPROX_INSTANCE rInst, byte key_settings);

[[pcsc_desfire.dll]] LONG SCardDesfire_ChangeKeySettings (SCARDHANDLE hCard, byte key_settings);

INPUTS byte key_settings : new key settings (see chapter 4.3.2 of datasheet of mifare DesFire MF3ICD40 for more information)

RETURNS DF_OPERATION_OK : change succeeded Other code if internal or communication error has occured.

SEE ALSO Authenticate GetKeySettings ChangeKey GetKeyVersion

◆ ClearRecordFile()

long SpringCard.PCSC.CardHelpers.Desfire.ClearRecordFile ( byte  file_id)

h* DesfireAPI/Records

NAME DesfireAPI :: Linear or cyclic file related functions

COPYRIGHT (c) 2009 SpringCard - www.springcard.com

DESCRIPTION Implementation of DESFIRE functions to handle structured files.f* DesfireAPI/ClearRecordFile

NAME Desfire_ClearRecordFile

DESCRIPTION Allows to reset a Cyclic or Linear Record File to the empty state

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_ClearRecordFile(byte file_id);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_ClearRecordFile(SPROX_INSTANCE rInst, byte file_id);

[[pcsc_desfire.dll]] LONG SCardDesfire_ClearRecordFile(SCARDHANDLE hCard, byte file_id);

INPUTS byte file_id : File IDentifier

RETURNS DF_OPERATION_OK : success, data has been written Other code if internal or communication error has occured.

NOTES Full "Read&Write" permission on the file is necessary for executing this command

◆ CommitTransaction()

long SpringCard.PCSC.CardHelpers.Desfire.CommitTransaction ( )

h* DesfireAPI/Transactions

NAME DesfireAPI :: Transaction functions

COPYRIGHT (c) 2009 SpringCard - www.springcard.com

DESCRIPTION Implementation of DESFIRE transaction-related functions.f* DesfireAPI/CommitTransaction

NAME CommitTransaction

DESCRIPTION Validates all previous write access' on Backup Data Files, Value Files and Record Files within one application

SYNOPSIS

[[sprox_desfire.dll]] SWORD SPROX_Desfire_CommitTransaction(void);

[[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_CommitTransaction(SPROX_INSTANCE rInst);

[[pcsc_desfire.dll]] LONG SCardDesfire_CommitTransaction(SCARDHANDLE hCard);

RETURNS DF_OPERATION_OK : operation succeeded Other code if internal or communication error has occured.

NOTES Validates all write access to files with integrated backup mechanisms

SEE ALSO AbortTransaction

◆ CreateApplication()

long SpringCard.PCSC.CardHelpers.Desfire.CreateApplication ( UInt32  aid,
byte  key_setting_1,
byte  key_setting_2 
)

f* DesfireAPI/CreateApplication

NAME CreateApplication

DESCRIPTION Create a new application on the DesFire card

SYNOPSIS

[[sprox_desfire.dll]] SWORD SPROX_Desfire_CreateApplication(DWORD aid, BYTE key_setting_1, BYTE key_setting_2);

[[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_CreateApplication(SPROX_INSTANCE rInst, DWORD aid, BYTE key_setting_1, BYTE key_setting_2);

[[pcsc_desfire.dll]] LONG SCardDesfire_CreateApplication(SCARDHANDLE hCard, DWORD aid, BYTE key_setting_1, BYTE key_setting_2);

INPUTS DWORD aid : Application IDentifier BYTE key_setting_1 : Settings of the Application master key (see chapter 4.3.2 of datasheet of mifare DesFire MF3ICD40 for more information) BYTE key_setting_2 : Number of keys that can be stored within the application for cryptographic purposes, plus flags to specify cryptographic method and to enable giving ISO names to the EF.

RETURNS DF_OPERATION_OK : application created successfully Other code if internal or communication error has occured.

SEE ALSO CreateApplicationIso DeleteApplication GetApplicationIDs SelectApplication

◆ CreateBackupDataFile()

long SpringCard.PCSC.CardHelpers.Desfire.CreateBackupDataFile ( byte  file_id,
byte  comm_mode,
UInt16  access_rights,
UInt32  file_size 
)

f* DesfireAPI/CreateBackupDataFile

NAME CreateBackupDataFile

DESCRIPTION Creates files for the storage of plain unformatted user data within an existing application on the DESFIRE card, additionally supporting the feature of integrated backup mechanism

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_CreateBackupDataFile(byte file_id, byte comm_mode, UInt16 access_rights, UInt32 file_size);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_CreateBackupDataFile(SPROX_INSTANCE rInst, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 file_size);

[[pcsc_desfire.dll]] LONG SCardDesfire_CreateBackupDataFile(SCARDHANDLE hCard, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 file_size);

INPUTS byte file_id : DESFIRE File IDentifier byte comm_mode : file's Communication Settings UInt16 access_rights : file's Access Rights UInt32 file_size : size of the file in bytes

RETURNS DF_OPERATION_OK : Backup Data File succeeded Other code if internal or communication error has occured.

NOTES Please refer to DESFIRE datasheet for details regarding this function and its acceptable parameters.

SEE ALSO CreateStdDataFile CreateValueFile CreateLinearRecordFile CreateCyclicRecordFile DeleteFile

◆ CreateCyclicRecordFile()

long SpringCard.PCSC.CardHelpers.Desfire.CreateCyclicRecordFile ( byte  file_id,
byte  comm_mode,
UInt16  access_rights,
UInt32  record_size,
UInt32  max_records 
)

f* DesfireAPI/CreateCyclicRecordFile

NAME CreateCyclicRecordFile

DESCRIPTION Creates a cyclic record file

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_CreateCyclicRecordFile(byte file_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_CreateCyclicRecordFile(SPROX_INSTANCE rInst, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records);

[[pcsc_desfire.dll]] LONG SCardDesfire_CreateCyclicRecordFile(SCARDHANDLE hCard, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records);

INPUTS byte file_id : DESFIRE File IDentifier byte comm_mode : file's Communication Settings UInt16 access_rights : file's Access Rights UInt32 file_size : size of the file in bytes UInt32 record_size : size of one single record in bytes UInt32 max_records : maximum number of records

RETURNS DF_OPERATION_OK : file created successfully Other code if internal or communication error has occured.

NOTES Please refer to DESFIRE datasheet for details regarding this function and its acceptable parameters.

SEE ALSO CreateStdDataFile CreateBackupDataFile CreateValueFile CreateLinearRecordFile DeleteFile

◆ CreateIsoApplication()

long SpringCard.PCSC.CardHelpers.Desfire.CreateIsoApplication ( UInt32  aid,
byte  key_setting_1,
byte  key_setting_2,
UInt16  iso_df_id,
byte []  iso_df_name,
byte  iso_df_namelen 
)

f* DesfireAPI/CreateIsoApplication

NAME CreateIsoApplication

DESCRIPTION Create a new application on the DesFire card, and defines the ISO identifier and name of the application

SYNOPSIS

[[sprox_desfire.dll]] SWORD SPROX_Desfire_CreateIsoApplication(DWORD aid, BYTE key_setting_1, BYTE key_setting_2, WORD iso_df_id, const BYTE iso_df_name[], BYTE iso_df_namelen);

[[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_CreateIsoApplication(SPROX_INSTANCE rInst, DWORD aid, BYTE key_setting_1, BYTE key_setting_2, WORD iso_df_id, const BYTE iso_df_name[], BYTE iso_df_namelen);

[[pcsc_desfire.dll]] LONG SCardDesfire_CreateIsoApplication(SCARDHANDLE hCard, DWORD aid, BYTE key_setting_1, BYTE key_setting_2, WORD iso_df_id, const BYTE iso_df_name[], BYTE iso_df_namelen);

INPUTS DWORD aid : Application IDentifier BYTE key_setting_1 : Settings of the Application master key (see chapter 4.3.2 of datasheet of mifare DesFire MF3ICD40 for more information) BYTE key_setting_2 : Number of keys that can be stored within the application for cryptographic purposes, plus flags to specify cryptographic method and to enable giving ISO names to the EF. BYTE iso_df_id : ID of the ISO DF const BYTE iso_df_name[] : name of the ISO DF BYTE iso_df_namelen : length of iso_df_name

RETURNS DF_OPERATION_OK : application created successfully Other code if internal or communication error has occured.

SEE ALSO CreateApplication DeleteApplication GetApplicationIDs SelectApplication

◆ CreateIsoBackupDataFile()

long SpringCard.PCSC.CardHelpers.Desfire.CreateIsoBackupDataFile ( byte  file_id,
UInt16  iso_ef_id,
byte  comm_mode,
UInt16  access_rights,
UInt32  file_size 
)

f* DesfireAPI/CreateIsoBackupDataFile

NAME CreateIsoBackupDataFile

DESCRIPTION Creates files for the storage of plain unformatted user data within an existing application on the DESFIRE card, additionally supporting the feature of integrated backup mechanism. Using this function, an ISO EF IDentifier is specified as well as a legacy DESFIRE File ID.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_CreateIsoBackupDataFile(byte file_id, UInt16 iso_ef_id, byte comm_mode, UInt16 access_rights, UInt32 file_size);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_CreateIsoBackupDataFile(SPROX_INSTANCE rInst, UInt16 iso_ef_id, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 file_size);

[[pcsc_desfire.dll]] LONG SCardDesfire_CreateIsoBackupDataFile(SCARDHANDLE hCard, UInt16 iso_ef_id, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 file_size);

INPUTS byte file_id : DESFIRE File IDentifier UInt16 iso_ef_id : IDentifier of the EF for ISO 7816-4 applications byte comm_mode : file's Communication Settings UInt16 access_rights : file's Access Rights UInt32 file_size : size of the file in bytes

RETURNS DF_OPERATION_OK : Backup Data File succeeded Other code if internal or communication error has occured.

NOTES Please refer to DESFIRE datasheet for details regarding this function and its acceptable parameters.

SEE ALSO CreateStdDataFile CreateValueFile CreateLinearRecordFile CreateCyclicRecordFile DeleteFile

◆ CreateIsoCyclicRecordFile()

long SpringCard.PCSC.CardHelpers.Desfire.CreateIsoCyclicRecordFile ( byte  file_id,
UInt16  iso_ef_id,
byte  comm_mode,
UInt16  access_rights,
UInt32  record_size,
UInt32  max_records 
)

f* DesfireAPI/CreateIsoCyclicRecordFile

NAME CreateIsoCyclicRecordFile

DESCRIPTION Creates a cyclic record file. Using this function, an ISO EF IDentifier is specified as well as a legacy DESFIRE File ID.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_CreateIsoCyclicRecordFile(byte file_id, UInt16 iso_ef_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_CreateIsoCyclicRecordFile(SPROX_INSTANCE rInst, UInt16 iso_ef_id, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records);

[[pcsc_desfire.dll]] LONG SCardDesfire_CreateIsoCyclicRecordFile(SCARDHANDLE hCard, UInt16 iso_ef_id, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records);

INPUTS byte file_id : DESFIRE File IDentifier UInt16 iso_ef_id : IDentifier of the EF for ISO 7816-4 applications byte comm_mode : file's Communication Settings UInt16 access_rights : file's Access Rights UInt32 file_size : size of the file in bytes UInt32 record_size : size of one single record in bytes UInt32 max_records : maximum number of records

RETURNS DF_OPERATION_OK : file created successfully Other code if internal or communication error has occured.

NOTES Please refer to DESFIRE datasheet for details regarding this function and its acceptable parameters.

SEE ALSO CreateStdDataFile CreateBackupDataFile CreateValueFile CreateLinearRecordFile DeleteFile

◆ CreateIsoLinearRecordFile()

long SpringCard.PCSC.CardHelpers.Desfire.CreateIsoLinearRecordFile ( byte  file_id,
UInt16  iso_ef_id,
byte  comm_mode,
UInt16  access_rights,
UInt32  record_size,
UInt32  max_records 
)

f* DesfireAPI/CreateIsoLinearRecordFile

NAME CreateIsoLinearRecordFile

DESCRIPTION Creates a linear record file. Using this function, an ISO EF IDentifier is specified as well as a legacy DESFIRE File ID.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_CreateIsoLinearRecordFile(byte file_id, UInt16 iso_ef_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_CreateIsoLinearRecordFile(SPROX_INSTANCE rInst, UInt16 iso_ef_id, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records);

[[pcsc_desfire.dll]] LONG SCardDesfire_CreateIsoLinearRecordFile(SCARDHANDLE hCard, UInt16 iso_ef_id, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records);

INPUTS byte file_id : DESFIRE File IDentifier UInt16 iso_ef_id : IDentifier of the EF for ISO 7816-4 applications byte comm_mode : file's Communication Settings UInt16 access_rights : file's Access Rights UInt32 record_size : size of one single record in bytes UInt32 max_records : maximum number of records

RETURNS DF_OPERATION_OK : file created successfully Other code if internal or communication error has occured.

NOTES Please refer to DESFIRE datasheet for details regarding this function and its acceptable parameters.

SEE ALSO CreateStdDataFile CreateBackupDataFile CreateValueFile CreateCyclicRecordFile DeleteFile

◆ CreateIsoStdDataFile()

long SpringCard.PCSC.CardHelpers.Desfire.CreateIsoStdDataFile ( byte  file_id,
UInt16  iso_ef_id,
byte  comm_mode,
UInt16  access_rights,
UInt32  file_size 
)

f* DesfireAPI/CreateIsoStdDataFile

NAME CreateIsoStdDataFile

DESCRIPTION Creates files for the storage of plain unformatted user data within an existing application on the DESFIRE card. Using this function, an ISO EF IDentifier is specified as well as a legacy DESFIRE File ID.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_CreateIsoStdDataFile(byte file_id, UInt16 iso_ef_id, byte comm_mode, UInt16 access_rights, UInt32 file_size);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_CreateIsoStdDataFile(SPROX_INSTANCE rInst, UInt16 iso_ef_id, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 file_size);

[[pcsc_desfire.dll]] LONG SCardDesfire_CreateIsoStdDataFile(SCARDHANDLE hCard, UInt16 iso_ef_id, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 file_size);

INPUTS byte file_id : DESFIRE File IDentifier UInt16 iso_ef_id : IDentifier of the EF for ISO 7816-4 applications byte comm_mode : file's Communication Settings UInt16 access_rights : file's Access Rights UInt32 file_size : size of the file in bytes

RETURNS DF_OPERATION_OK : creation succeeded Other code if internal or communication error has occured.

NOTES Please refer to DESFIRE datasheet for details regarding this function and its acceptable parameters.

SEE ALSO CreateBackupDataFile CreateValueFile CreateLinearRecordFile CreateCyclicRecordFile DeleteFile

◆ CreateLinearRecordFile()

long SpringCard.PCSC.CardHelpers.Desfire.CreateLinearRecordFile ( byte  file_id,
byte  comm_mode,
UInt16  access_rights,
UInt32  record_size,
UInt32  max_records 
)

f* DesfireAPI/CreateLinearRecordFile

NAME CreateLinearRecordFile

DESCRIPTION Creates a linear record file

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_CreateLinearRecordFile(byte file_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_CreateLinearRecordFile(SPROX_INSTANCE rInst, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records);

[[pcsc_desfire.dll]] LONG SCardDesfire_CreateLinearRecordFile(SCARDHANDLE hCard, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 record_size, UInt32 max_records);

INPUTS byte file_id : DESFIRE File IDentifier byte comm_mode : file's Communication Settings UInt16 access_rights : file's Access Rights UInt32 record_size : size of one single record in bytes UInt32 max_records : maximum number of records

RETURNS DF_OPERATION_OK : file created successfully Other code if internal or communication error has occured.

NOTES Please refer to DESFIRE datasheet for details regarding this function and its acceptable parameters.

SEE ALSO CreateStdDataFile CreateBackupDataFile CreateValueFile CreateCyclicRecordFile DeleteFile

◆ CreateStdDataFile()

long SpringCard.PCSC.CardHelpers.Desfire.CreateStdDataFile ( byte  file_id,
byte  comm_mode,
UInt16  access_rights,
UInt32  file_size 
)

f* DesfireAPI/CreateStdDataFile

NAME CreateStdDataFile

DESCRIPTION Creates files for the storage of plain unformatted user data within an existing application on the DESFIRE card

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_CreateStdDataFile(byte file_id, byte comm_mode, UInt16 access_rights, UInt32 file_size);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_CreateStdDataFile(SPROX_INSTANCE rInst, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 file_size);

[[pcsc_desfire.dll]] LONG SCardDesfire_CreateStdDataFile(SCARDHANDLE hCard, byte file_id, byte comm_mode, UInt16 access_rights, UInt32 file_size);

INPUTS byte file_id : DESFIRE File IDentifier byte comm_mode : file's Communication Settings UInt16 access_rights : file's Access Rights UInt32 file_size : size of the file in bytes

RETURNS DF_OPERATION_OK : creation succeeded Other code if internal or communication error has occured.

NOTES Please refer to DESFIRE datasheet for details regarding this function and its acceptable parameters.

SEE ALSO CreateBackupDataFile CreateValueFile CreateLinearRecordFile CreateCyclicRecordFile DeleteFile

◆ CreateValueFile()

long SpringCard.PCSC.CardHelpers.Desfire.CreateValueFile ( byte  file_id,
byte  comm_mode,
UInt16  access_rights,
long  lower_limit,
long  upper_limit,
long  initial_value,
byte  limited_credit_enabled 
)

f* DesfireAPI/CreateValueFile

NAME CreateValueFile

DESCRIPTION Creates files for storage and manipulation of 32bit signed integer values within an existing application on the DESFIRE card

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_CreateValueFile(byte file_id, byte comm_mode, UInt16 access_rights, LONG lower_limit, LONG upper_limit, LONG initial_value, byte limited_credit_enabled);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_CreateValueFile(SPROX_INSTANCE rInst, byte file_id, byte comm_mode, UInt16 access_rights, LONG lower_limit, LONG upper_limit, LONG initial_value, byte limited_credit_enabled);

[[pcsc_desfire.dll]] LONG SCardDesfire_CreateValueFile(SCARDHANDLE hCard, byte file_id, byte comm_mode, UInt16 access_rights, LONG lower_limit, LONG upper_limit, LONG initial_value, byte limited_credit_enabled);

INPUTS byte file_id : DESFIRE File IDentifier byte comm_mode : file's Communication Settings UInt16 access_rights : file's Access Rights LONG lower_limit : lower limit which is valid for this file. The lower limit marks the boundary which must not be passed by a Debit calculation on the current value LONG upper_limit : the upper limit which sets the boundary in the same manner but for the Credit operation LONG initial_value : specifies the initial value of the value file byte limited_credit_enabled : activation of the LimitedCredit feature (0 disabled, 1 enabled)

RETURNS DF_OPERATION_OK : file created Other code if internal or communication error has occured.

NOTES Please refer to DESFIRE datasheet for details regarding this function and its acceptable parameters.

SEE ALSO CreateStdDataFile CreateBackupDataFile CreateLinearRecordFile CreateCyclicRecordFile DeleteFile

◆ DeleteApplication()

long SpringCard.PCSC.CardHelpers.Desfire.DeleteApplication ( UInt32  aid)

f* DesfireAPI/DeleteApplication

NAME DeleteApplication

DESCRIPTION Permanently deactivates an application on the DesFire card

SYNOPSIS

[[sprox_desfire.dll]] SWORD SPROX_Desfire_DeleteApplication(DWORD aid);

[[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_DeleteApplication(SPROX_INSTANCE rInst, DWORD aid);

[[pcsc_desfire.dll]] LONG SCardDesfire_DeleteApplication(SCARDHANDLE hCard, DWORD aid);

INPUTS DWORD aid : Application IDentifier

RETURNS DF_OPERATION_OK : application deleted successfully Other code if internal or communication error has occured.

SEE ALSO CreateApplication GetApplicationIDs SelectApplication

◆ DeleteFile()

long SpringCard.PCSC.CardHelpers.Desfire.DeleteFile ( byte  file_id)

f* DesfireAPI/DeleteFile

NAME DeleteFile

DESCRIPTION Permanently deactivates a file within the file directory of the currently selected application

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_DeleteFile(byte file_id);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_DeleteFile(SPROX_INSTANCE rInst, byte file_id);

[[pcsc_desfire.dll]] LONG SCardDesfire_DeleteFile(SCARDHANDLE hCard, byte file_id);

INPUTS byte file_id : DESFIRE File IDentifier

RETURNS DF_OPERATION_OK : File deleted successfully Other code if internal or communication error has occured.

NOTES Please refer to DESFIRE datasheet for details regarding this function and its acceptable parameters.

SEE ALSO CreateStdDataFile CreateBackupDataFile CreateValueFile CreateLinearRecordFile CreateCyclicRecordFile

◆ FormatPICC()

long SpringCard.PCSC.CardHelpers.Desfire.FormatPICC ( )

f* DesfireAPI/FormatPICC

NAME FormatPICC

DESCRIPTION Releases the DesFire card user memory

SYNOPSIS

[[sprox_desfire.dll]] SWORD SPROX_Desfire_FormatPICC(void);

[[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_FormatPICC(SPROX_INSTANCE rInst);

[[pcsc_desfire.dll]] LONG SCardDesfire_FormatPICC(SCARDHANDLE hCard);

RETURNS DF_OPERATION_OK : format succeeded Other code if internal or communication error has occured.

NOTES All applications are deleted and all files within those applications are deleted. This command always requires a preceding authentication with the DesFire card master key.

◆ GetApplicationIDs()

long SpringCard.PCSC.CardHelpers.Desfire.GetApplicationIDs ( byte  aid_max_count,
ref UInt32 []  aid_list,
ref byte  aid_count 
)

f* DesfireAPI/GetApplicationIDs

NAME GetApplicationIDs

DESCRIPTION Returns the Application IDentifiers of all active applications on a DesFire card

SYNOPSIS

[[sprox_desfire.dll]] SWORD SPROX_Desfire_GetApplicationIDs(BYTE aid_max_count, DWORD aid_list[], BYTE *aid_count);

[[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_GetApplicationIDs(SPROX_INSTANCE rInst, BYTE aid_max_count, DWORD aid_list[], BYTE *aid_count);

[[pcsc_desfire.dll]] LONG SCardDesfire_GetApplicationIDs(SCARDHANDLE hCard, BYTE aid_max_count, DWORD aid_list[], BYTE *aid_count);

INPUTS BYTE aid_max_count : maximum number of Application IDentifiers DWORD aid_list[] : Application IDentifier list BYTE *aid_count : number of Application IDentifiers on DesFire card

RETURNS DF_OPERATION_OK : operation succeeded Other code if internal or communication error has occured.

SEE ALSO CreateApplication DeleteApplication SelectApplication

◆ GetCardUID()

long SpringCard.PCSC.CardHelpers.Desfire.GetCardUID ( out byte []  uid)

f* DesfireAPI/GetCardUID

NAME GetCardUID

DESCRIPTION Reads out the 7-byte serial number of the PICC

SYNOPSIS

[[sprox_desfire.dll]] SWORD SPROX_Desfire_GetCardUID(BYTE uid[7]);

[[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_GetCardUID(SPROX_INSTANCE rInst, BYTE uid[7]);

[[pcsc_desfire.dll]] LONG SCardDesfire_GetCardUID(SCARDHANDLE hCard, BYTE uid[7]);

RETURNS DF_OPERATION_OK : operation succeeded Other code if internal or communication error has occured.

NOTES This command must be preceded by an authentication (with any key).

◆ GetFileIDs()

long SpringCard.PCSC.CardHelpers.Desfire.GetFileIDs ( byte  fid_max_count,
byte []  fid_list,
ref byte  fid_count 
)

f* DesfireAPI/GetFileIDs

NAME GetFileIDs

DESCRIPTION Returns the DESFIRE File IDentifiers of all active files within the currently selected application

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_GetFileIDs(byte fid_max_count, byte fid_list[], byte *fid_count);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_GetFileIDs(SPROX_INSTANCE rInst, byte fid_max_count, byte fid_list[], byte *fid_count);

[[pcsc_desfire.dll]] LONG SCardDesfire_GetFileIDs(SCARDHANDLE hCard, byte fid_max_count, byte fid_list[], byte *fid_count);

INPUTS byte fid_max_count : maximum number of DESFIRE File IDentifiers byte fid_list[] : DESFIRE File IDentifiers list byte *fid_count : number of DESFIRE File IDentifiers in the selected application

RETURNS DF_OPERATION_OK : operation succeeded Other code if internal or communication error has occured.

NOTES Please refer to DESFIRE datasheet for details regarding this function and the returned values.

SEE ALSO GetFileSettings ChangeFileSettings

◆ GetFileSettings()

long SpringCard.PCSC.CardHelpers.Desfire.GetFileSettings ( byte  file_id,
out byte  file_type,
out byte  comm_mode,
out UInt16  access_rights,
out DF_FILE_SETTINGS  additionnal_settings 
)

t* DesfireAPI/DF_ADDITIONAL_FILE_SETTINGS

NAME DF_ADDITIONAL_FILE_SETTINGS

DESCRIPTION Union for returning the information supplied by the GetFileSettings command. Use stDataFileSettings for Standard Data Files and Backup Data Files. Use stValueFileSettings for Value Files. Use stRecordFileSettings for Linear Record Files and Cyclic Record Files.

SOURCE typedef union { struct { UInt32 eFileSize; //user file size } stDataFileSettings;

struct { LONG lLowerLimit; // lower limit of the file LONG lUpperLimit; // upper limit of the file UInt32 eLimitedCredit; // limited credit value byte bLimitedCreditEnabled; // limited credit enabled } stValueFileSettings;

struct { UInt32 eRecordSize; // record size UInt32 eMaxNRecords; // maximum number of records UInt32 eCurrNRecords; // current number of records } stRecordFileSettings; } DF_ADDITIONAL_FILE_SETTINGS;f* DesfireAPI/GetFileSettings

NAME GetFileSettings

DESCRIPTION Get information on the properties of a specific file

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_GetFileSettings(byte file_id, byte *file_type, byte *comm_mode, UInt16 *access_rights, DF_ADDITIONAL_FILE_SETTINGS *additionnal_settings);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_GetFileSettings(SPROX_INSTANCE rInst, byte file_id, byte *file_type, byte *comm_mode, UInt16 *access_rights, DF_ADDITIONAL_FILE_SETTINGS *additionnal_settings);

[[pcsc_desfire.dll]] LONG SCardDesfire_GetFileSettings(SCARDHANDLE hCard, byte file_id, byte *file_type, byte *comm_mode, UInt16 *access_rights, DF_ADDITIONAL_FILE_SETTINGS *additionnal_settings);

INPUTS byte file_id : DESFIRE File IDentifier byte *file_type : type of file (DF_STANDARD_DATA_FILE, DF_BACKUP_DATA_FILE, DF_VALUE_FILE, DF_LINEAR_RECORD_FILE or DF_CYCLIC_RECORD_FILE) byte *comm_mode : file's Communication Settings UInt16 *access_rights : file's Access Rights DF_ADDITIONAL_FILE_SETTINGS *additionnal_settings : information file

RETURNS DF_OPERATION_OK : operation succeeded Other code if internal or communication error has occured.

NOTES Please refer to DESFIRE datasheet for details regarding this function and the returned values.

SEE ALSO GetFileIDs ChangeFileSettings

◆ GetFreeMemory()

long SpringCard.PCSC.CardHelpers.Desfire.GetFreeMemory ( ref UInt32  pdwFreeBytes)

NAME DesfireAPI :: Card management functions

COPYRIGHT (c) 2009 SpringCard - www.springcard.com

DESCRIPTION Implementation of management functions to personalize or format the DESFIRE card. f* DesfireAPI/GetFreeMemory

NAME GetFreeMemory

DESCRIPTION Reads out the number of available bytes on the PICC

SYNOPSIS

[[sprox_desfire.dll]] SWORD SPROX_Desfire_GetFreeMemory(DWORD *pdwFreeBytes);

[[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_GetFreeMemory(SPROX_INSTANCE rInst, DWORD *pdwFreeBytes);

[[pcsc_desfire.dll]] LONG SCardDesfire_GetFreeMemory(SCARDHANDLE hCard, DWORD *pdwFreeBytes);

INPUTS DWORD *pdwFreeBytes : number of free bytes on the PICC

RETURNS DF_OPERATION_OK : operation succeeded Other code if internal or communication error has occured.

NOTES This command can be issued without valid authentication.

◆ GetIsoApplications()

long SpringCard.PCSC.CardHelpers.Desfire.GetIsoApplications ( byte  app_max_count,
List< DF_ISO_APPLICATION_ST app_list,
ref byte  app_count 
)

f* DesfireAPI/Desfire_GetIsoApplications

NAME Desfire_GetIsoApplications

DESCRIPTION Returns the Application IDentifiers, ISO DF IDs and ISO DF Names of all active applications on a DesFire card having an ISO DF ID / DF Name

SYNOPSIS

[[sprox_desfire.dll]] SWORD SPROX_Desfire_GetIsoApplications(BYTE app_max_count, DF_ISO_APPLICATION_ST app_list[], BYTE *app_count);

[[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_GetIsoApplications(SPROX_INSTANCE rInst, BYTE app_max_count, DF_ISO_APPLICATION_ST app_list[], BYTE *app_count);

[[pcsc_desfire.dll]] LONG SCardDesfire_GetIsoApplications(SCARDHANDLE hCard, BYTE app_max_count, DF_ISO_APPLICATION_ST app_list[], BYTE *app_count);

INPUTS BYTE app_max_count : maximum number of Applications DF_ISO_APPLICATION_ST app_list[] : list of Applications BYTE *app_count : number of Applications on DesFire card

RETURNS DF_OPERATION_OK : operation succeeded Other code if internal or communication error has occured.

SEE ALSO CreateIsoApplication GetApplicationIDs

◆ GetIsoFileIDs()

long SpringCard.PCSC.CardHelpers.Desfire.GetIsoFileIDs ( byte  fid_max_count,
UInt16 []  fid_list,
ref byte  fid_count 
)

f* DesfireAPI/GetIsoFileIDs

NAME GetIsoFileIDs

DESCRIPTION Returns the File IDentifiers of all active files within the currently selected application

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_GetIsoFileIDs(byte fid_max_count, UInt16 fid_list[], byte *fid_count);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_GetIsoFileIDs(SPROX_INSTANCE rInst, byte fid_max_count, UInt16 fid_list[], byte *fid_count);

[[pcsc_desfire.dll]] LONG SCardDesfire_GetIsoFileIDs(SCARDHANDLE hCard, byte fid_max_count, UInt16 fid_list[], byte *fid_count);

INPUTS byte fid_max_count : maximum number of File IDentifiers UInt16 fid_list[] : File IDentifiers list byte *fid_count : number of File IDentifiers in the selected application

RETURNS DF_OPERATION_OK : operation succeeded Other code if internal or communication error has occured.

SEE ALSO GetFileIDs GetIsoDFNames

◆ GetKeySettings()

long SpringCard.PCSC.CardHelpers.Desfire.GetKeySettings ( ref byte  key_settings,
ref byte  key_count 
)

f* DesfireAPI/GetKeySettings

NAME GetKeySettings

DESCRIPTION Gets information on the DesFire card and application master key settings. In addition it returns the maximum number of keys which can be stored within the selected application.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_GetKeySettings (byte *key_settings, byte *key_count);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_GetKeySettings(SPROX_INSTANCE rInst, byte *key_settings, byte *key_count);

[[pcsc_desfire.dll]] LONG SCardDesfire_GetKeySettings (SCARDHANDLE hCard, byte *key_settings, byte *key_count);

INPUTS byte *key_settings : master key settings (see chapter 4.3.2 of datasheet of mifare DesFire MF3ICD40 for more information) byte *key_count : maximum number of keys

RETURNS DF_OPERATION_OK : operation succeeded Other code if internal or communication error has occured.

SEE ALSO Authenticate ChangeKeySettings ChangeKey GetKeyVersion

◆ GetKeyVersion()

long SpringCard.PCSC.CardHelpers.Desfire.GetKeyVersion ( byte  bKeyNumber,
ref byte  pbKeyVersion 
)

f* DesfireAPI/GetKeyVersion

NAME GetKeyVersion

DESCRIPTION Reads out the current key version of any key stored on the PICC

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_GetKeyVersion(byte bKeyNumber, byte *pbKeyVersion);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_GetKeyVersion(SPROX_INSTANCE rInst, byte bKeyNumber, byte *pbKeyVersion);

[[pcsc_desfire.dll]] LONG SCardDesfire_GetKeyVersion(SCARDHANDLE hCard, byte bKeyNumber, byte *pbKeyVersion);

INPUTS byte bKeyNumber : number of the key (KeyNo) byte *pbKeyVersion : current version of the specified key

RETURNS DF_OPERATION_OK : operation succeeded Other code if internal or communication error has occured.

NOTES This command can be issued without valid authentication.

SEE ALSO Authenticate GetKeySettings ChangeKeySettings ChangeKey

◆ GetVersion()

long SpringCard.PCSC.CardHelpers.Desfire.GetVersion ( out DF_VERSION_INFO  VersionInfo)

t* DesfireAPI/DF_VERSION_INFO

NAME DF_VERSION_INFO

DESCRIPTION Structure for returning the information supplied by the GetVersion command.

SOURCE typedef struct { // hardware related information BYTE bHwVendorID; // vendor ID (0x04 for NXP) BYTE bHwType; // type (0x01) BYTE bHwSubType; // subtype (0x01) BYTE bHwMajorVersion; // major version number BYTE bHwMinorVersion; // minor version number BYTE bHwStorageSize; // storage size (0x18 = 4096 bytes) BYTE bHwProtocol; // communication protocol type (0x05 meaning ISO 14443-2 and -3)

// software related information BYTE bSwVendorID; // vendor ID (0x04 for NXP) BYTE bSwType; // type (0x01) BYTE bSwSubType; // subtype (0x01) BYTE bSwMajorVersion; // major version number BYTE bSwMinorVersion; // minor version number BYTE bSwStorageSize; // storage size (0x18 = 4096 bytes) BYTE bSwProtocol; // communication protocol type (0x05 meaning ISO 14443-3 and -4)

BYTE abUid[7]; // unique serial number BYTE abBatchNo[5]; // production batch number BYTE bProductionCW; // calendar week of production BYTE bProductionYear; // year of production } DF_VERSION_INFO; f* DesfireAPI/GetVersion

NAME GetVersion

DESCRIPTION Returns manufacturing related data of the DesFire card

SYNOPSIS

[[sprox_desfire.dll]] SWORD SPROX_Desfire_GetVersion(DF_VERSION_INFO *pVersionInfo);

[[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_GetVersion(SPROX_INSTANCE rInst, DF_VERSION_INFO *pVersionInfo);

[[pcsc_desfire.dll]] LONG SCardDesfire_GetVersion(SCARDHANDLE hCard, DF_VERSION_INFO *pVersionInfo);

INPUTS DF_VERSION_INFO *pVersionInfo : card's version information

RETURNS DF_OPERATION_OK : operation succeeded Other code if internal or communication error has occured.

◆ PrepareCreateFileCommand()

void SpringCard.PCSC.CardHelpers.Desfire.PrepareCreateFileCommand ( byte  create_cmd,
byte  file_id,
Int32  iso_ef_id,
byte  comm_mode,
UInt16  access_rights 
)

h* DesfireAPI/Files

NAME DesfireAPI :: File management functions

COPYRIGHT (c) 2009 SpringCard - www.springcard.com

DESCRIPTION Implementation of management functions to create or delete files withing a DESFIRE application.

◆ ReadData()

long SpringCard.PCSC.CardHelpers.Desfire.ReadData ( byte  file_id,
byte  comm_mode,
UInt32  from_offset,
UInt32  max_count,
ref byte []  data,
ref UInt32  done_count 
)

f* DesfireAPI/ReadData

NAME ReadData

DESCRIPTION Allows to read data from Standard Data File or Backup Data File

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_ReadData(byte file_id, byte comm_mode, UInt32 from_offset, UInt32 max_count, byte data[], UInt32 *done_count);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_ReadData(SPROX_INSTANCE rInst, byte file_id, byte comm_mode, UInt32 from_offset, UInt32 max_count, byte data[], UInt32 *done_count);

[[pcsc_desfire.dll]] LONG SCardDesfire_ReadData(SCARDHANDLE hCard, byte file_id, byte comm_mode, UInt32 from_offset, UInt32 max_count, byte data[], UInt32 *done_count);

INPUTS byte file_id : File IDentifier byte comm_mode : file's communication settings (DF_COMM_MODE_PLAIN, DF_COMM_MODE_MACED, DF_COMM_MODE_PLAIN2 or DF_COMM_MODE_ENCIPHERED)(see chapter 3.2 of datasheet of mifare DesFire MF3ICD40 for more information) UInt32 from_offset : starting position for the read operation UInt32 max_count : maximum data length to read. Set to 0 to read whole file byte data[] : buffer to receive the data UInt32 *done_count : actual data length read

RETURNS DF_OPERATION_OK : success, data has been read Other code if internal or communication error has occured.

SEE ALSO ReadData2

◆ ReadData2()

long SpringCard.PCSC.CardHelpers.Desfire.ReadData2 ( byte  file_id,
UInt32  from_offset,
UInt32  max_count,
ref byte []  data,
ref UInt32  done_count 
)

f* DesfireAPI/ReadData2

NAME ReadData2

DESCRIPTION Allows to read data from Standard Data File or Backup Data File

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_ReadData2(byte file_id, UInt32 from_offset, UInt32 max_count, byte data[], UInt32 *done_count);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_ReadData2(SPROX_INSTANCE rInst, byte file_id, UInt32 from_offset, UInt32 max_count, byte data[], UInt32 *done_count);

[[pcsc_desfire.dll]] LONG SCardDesfire_ReadData2(SCARDHANDLE hCard, byte file_id, UInt32 from_offset, UInt32 max_count, byte data[], UInt32 *done_count);

INPUTS byte file_id : File IDentifier UInt32 from_offset : starting position for the read operation in bytes UInt32 max_count : maximum data length to read. Set to 0 to read whole file byte data[] : buffer to receive the data UInt32 *done_count : actual data length read

RETURNS DF_OPERATION_OK : success, data has been read Other code if internal or communication error has occured.

SEE ALSO ReadData

◆ ReadDataEx()

long SpringCard.PCSC.CardHelpers.Desfire.ReadDataEx ( byte  read_command,
byte  file_id,
byte  comm_mode,
UInt32  from_offset,
UInt32  item_count,
UInt32  item_size,
ref byte []  data,
ref UInt32  done_size 
)

h* DesfireAPI/Read

NAME DesfireAPI :: Core of the reading functions

COPYRIGHT (c) 2009 SpringCard - www.springcard.com

DESCRIPTION Implementation of the various DESFIRE read functions.

◆ ReadRecords()

long SpringCard.PCSC.CardHelpers.Desfire.ReadRecords ( byte  file_id,
byte  comm_mode,
UInt32  from_record,
UInt32  max_record_count,
UInt32  record_size,
ref byte []  data,
ref UInt32  record_count 
)

f* DesfireAPI/ReadRecords

NAME ReadRecords

DESCRIPTION Allows to read data out a set of complete records from a Cyclic or Linear Record File.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_ReadRecords(byte file_id, byte comm_mode, UInt32 from_record, UInt32 max_record_count, UInt32 record_size, byte data[], UInt32 *record_count);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_ReadRecords(SPROX_INSTANCE rInst, byte file_id, byte comm_mode, UInt32 from_record, UInt32 max_record_count, UInt32 record_size, byte data[], UInt32 *record_count);

[[pcsc_desfire.dll]] LONG SCardDesfire_ReadRecords(SCARDHANDLE hCard, byte file_id, byte comm_mode, UInt32 from_record, UInt32 max_record_count, UInt32 record_size, byte data[], UInt32 *record_count);

INPUTS byte file_id : File IDentifier byte comm_mode : file's communication settings (DF_COMM_MODE_PLAIN, DF_COMM_MODE_MACED, DF_COMM_MODE_PLAIN2 or DF_COMM_MODE_ENCIPHERED)(see chapter 3.2 of datasheet of mifare DesFire MF3ICD40 for more information) UInt32 from_record : offset of the newest record to read. Set to 0 for latest record UInt32 max_record_count : number of records to be read from the PICC. Set to 0 to read all records. UInt32 record_size : size of the record in bytes byte data[] : buffer to receive the data UInt32 *record_count : actual number of records read

RETURNS DF_OPERATION_OK : success, data has been read Other code if internal or communication error has occured.

SEE ALSO ReadRecords2

◆ ReadRecords2()

long SpringCard.PCSC.CardHelpers.Desfire.ReadRecords2 ( byte  file_id,
UInt32  from_record,
UInt32  max_record_count,
UInt32  record_size,
ref byte []  data,
ref UInt32  record_count 
)

f* DesfireAPI/ReadRecords2

NAME ReadRecords2

DESCRIPTION Allows to read data out a set of complete records from a Cyclic or Linear Record File.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_ReadRecords2(byte file_id, UInt32 from_record, UInt32 max_record_count, UInt32 record_size, byte data[], UInt32 *record_count);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_ReadRecords2(SPROX_INSTANCE rInst, byte file_id, UInt32 from_record, UInt32 max_record_count, UInt32 record_size, byte data[], UInt32 *record_count);

[[pcsc_desfire.dll]] LONG SCardDesfire_ReadRecords2(SCARDHANDLE hCard, byte file_id, byte comm_mode, UInt32 from_record, UInt32 max_record_count, UInt32 record_size, byte data[], UInt32 *record_count);

INPUTS byte file_id : File IDentifier UInt32 from_record : offset of the newest record to read. Set to 0 for latest record UInt32 max_record_count : number of records to be read from the PICC. Set to 0 to read all records. UInt32 record_size : size of the record in bytes byte data[] : buffer to receive the data UInt32 *record_count : actual number of records read

RETURNS DF_OPERATION_OK : success, data has been read Other code if internal or communication error has occured.

SEE ALSO ReadRecords

◆ SelectApplication()

long SpringCard.PCSC.CardHelpers.Desfire.SelectApplication ( UInt32  aid)

f* DesfireAPI/SelectApplication

NAME SelectApplication

DESCRIPTION Selects one specific application for further access

SYNOPSIS

[[sprox_desfire.dll]] SWORD SPROX_Desfire_SelectApplication(DWORD aid);

[[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_SelectApplication(SPROX_INSTANCE rInst, DWORD aid);

[[pcsc_desfire.dll]] LONG SCardDesfire_SelectApplication(SCARDHANDLE hCard, DWORD aid);

INPUTS DWORD aid : Application IDentifier

RETURNS DF_OPERATION_OK : application selected Other code if internal or communication error has occured.

SEE ALSO CreateApplication DeleteApplication GetApplicationIDs

◆ SetConfiguration()

long SpringCard.PCSC.CardHelpers.Desfire.SetConfiguration ( byte  option,
byte []  data,
byte  length 
)

f* DesfireAPI/SetConfiguration

NAME SetConfiguration

DESCRIPTION Sends the SetConfiguration command to the DESFIRE card.

SYNOPSIS

[[sprox_desfire.dll]] SWORD SPROX_Desfire_SetConfiguration(BYTE option, const BYTE data[], BYTE length);

[[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_SetConfiguration(SPROX_INSTANCE rInst, BYTE option, const BYTE data[], BYTE length);

[[pcsc_desfire.dll]] LONG SCardDesfire_SetConfiguration(SCARDHANDLE hCard, BYTE option, const BYTE data[], BYTE length);

INPUTS

RETURNS DF_OPERATION_OK : operation succeeded Other code if internal or communication error has occured.

NOTES Read DESFIRE EV1 manual, chapter 9.4.9 for details. DO NOT USE THIS COMMAND unless you're really sure you know what you're doing!!!

◆ WriteData()

long SpringCard.PCSC.CardHelpers.Desfire.WriteData ( byte  file_id,
byte  comm_mode,
UInt32  from_offset,
UInt32  size,
byte []  data 
)

h* DesfireAPI/Write

NAME DesfireAPI :: Core of the writing functions

COPYRIGHT (c) 2009 SpringCard - www.springcard.com

DESCRIPTION Implementation of the various DESFIRE write functions.f* DesfireAPI/WriteData

NAME WriteData

DESCRIPTION Allows to write data from Standard Data File or Backup Data File

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_WriteData(byte file_id, byte comm_mode, UInt32 from_offset, UInt32 size, const byte data[]);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_WriteData(SPROX_INSTANCE rInst, byte file_id, byte comm_mode, UInt32 from_offset, UInt32 size, const byte data[]);

[[pcsc_desfire.dll]] LONG SCardDesfire_WriteData(SCARDHANDLE hCard, byte file_id, byte comm_mode, UInt32 from_offset, UInt32 size, const byte data[]);

INPUTS byte file_id : File IDentifier byte comm_mode : file's communication settings (DF_COMM_MODE_PLAIN, DF_COMM_MODE_MACED, DF_COMM_MODE_PLAIN2 or DF_COMM_MODE_ENCIPHERED)(see chapter 3.2 of datasheet of mifare DesFire MF3ICD40 for more information) UInt32 from_offset : starting position for the write operation in bytes UInt32 size : size of the buffer in bytes byte data[] : buffer to write to the card

RETURNS DF_OPERATION_OK : success, data has been written Other code if internal or communication error has occured.

SEE ALSO WriteData2

◆ WriteData2()

long SpringCard.PCSC.CardHelpers.Desfire.WriteData2 ( byte  file_id,
UInt32  from_offset,
UInt32  size,
byte []  data 
)

f* DesfireAPI/WriteData2

NAME WriteData2

DESCRIPTION Allows to write data from Standard Data File or Backup Data File

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_WriteData2(byte file_id, UInt32 from_offset, UInt32 size, const byte data[]);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_WriteData2(SPROX_INSTANCE rInst, byte file_id, UInt32 from_offset, UInt32 size, const byte data[]);

[[pcsc_desfire.dll]] LONG SCardDesfire_WriteData2(SCARDHANDLE hCard, byte file_id, UInt32 from_offset, UInt32 size, const byte data[]);

INPUTS byte file_id : File IDentifier UInt32 from_offset : starting position for the write operation in bytes UInt32 size : size of the buffer in bytes byte data[] : buffer to write to the card

RETURNS DF_OPERATION_OK : success, data has been written Other code if internal or communication error has occured.

SEE ALSO WriteData

◆ WriteRecord()

long SpringCard.PCSC.CardHelpers.Desfire.WriteRecord ( byte  file_id,
byte  comm_mode,
UInt32  from_offset,
UInt32  size,
byte []  data 
)

f* DesfireAPI/WriteRecord

NAME WriteRecord

DESCRIPTION Allows to write data to a record in a Cyclic or Linear Record File.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_WriteRecord(byte file_id, byte comm_mode, UInt32 from_offset, UInt32 size, const byte data[]);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_WriteRecord(SPROX_INSTANCE rInst, byte file_id, byte comm_mode, UInt32 from_offset, UInt32 size, const byte data[]);

[[pcsc_desfire.dll]] LONG SCardDesfire_WriteRecord(SCARDHANDLE hCard, byte file_id, byte comm_mode, UInt32 from_offset, UInt32 size, const byte data[]);

INPUTS byte file_id : File IDentifier byte comm_mode : file's communication settings (DF_COMM_MODE_PLAIN, DF_COMM_MODE_MACED, DF_COMM_MODE_PLAIN2 or DF_COMM_MODE_ENCIPHERED)(see chapter 3.2 of datasheet of mifare DesFire MF3ICD40 for more information) UInt32 from_offset : offset within one single record in bytes UInt32 size : size data to be written in bytes byte data[] : buffer containing the data to write

RETURNS DF_OPERATION_OK : success, data has been written Other code if internal or communication error has occured.

SEE ALSO WriteRecord2

◆ WriteRecord2()

long SpringCard.PCSC.CardHelpers.Desfire.WriteRecord2 ( byte  file_id,
UInt32  from_offset,
UInt32  size,
byte []  data 
)

f* DesfireAPI/WriteRecord2

NAME WriteRecord2

DESCRIPTION Allows to write data to a record in a Cyclic or Linear Record File.

SYNOPSIS

[[sprox_desfire.dll]] SUInt16 SPROX_Desfire_WriteRecord2(byte file_id, UInt32 from_offset, UInt32 size, const byte data[]);

[[sprox_desfire_ex.dll]] SUInt16 SPROXx_Desfire_WriteRecord2(SPROX_INSTANCE rInst, byte file_id, UInt32 from_offset, UInt32 size, const byte data[]);

[[pcsc_desfire.dll]] LONG SCardDesfire_WriteRecord2(SCARDHANDLE hCard, byte file_id, UInt32 from_offset, UInt32 size, const byte data[]);

INPUTS byte file_id : File IDentifier UInt32 from_offset : offset within one single record in bytes UInt32 size : size data to be written in bytes byte data[] : buffer containing the data to write

RETURNS DF_OPERATION_OK : success, data has been written Other code if internal or communication error has occured.

SEE ALSO WriteRecord


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