Desfire.ChangeKey
Modifies a DESFire card key defined in the SAM or crypto memory.
Properties
- Command code: 0x1B07
- Command timeout: 1000 ms
- Possible status codes: General status codes, Desfire.ErrIso14NoTag, Desfire.ErrBreak, Desfire.ErrIso14Hf, Desfire.ErrIso14CardInvalid, Desfire.ErrReaderChipCommunication, Desfire.ErrIso14ApduCmd, Desfire.ErrIso14InvalidResponse, Desfire.ErrIntegrity, Desfire.ErrPcdKey, Desfire.ErrPcdParam, Desfire.ErrFirmwareNotSupported, Desfire.ErrSamCommunication, Desfire.ErrSamUnlock, Desfire.ErrHardwareNotSupported, Desfire.ErrLength, Desfire.ErrPermissionDenied, Desfire.ErrParameter, Desfire.ErrAuthentication, Desfire.ErrPiccIntegrity, Desfire.ErrCommandAborted, Desfire.ErrEeprom, Desfire.ErrNoSuchKey, Desfire.ErrOutOfMemory, Desfire.ErrIllegalCmd, Desfire.ErrCmdOverflow, Desfire.ErrIllegalCmdLegacy
Parameters (request frame)
Name | Type/Size | Description | ||
---|---|---|---|---|
- | Bit mask (8 bits) | - | ||
RFU | Integer (bit mask area 0xF8) |
Zero padding |
||
IsKeySet | Boolean (bit 0x04) | Only needed for Desfire EV2 with multiple Keysets. If true,the reader executes the Desfire "ChangeKeyEV2" command instead of the Desfire "ChangeKey" command. | ||
IsMasterKey | Boolean (bit 0x02) | Has to be set if the key to change is the PICC Master Key. | ||
IsChangeKey | Boolean (bit 0x01) |
Has 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. |
||
KeyNr | Integer (8 bits) | Number of card key (0-13) to change. | ||
- | Bit mask (8 bits) | - | ||
RFU | Integer (bit mask area 0xE0) |
Zero padding |
||
NewKeyDivMode | Enumeration (bit mask area 0x18) |
Specifies diversification algorithm. Values:
|
||
RFU | Integer (bit 0x04) |
Zero padding |
||
NewKeyHasDivData | Boolean (bit 0x02) | Activates key diversification according to NXP AN10922. | ||
NewKeyHasExtIdx | Boolean (bit 0x01) | Activates key memory expansion. | ||
NewKeyIdx | Integer (8 bits) | Index of key in the reader's SAM or crypto memory (configuration range 0x00-0xBF). | ||
- | Bit mask (8 bits) | - | ||
RFU | Integer (bit mask area 0xE0) |
Zero padding |
||
CurKeyDivMode | Enumeration (bit mask area 0x18) |
Specifies diversification algorithm. Values:
|
||
RFU | Integer (bit 0x04) |
Zero padding |
||
CurKeyHasDivData | Boolean (bit 0x02) | Activates key diversification according to NXP AN10922. | ||
CurKeyHasExtIdx | Boolean (bit 0x01) | Activates key memory expansion. | ||
CurKeyIdx | Integer (8 bits) | Index of key in the reader's SAM or crypto memory (configuration range 0x00-0xBF). | ||
Optional field, condition: NewKeyHasDivData | ||||
Length of NewKeyDivData | Integer (8 bits) |
Length of NewKeyDivData in bytes |
||
NewKeyDivData | Raw data | Diversification data of the new key. | ||
Optional field, condition: CurKeyHasDivData | ||||
Length of CurKeyDivData | Integer (8 bits) |
Length of CurKeyDivData in bytes |
||
CurKeyDivData | Raw data | Diversification data of the current key. | ||
Optional field, condition: NewKeyHasExtIdx | ||||
NewKeyExtIdx | Integer (8 bits) |
Crypto Memory Index (SAM or CryptoMemory) of new key
|
||
Optional field, condition: CurKeyHasExtIdx | ||||
CurKeyExtIdx | Integer (8 bits) |
Crypto Memory Index (SAM or CryptoMemory) of current key
|
||
Optional field, condition: IsKeySet | ||||
KeySet | Integer (8 bits) | specifies a KeySet (needed for multiple keysets - EV2 extension). |
Returned values (response frame)
None