gpshell" delete_key"命令返回6a80(数据错误)

时间:2016-04-20 16:18:21

标签: javacard globalplatform

我在javacard中使用不同的密钥版本导入了几个GlobalPlatform键。我可以通过新密钥创建安全通道但是当我想删除其中一个时,我收到sw = 6a80结果。我的剧本是:

mode_211
enable_trace
establish_context
card_connect -readerNumber 1
select -AID A000000018434D00
open_sc -security 0 -keyind 0 -keyver 02 -mac_key 47454d5850524553534f53414d504c45-enc_key 47454d5850524553534f53414d504c45-kek_key 47454d5850524553534f53414d504c45// Open secure channel
delete_key -keyver 08 -keyind 0
get_status -element 40
card_disconnect
release_contex

我还尝试使用相同的密钥打开安全通道的第二个脚本,但结果是sw = 6a80,

mode_211
enable_trace
establish_context
card_connect -readerNumber 1
select -AID A000000018434D00
open_sc -security 0 -keyind 0 -keyver 08 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f -kek_key 404142434445464748494a4b4c4d4e4f // Open secure channel
delete_key -keyver 08 -keyind 0
get_status -element 40
card_disconnect
release_context

apdu跟踪是:

Command --> 80CA006600
Wrapped command --> 80CA006600
Response <-- 664C734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864
886FC6B03640B06092A864886FC6B040105650B06092B8510864864020103660C060A2B060104012
A026E01029000
Command --> 8050020008919F9B915C23C5D600
Wrapped command --> 8050020008919F9B915C23C5D600
Response <-- 4D0022840106A57C224F020137AFC43375EF54A1A60DF8A01B351A189000
Command --> 8482000010E61BDA493C17D649ED414E4AD2356F3C
Wrapped command --> 8482000010E61BDA493C17D649ED414E4AD2356F3C
Response <-- 9000
delete_key -keyver 08 -keyind 0
Command --> 80E4000006D00100D2010800
Wrapped command --> 80E4000006D00100D2010800
Response <-- 6A80
delete_key() return 0x80206A80 (6A80: Wrong data / Incorrect values in command d
ata.)
get_status -element 40
Command --> 80F24000024F0000
Wrapped command --> 80F24000024F0000
Response <-- 09A0000003080000100007049000

任何人都可以帮助我。非常感谢。

0 个答案:

没有答案