![]()  | 
     BALTECH Docs | 
    C API for BALTECH SDK
   
    
   
   | 
   
| 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 brp_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.
| [in] | protocol | used to execute the command | 
| [in] | SecureMessaging | Sets the secure messaging mode. | 
| [in] | DesKeynr | DESFire key number. | 
| [in] | KeyId | ID of authentication key in the reader's configuration (0x00-0xBF). | 
| [in] | KeyHasDivData | Specifies external diversification data (KeyDivData parameter) if set. | 
| [in] | KeyDivMode | Specifies diversification algorithm. | 
| [in] | KeyHasExtIdx | Set this flag if extended crypto memory is used (using KeyExtIdx parameter). | 
| [in] | KeyDivData | Diversification data (8 byte for DES / 16 for AES key). | 
| [in] | KeyDivData_len | |
| [in] | KeyExtIdx | Crypto Memory Index (SAM or CryptoMemory) of authentication key * SAM: Key version (0..0xFF) * Crypto Memory: Page (0..15) |