C API for BALTECH SDK

§ brp_Desfire_Authenticate()

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 
)

This command authenticates a card with the reader. All authentication modes of DESFire cards are supported. Subsequent commands, such as Desfire.ExecCommand, take the authentication mode into account when communicating with a card.

The key used for authentication is specified in the Device / CryptoKey key of the reader's configuration.

Parameters
[in]protocolused to execute the command
[in]SecureMessagingSets the secure messaging mode.
[in]DesKeynrDESFire key number.
[in]KeyIdID of authentication key in the reader's configuration (0x00-0xBF).
[in]KeyHasDivDataSpecifies external diversification data (KeyDivData parameter) if set.
[in]KeyDivModeSpecifies diversification algorithm.
[in]KeyHasExtIdxSet this flag if extended crypto memory is used (using KeyExtIdx parameter).
[in]KeyDivDataDiversification data (8 byte for DES / 16 for AES key).
[in]KeyDivData_len
[in]KeyExtIdxCrypto Memory Index (SAM or CryptoMemory) of authentication key * SAM: Key version (0..0xFF) * Crypto Memory: Page (0..15)