Page 1 of 1
Change GP key
Posted: Wed Sep 14, 2016 2:21 am
by Vlidda
I am trying to change GP key with PUT KEY command.
Would anyone send me an example with APDU commands to do this?
Thanks for any help.
Re: Change GP key
Posted: Wed Sep 14, 2016 5:51 am
by Pf6KINE
Code: Select all
// 1 - Command: Select CardManager;
Command --> 00A4040000
Wrapped command --> 00A4040000
Response <-- 6F5C8408A000000003000000A550734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864886FC6B03640B06092A864886FC6B040255650B06092B8510864864020103660C060A2B060104012A026E01029F6501FF9000
// Establish secure channel;
// 2 - Command: INITIALIZE UPDATE;
Command --> 8050000008F2A5FA8BEF9F8A5100
Wrapped command --> 8050000008F2A5FA8BEF9F8A5100
Response <-- 00000000000000000000FF0200577E919A33292DAC759095BE94B8DC9000
// 3 - Command: EXTERNAL AUTHENTICATE;
Command --> 8482000010F4A3AF0F06816EC8BE390B1FE8FD4539
Wrapped command --> 8482000010F4A3AF0F06816EC8BE390B1FE8FD4539
Response <-- 9000
// 4 - Command: Get Key Information Template;
Command --> 80CA00E000
Wrapped command --> 80CA00E000
// Response (Old key information):
// Key version number: 0xFF
// Key identifier: 0x01 ~ 0x02
// Key length: 0x10
Response <-- E012C00401FF8010C00402FF8010C00403FF80109000
// 5 - Command: PUT KEY;
// P1 == 0x00: Create new key;
// P2: Multiply keys, Key Identifier starts with 0x01;
// DATA: Key data is sensitive data, so encrypted with Data Encryption Key;
Command --> 80D800814301801014D7E04767395F62561FAE76AB69EB3E038BAF47801014D7E04767395F62561FAE76AB69EB3E038BAF47801014D7E04767395F62561FAE76AB69EB3E038BAF4700
Wrapped command --> 80D800814301801014D7E04767395F62561FAE76AB69EB3E038BAF47801014D7E04767395F62561FAE76AB69EB3E038BAF47801014D7E04767395F62561FAE76AB69EB3E038BAF4700
Response <-- 018BAF478BAF478BAF479000
// 6 - Command: Get Key Information Template (After command PUT KEY);
Command --> 80CA00E000
Wrapped command --> 80CA00E000
// Response (New key information):
// Key version number: 0x01
// Key identifier: 0x01 ~ 0x02
// Key length: 0x10
Response <-- E012C00401018010C00402018010C004030180109000