简体   繁体   中英

Java card APDU delete command gives '69' '85' error code

I have a .cap file installed into java card. I am trying to delete that .cap file through APDU command message but its giving '69' '85' Conditions of use not satisfied. PFB steps that i have done to delete .cap file.

Steps to delete applet from java card:

I am done with Mutual Authentication Command :

a) Initialize update

b) External Authenicate

and getting '90' '00' as response which means my authentication is done.

Now i am trying to fire delete command to delete .cap file

Delete command

[CMD]80E40080074F050104070205

CLS : 80

INS : E4

P1 : 00

P2 : 80

Lc : 07

Data: 4F 05 0104070205

4F : Application or Executable Load File to delete shall be specified using the tag for an AID ('4F')

05 : length of AID

AID : 0104070205

getting response as'69' '85' Conditions of use not satisfied.

Note:-While sending [CMD]80E40080074F050104070205 directly through jSDSCTool, there also i am getting 69' '82' Security status not satisfied.

I am getting [Wrapped CMD] while deleting package through jSDSCTool.

[Wrapped CMD]84E400800F4F0501040702059412B4E480D17991

please explain what is [Wrapped CMD] here and what is last 8 byte of [Wrapped CMD] 84E4....9412B4E480D17991

Reference Link that i have followed to create command message

getting response as'69' '85' Conditions of use not satisfied.

There are multiple reasons for getting status word 6985 on delete command. The common ones are listed below.

  1. The package you are trying to delete is used by another applet, therefore JCRE will not allow deletion of this package in the first place.
  2. The applet you are going to delete is having some reference of static array in it. De-referencing the array on deletion is necessary, otherwise it cannot be deleted.
  3. It is a system pack and cannot be deleted.

please explain what is [Wrapped CMD] here

This delete command is send with a secure messaging wrapper (CLA: 84h), hence it is having MAC attached (last 8 bytes) to it. Because this MAC is wrongly calculated, so you are receiving 6982. Check K_MAC for this.

There is no need for secure messaging command to delete the package/applet. so check above 3 conditions in you applet.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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