简体   繁体   English

为什么 SET STATUS APDU 命令返回 6985?

[英]why SET STATUS APDU command returns 6985?

I have a USIM card and the Card Life Cycle is OP_READY :我有一张 USIM 卡,卡片生命周期为OP_READY

Connected to the Card...

<--> [Mutual Auth]

---> 80 F2 80 00 02 4F 00       
<--- 08 A0 00 00 00 03 00 00 00
     01 <== LifeCycle = OP_READY
     98
     90 00

I want to change the card Life Cycle to SECURED .我想将卡生命周期更改为SECURED Based on the GlobalPlatform Card Specification I have to first change the card life cycle to INITIALIZED and then to SECURED state:根据 GlobalPlatform Card Specification,我必须首先将卡生命周期更改为INITIALIZED ,然后更改为SECURED state:

在此处输入图像描述

And this is the coding of diffe.net Life Cycles in SET STATUS APDU command:这是 diffe.net Life Cycles 在 SET STATUS APDU 命令中的编码:

在此处输入图像描述

So I tried to change the life cycle as below:所以我试图改变生命周期如下:

Connected to Card.

<--> [Mutual Auth with SecLevel = 0x00]

---> 80 F0 80 07 00
<--- **Fail** 6A 86

---> 80 F0 80 0F 00
<--- **Fail** 69 85

As you see above, I received 6A86 (INCORRECT P1-P2 Parameters) for INITIALIZED and 6985 (CONDITIONS OF USE NOT SATISFIED) for SECURED life cycle.正如您在上面看到的,我收到了INITIALIZED的 6A86(不正确的 P1-P2 参数)和SECURED生命周期的 6985(不满足使用条件)。

I also tried the same process with SecLevel=0x03, but nothing changes:我也用 SecLevel=0x03 尝试了相同的过程,但没有任何变化:

Connected to Card.

<--> [Mutual Auth with SecLevel = 0x03]

---> 84 F0 80 07 08 <MAC>
<--- **Fail** 6A 86

---> 84 F0 80 0F 08 <MAC>
<--- **Fail** 69 85

What is wrong?怎么了?

It might be that your card is imposing additional requirements for the state change.可能是您的卡对 state 更改提出了额外要求。 If you have a manual consult it if some special behavior is described.如果您有手册,如果描述了一些特殊行为,请查阅它。

If this is not available my strongest guess would be that the card would like to see some keys to be personalized on the card before the state change is allowed.如果这不可用,我最强烈的猜测是该卡希望在允许 state 更改之前在卡上看到一些要个性化的密钥。 Use a PUT KEY command to update the keys.使用PUT KEY命令更新密钥。 If updating the key using the same key version and index does not work try to create an additional key version.如果使用相同的密钥版本和索引更新密钥不起作用,请尝试创建一个额外的密钥版本。

Although unlikely to succeed, you can also try a STORE DATA command to set the life cycle status.虽然不太可能成功,但您也可以尝试使用 STORE DATA 命令来设置生命周期状态。 The mapping guidelines, 6.13 allows to set the tag 9F70 . 映射指南 6.13允许设置标签9F70

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM