C API for BALTECH SDK

§ brp_Desfire_ChangeKey()

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 
)

Modifies a DESFire card key defined in the SAM or crypto memory.

Parameters
[in]protocolused to execute the command
[in]IsKeySetOnly needed for Desfire EV2 with multiple Keysets. If true ,the reader executes the Desfire "ChangeKeyEV2" command instead of the Desfire "ChangeKey" command.
[in]IsMasterKeyHas to be set if the key to change is the PICC Master Key.
[in]IsChangeKeyHas to be set if the key used to authenticate the card is the key that needs to be changed (as specified in KeyNo). In this case, the parameter CurKeyIdx has to be omitted.
[in]KeyNrNumber of card key (0-13) to change.
[in]NewKeyDivModeSpecifies diversification algorithm.
[in]NewKeyHasDivDataActivates key diversification according to NXP AN10922.
[in]NewKeyHasExtIdxActivates key memory expansion.
[in]NewKeyIdxIndex of key in the reader's SAM or crypto memory (configuration range 0x00-0xBF).
[in]CurKeyDivModeSpecifies diversification algorithm.
[in]CurKeyHasDivDataActivates key diversification according to NXP AN10922.
[in]CurKeyHasExtIdxActivates key memory expansion.
[in]CurKeyIdxIndex of key in the reader's SAM or crypto memory (configuration range 0x00-0xBF).
[in]NewKeyDivDataDiversification data of the new key.
[in]NewKeyDivData_len
[in]CurKeyDivDataDiversification data of the current key.
[in]CurKeyDivData_len
[in]NewKeyExtIdxCrypto Memory Index (SAM or CryptoMemory) of new key * SAM: Key version (0..0xFF) * Crypto Memory: Page (0..15)
[in]CurKeyExtIdxCrypto Memory Index (SAM or CryptoMemory) of current key * SAM: Key version (0..0xFF) * Crypto Memory: Page (0..15)
[in]KeySetspecifies a KeySet (needed for multiple keysets - EV2 extension).