Skip to Main Content

Java Card

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

deleting applet and packages not allowed

803219Oct 5 2010 — edited Oct 28 2011
I have developed an applet in a package, which depends on other 4 packages, for JCOP31 Java cards.

The first time I installed all packages and instantiated the applet, resulting as follows:

======================================================
cm> card-info
=> 80 F2 80 00 02 4F 00 00 .....O..
(192567 usec)
<= 08 A0 00 00 00 03 00 00 00 01 9E 90 00 .............
Status: No Error
=> 80 F2 40 00 02 4F 00 00 ..@..O..
(10712 usec)
<= 07 12 34 56 54 32 27 01 07 00 90 00 ..4VT2'.....
Status: No Error
=> 80 F2 10 00 02 4F 00 00 .....O..
(27025 usec)
<= 07 A0 00 00 00 03 53 50 01 00 01 08 A0 00 00 00 ......SP........
03 53 50 41 05 31 50 41 59 2E 01 00 01 0E 31 50 .SPA.1PAY.....1P
41 59 2E 53 59 53 2E 44 44 46 30 31 06 12 34 56 AY.SYS.DDF01..4V
54 32 28 01 00 00 06 12 34 56 54 32 26 01 00 00 T2(.....4VT2&...
06 12 34 56 54 32 25 01 00 00 06 12 34 56 54 32 ..4VT2%.....4VT2
24 01 00 01 06 12 34 56 54 32 27 90 00 $.....4VT2'..
Status: No Error

Card Manager AID : A000000003000000
Card Manager state : OP_READY

Application: SELECTABLE (--------) 12345654322701 <- explicit instance ID for my applet
Load File : LOADED (--------) A0000000035350 (Security Domain)
Module : A000000003535041
Load File : LOADED (--------) 123456543228 <--
Load File : LOADED (--------) 123456543226 < \ Packages to be loaded for my application
Load File : LOADED (--------) 123456543225 < /
Load File : LOADED (--------) 123456543224 <--
Module : 123456543227 <-- applet
======================================================

The problem appears on running again the same test. With Eclipse IDE I have specified that all elements be deleted before running the whole test again. So the result of the any other subsequent execution of my test shows the following result:

======================================================
cm> /term "winscard:4|OMNIKEY CardMan 5x21 0"
--Opening terminal
/card -a a000000003000000 -c com.ibm.jc.CardManager
resetCard with timeout: 0 (ms)
--Waiting for card...
ATR=3B F8 18 00 00 81 31 FE 45 00 73 C8 40 00 00 90 ;.....1.E.s.@...
00 80 ..
ATR: T=1, FI=1/DI=8 (31clk/etu), N=0, IFSC=254, BWI=4/CWI=5, Hist=0073C84000009000
=> 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00 ..............
(23481 usec)
<= 6F 10 84 08 A0 00 00 00 03 00 00 00 A5 04 9F 65 o..............e
01 FF 90 00 ....
Status: No Error
cm> set-key 255/1/DES-ECB/404142434445464748494a4b4c4d4e4f 255/2/DES-ECB/404142434445464748494a4b4c4d4e4f 255/3/DES-ECB/404142434445464748494a4b4c4d4e4f
cm> init-update 255
=> 80 50 00 00 08 C3 04 80 32 D4 B2 46 5C 00 .P......2..F\.
(60440 usec)
<= 00 00 80 13 04 29 88 91 31 90 FF 02 00 20 A7 33 .....)..1.... .3
9E F3 A3 CB CB C6 AF 86 69 31 91 F9 90 00 ........i1....
Status: No Error
cm> ext-auth plain
=> 84 82 00 00 10 19 FF B7 2B 38 33 2E 35 AE 30 3F ........+83.5.0?
CF E2 15 F5 5D ....]
(46508 usec)
<= 90 00 ..
Status: No Error
cm> delete 12345654322701
=> 80 E4 00 00 09 4F 07 12 34 56 54 32 27 01 00 .....O..4VT2'..
(300078 usec)
<= 69 85 i.
Status: Conditions of use not satisfied
jcshell: Error code: 6985 (Conditions of use not satisfied)
jcshell: Wrong response APDU: 6985
Ignoring expected error
cm> delete 123456543224
=> 80 E4 00 00 08 4F 06 12 34 56 54 32 24 00 .....O..4VT2$.
(20570 usec)
<= 69 85 i.
Status: Conditions of use not satisfied
jcshell: Error code: 6985 (Conditions of use not satisfied)
jcshell: Wrong response APDU: 6985
Ignoring expected error
cm> delete 123456543225
=> 80 E4 00 00 08 4F 06 12 34 56 54 32 25 00 .....O..4VT2%.
(18695 usec)
<= 69 85 i.
Status: Conditions of use not satisfied
jcshell: Error code: 6985 (Conditions of use not satisfied)
jcshell: Wrong response APDU: 6985
Ignoring expected error
cm> delete 123456543226
=> 80 E4 00 00 08 4F 06 12 34 56 54 32 26 00 .....O..4VT2&.
(17372 usec)
<= 69 85 i.
Status: Conditions of use not satisfied
jcshell: Error code: 6985 (Conditions of use not satisfied)
jcshell: Wrong response APDU: 6985
Ignoring expected error
cm> delete 123456543229
=> 80 E4 00 00 08 4F 06 12 34 56 54 32 29 00 .....O..4VT2).
(36164 usec)
<= 6A 88 j.
Status: Reference data not found
jcshell: Error code: 6a88 (Reference data not found)
jcshell: Wrong response APDU: 6A88
Ignoring expected error
cm> delete 123456543228
=> 80 E4 00 00 08 4F 06 12 34 56 54 32 28 00 .....O..4VT2(.
(15125 usec)
<= 69 85 i.
Status: Conditions of use not satisfied
jcshell: Error code: 6985 (Conditions of use not satisfied)
jcshell: Wrong response APDU: 6985
Ignoring expected error
cm> upload -b 250 "C:\Documents and Settings\Administrator\workspace\sclib\bin\cat\urv\crises\smartcard\debug\javacard\debug.cap"
=> 80 E6 02 00 13 06 12 34 56 54 32 28 08 A0 00 00 .......4VT2(....
00 03 00 00 00 00 00 00 00 .........
(14949 usec)
<= 69 85 i.
Status: Conditions of use not satisfied
jcshell: Error code: 6985 (Conditions of use not satisfied)
jcshell: Wrong response APDU: 6985
Unexpected error; aborting execution
======================================================

Note that all packages and modules still exist in the smartcard before executing the test (so that the content is as it appears in the above "card-info" lines), but they cannot be deleted from the smartcard.

The only thing I could see is that, given that the applet cannot be deleted (because it is "not found"), the rest of packages cannot be deleted. I have managed from the JCOP shell into Eclipse to delete any of the packages and module, but all with the same errors as shown in the above logs. However, the given applet can be selected and run (even that cannot be deleted anymore). In simulation mode, the result is exactly the same.

The smartcard is not locked, because I can run another simple applet test, and delete it from the smartcard after any of the executions of this test. So the content of the smartcard should be able to be cleaned with easy "delete"s.

After spending so much time looking into forums and googling, I need some kind help in this point.

I would greatly thank to anybody that could give me some kind of suggestion/tip/trick to do/apply.

Thanks in advance.

Jordi
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 25 2011
Added on Oct 5 2010
18 comments
2,249 views