Hi @Kan_Li ,
opening Platform SCP03 using the factory keys (KVN=0x01) (Initialize Update + External Authenticate return 9000). I’m trying to rotate the Platform SCP03 keys to KVN=0x11: ENC/MAC/DEK are AES-128, wrapped with the old DEK via AES Key Wrap (RFC3394, 24-byte ciphertext), and I include a 3-byte KCV (AES-ECB(key, 0x00…00)[0..2]). The new key KCVs are ENC=9D67A9, MAC=9213C0, DEK=741560 (actual keys redacted).
I attempt two PUT KEY formats under SCP03 protection (C-ENC + C-MAC):
(1) KVN in P1, IDs 81/82/83, header 84 D8 11 81, data begins keyType, 0x03, 81 <len> <24B wENC> <KCV>, 82 …, 83 …;
and (2) KVN in DATA, IDs 01/02/03, header 84 D8 80 81 (ADD, multiple), data begins keyType, 0x11, 0x03, 01 <len> <24B wENC> <KCV>, 02 …, 03 …. In both cases I’ve tried keyType=0x88 and 0x0A, and per-component length as 0x18 (wrapped-only) and 0x1B (wrapped+KCV), ensuring the KCV is appended as raw 3 bytes (no extra length).
Both attempts consistently return 6A80 (“wrong data field”).
Questions: which AES key type coding does SE050C1 require in PUT KEY (0x88 vs 0x0A)? Should the component length include the KCV (i.e., 0x1B), with no extra 0x03 tag? Are multi-key updates (P2=0x81) supported for Platform SCP03 here, or must I send three single-key updates (P2=0x00) in order ENC→MAC→DEK? Are IDs 81/82/83 accepted for platform keys on this part, or must I always use 01/02/03?
Any constraints on placing KVN in P1 vs in the data for Platform SCP03 on this applet? I can provide minimal code (payload builder and caller) plus full APDU logs; real keys are redacted but KCVs and lengths are intact.
Thanks
rutwik