I am using an ACR122U NFC reader/writer and a MIFARE Classic 1K card. To load authentication keys for the MIFARE card, I use the following APDU command:
FF 82 20 00 06 FF FF FF FF FF FF
The reader responds with 90 00
(indicating success). However, on another PC I have the same reader/writer and the same tag but I receive the response code 63 00
, which means that the operation failed.
When I read the ACR122U documentation it states the command as
FF 82 00 00 06 <KEY>
This byte is named key structure and its value is 00 in the documentation. Can this byte be the source of this problem?
Can anyone help me on this and explain the value of the key structure byte?
I'm rather surprised that you found one ACR122U that supports key structure (P1) set to 0x20. The API manual of the reader (see section 5.1 Load Authentication Keys) clearly indicates that values other than 0x00 are reserved (i.e. must not be used). This means that the ACR122U only supports card keys (i.e. authentication keys for cards) in volatile memory (i.e. keys are cleared from memory when the reader is unplugged).
You can find the definition of the key structure (P1) byte in the PC/SC specification (in Part 3. Requirements for PC-Connected Interface Devices):