OP.error.E6.6A80

Hi to all. I am novice to java card programming. Presently i am trying to use the sample programs given in Gemplus examples. I am using GSE(GemXpresso Simulator Environment) and gemplus smart cards.
while trying to install example application i am gettng error as "OP.error.E6.6A80"
Please help me out.
Thanks in advance.

Hello sir the above error(OP.error.E6.6A80) i have solved it with ur help, but now i am trying to generate an RSA key pair and i am getting error as "OP.error.E6.6FB0" and i am using GSE(GemXpresso Simulator Environment), its a GUI, and more over i dont know much about writing APDUs, but the apdus generated while using GSE are,
*** card inserted : Simulator, ATR = 3B 0D 80 31 80 65 B0 83 01 01 F0 83 00 90 00
*** change card: Simulator
Conversion in progress ...
Converter JC2.1 SUN Converter (version 1.2) Result on card GXPPro-R3 :
Java Card 2.1.2 Class File Converter (version 1.2)
Copyright (c) 2001 Sun Microsystems, Inc. All rights reserved.
parsing E:\prasad\programs\Sample\out\com\mq\smartcard\sample\Sample.class
converting com.mq.smartcard.sample.Sample
parsing D:\Gemplus\GemXpresso.rad3\resources\exportfiles\GXPPro-R3\javacard\framework\javacard\framework.exp
parsing D:\Gemplus\GemXpresso.rad3\resources\exportfiles\GXPPro-R3\javacard\security\javacard\security.exp
parsing D:\Gemplus\GemXpresso.rad3\resources\exportfiles\GXPPro-R3\java\lang\javacard\lang.exp
writing E:\prasad\programs\Sample\oncard\GXPPro-R3\com\mq\smartcard\sample\javacard\sample.exp
writing E:\prasad\programs\Sample\oncard\GXPPro-R3\com\mq\smartcard\sample\javacard\sample.jca
conversion completed with 0 errors and 0 warnings.
JC2.1 SUN Converter (version 1.2) process is completed
JCASM program result on card GXPPro-R3 :
Java Card 2.1.2 CAP File Builder (version 0.55)
Copyright (c) 2001 Sun Microsystems, Inc. All rights reserved.
JCAsm process is completed
Converter SAP Converter (version 1.0) Result on card GXPPro-R3 :
SAP file : E:\prasad\programs\Sample\oncard\GXPPro-R3\com\mq\smartcard\sample\javacard\sample.sap done
SAP Converter (version 1.0) process is completed
conversion End.
======================= Authenticate
The target file used is D:\Gemplus\GemXpresso.rad3\resources\targets\GXPPro-R3.properties
CMD: Select
-> 00 A4 04 00 07 A0 00 00 00 18 43 4D
<- 90 00
CMD: Initialize Update
-> 80 50 0D 00 08 00 00 00 00 00 00 00 00 1C
<- 43 4D 01 02 03 04 05 06 07 08 0D 01 C3 3A 50 5E 4B 6E A3 2A 08 A9 93 F0 0B 50 23 D5 90 00
CMD: External Authenticate
-> 84 82 00 00 10 70 C4 49 A3 E2 18 54 AF F6 25 1B 84 39 2B 63 70
<- 90 00
======================= Upload file into a card
CMD: Install for load
-> 80 E6 02 00 15 10 A0 00 00 00 18 FF 00 00 00 00 00 00 00 00 02 05 00 00 00 00 00
<- 90 00
7 blocks to load ...
CMD: Load File
-> 80 E8 00 00 CC C4 82 04 D0 BA CA CA FE 20 01 17 63 6F 6D 2E 6D 71 2E 73 6D 61 72 74 63 61 72 64 2E 73 61 6D 70 6C 65 10 A0 00 00 00 18 FF 00 00 00 00 00 00 00 00 02 05 24 66 69 6C 65 3A 2F 45 3A 2F 70 72 61 73 61 64 2F 70 72 6F 67 72 61 6D 73 2F 53 61 6D 70 6C 65 2F 6F 75 74 2F 06 53 61 6D 70 6C 65 10 A0 00 00 00 18 FF 00 00 00 00 00 00 00 00 02 06 00 00 04 60 1F 8B 08 00 00 00 00 00 00 00 75 55 5D 4F 1B 47 14 3D 8B 97 6C EC 2C 05 F3 19 C0 7C 26 2D C6 7C 38 84 14 42 A0 B4 D8 38 29 05 1C 8A 0D 09 A1 2D 2C 66 71 17 FC D5 F5 3A 94 54 95 DA A7 48 E9 4B 2A D2 87 AA 0F 69 A3 4A 48 7D 2A 52 0B 55 23 55 79 AB D4 1F D0 9F D2 87
<- 90 00
block 1 loaded
CMD: Load File
-> 80 E8 00 01 C8 3E 84 9E D9 05 E2 A8 8E AC BD 73 EF 9C 33 F7 CE 9C 19 CF FC F5 FC F7 3F E0 42 1F 3E 74 1D 1D 1D 3D 17 E6 5F 61 FE 11 E6 A1 82 49 05 D3 0A 66 14 CC 2A 88 2A B8 A9 60 4E C1 FB 0A E6 15 C4 14 C4 15 2C 28 58 F4 C0 8D 36 0F 2A D1 EE 41 39 3A 84 D7 E9 C1 59 5C 10 DE 45 61 5E F7 C0 83 37 DC 44 BB 84 F1 0B D3 2D 86 05 3C 50 D1 A3 62 08 41 61 2E 0B F3 A6 8A 88 08 AF 63 40 C5 0D F4 AA 78 17 7D 2A A6 D0 AF E2 16 26 54 DC C6 3B 2A EE 08 B3 8C 4B 2A 3E C0 15 09 ED FE EE 99 4D ED AE 96 D0 CC F5 60 5E 4F 14 4C C3 DA 09 CE 99 C6 5D CD D2 A7 F5 9D 51 09 6D A5 29 85 B5 94 91 70 18 2E 7F 77 CC B6 8B B6 BD 23 41
<- 90 00
block 2 loaded
CMD: Load File
-> 80 E8 00 02 C8 F6 77 2F 87 24 94 FB 43 31 D1 E9 F3 BF C8 B0 61 6A 69 7D 3B 6B 6E 05 27 E6 26 17 46 05 2C FB 6D 96 E2 5F 0E C5 42 C2 3B 33 66 64 0C 6B 5C 82 C4 24 67 C3 33 13 2B F1 48 2C 4E 62 38 BB AE 4B A8 08 67 33 79 4B CB 58 8B 5A AA C0 D8 13 F9 34 A1 E7 2C 83 BD 12 6A A7 A2 B1 95 1B 91 68 64 7E 22 1E 59 99 8F 4D AC 4C 47 96 24 34 38 DD F1 95 B9 F9 A9 C5 97 90 FA 53 64 21 34 33 15 7E 01 54 CE 18 19 3D 5A 48 AF E9 66 5C 5B 4B B1 50 43 09 21 1C 09 9A 4B 23 73 9A 61 12 3D 17 D3 D2 B9 94 DE 2F 38 9C 6E 2C 5B 30 13 FA 75 43 A4 6C 4D 64 D3 C1 F4 27 C1 7C 5A 33 2D 67 BC CD 0D 3A 43 C8 4E EA 99 E3 4C 12 DC 49 DD
<- 90 00
block 3 loaded
CMD: Load File
-> 80 E8 00 03 C8 0A 15 36 36 74 D3 06 AC E3 8D 72 00 67 4B 1C 7F 5E D7 F2 D9 0C 35 35 84 52 A9 94 84 1A 51 3C 98 D2 32 C9 E0 A9 5C 2F F5 C6 3F 36 B3 DB C7 EB 7C C5 6E 49 68 2C 85 E4 38 51 4B 42 57 09 2C CC 70 BE 90 B1 8C B4 5E 54 B5 A9 04 73 2A 76 73 F8 EA C0 10 CF 5B 69 B0 68 78 67 09 46 6C 27 6F E9 E9 22 52 C7 FF 37 24 6C EE E4 AC 6C 11 A7 F1 95 9B 56 5C E4 14 E3 C9 38 16 3C 6C 5A 24 72 F7 4A 93 4E FE 1B D4 7F EB 24 5F 45 CE 19 4A DC 41 72 66 36 A1 E7 79 62 D5 9C CD 3F 01 2A F3 7A 4A 4F 58 46 26 79 22 AC 62 89 AD 99 B2 D0 C1 FF BF 1B 80 82 46 5C C5 30 24 5C 63 54 06 99 F1 58 51 EC 62 FC 56 51 5C C6 78 BC 28
<- 90 00
block 4 loaded
CMD: Load File
-> 80 E8 00 04 C8 96 F8 F1 4A B0 7D 5E 08 76 7B DB 6E 5D CC C5 AB 84 8C 11 46 7F 33 2A 67 9B 09 1C A2 3A 20 FD 8A 26 DF 90 DC 52 E5 FE 11 63 75 B2 DC E3 1B 5C DD 5D DD 1D 92 85 5F 27 1F 07 C2 53 1E C3 EB 4D C2 B7 DA B2 5A 27 AF EF FE 86 56 52 04 B8 07 6F 0B 41 95 60 CB AA E8 17 49 7D C2 34 EF C1 73 CB 9B FD 99 7D FB AC AE 22 81 0D 9C A1 F7 36 EB 47 51 43 5B C5 D9 54 70 FD 5E A2 D5 FC 6A 68 6B D1 8A 3A F4 A0 1E 83 68 E0 8A CE F3 D2 AB C1 34 9A 31 07 1F 96 D0 86 8F D0 CE 5C D5 CC D6 89 24 2E 20 CD 3C 6E BC C7 35 96 D9 6B 1C 61 56 17 DB 3A 9F F2 04 6E EF E6 17 9C C1 53 94 07 9A 7D 87 A8 DD 27 E0 4C A1 9A 34 C0 2F
<- 90 00
block 5 loaded
CMD: Load File
-> 80 E8 00 05 C8 2E 60 9C 43 80 85 BB 30 CA 1E D9 9E AC C4 52 83 4E 42 69 9C 1C C1 7D D2 73 80 FA D9 C0 01 5A BE 85 BC DF EB 1A AC 7A F8 98 05 32 60 81 5E 79 F0 27 52 F0 B9 78 33 C4 27 2A 04 7E 41 D3 9F 48 06 9E A2 72 A9 DC 2B E3 10 35 54 5C F4 1E A0 2E E0 B4 E7 9F C1 2B 14 73 A2 86 67 A8 A2 74 FB 51 6F B6 AA EF 00 8D B6 A4 7B B8 C8 B8 BD 28 AE 3D 16 D6 91 F8 7B 7A DE CD 2F 6D A1 65 0A B5 C9 DF 6B 76 7B 8F F2 8A F6 01 85 17 ED 23 1E 34 67 F5 9B 68 A2 ED E7 CA 82 5C ED 25 F2 06 28 FB 65 B2 06 F9 5D 61 CF 30 7F 23 7C 7B AE 61 96 BA 2C F3 38 1A 3C 82 9B 3C 54 5B DC 96 6D F2 EE 21 84 CF 10 C6 7D FA 0F 30 89 AF F8
<- 90 00
block 6 loaded
CMD: Load File
-> 80 E8 80 06 20 5C 7D 4D FF 11 47 7D C3 07 EB 3B 3E 55 3F F0 49 2D 56 35 6C 1F CD D0 7F EA F5 C1 C5 6F 07 00 00 00
<- 00 90 00
block 7 loaded
package loaded in 0 s 578 ms
======================= Install
CMD: InstallApplication
-> 80 E6 0C 00 39 10 A0 00 00 00 18 FF 00 00 00 00 00 00 00 00 02 05 10 A0 00 00 00 18 FF 00 00 00 00 00 00 00 00 02 06 10 A0 00 00 00 18 FF 00 00 00 00 00 00 00 00 02 06 01 00 02 C9 00 00 00
<- 6F B0
*** ??? : OP.error.E6.6FB0
waiting for ur response.
Yogesh

Similar Messages

  • Upload external  cap file: jcshell: Error code: 6a80 (Wrong data)?

    Hi,
    i use eclipse + NXP JCOP Plugins_Generic3.2.8_Target ,the card is jcop31v232.
    if the cap file is generated by eclipse project , when i upload exteral cap file ,no error
    but if the cap file is generated by converter command ,there is  error
    what error?help me
    cm> /terminal "winscard:4|Feitian R502 Contact Reader 1"
    --Opening terminal
    /card -a a000000003000000 -c com.ibm.jc.CardManager
    resetCard with timeout: 0 (ms)
    --Waiting for card...
    ATR=3B FA 13 00 00 81 31 FE 45 4A 43 4F 50 33 31 56 ;.....1.EJCOP31V
    32 33 32 93 232.
    IOCTL().
    ATR: T=1, FI=1/DI=3 (93clk/etu), N=0, IFSC=254, BWI=4/CWI=5, Hist="JCOP31V232"> => 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00 ..............
    (104154 usec)
    <= 6F 65 84 08 A0 00 00 00 03 00 00 00 A5 59 9F 65 oe...........Y.e
    01 FF 9F 6E 06 47 91 73 51 2E 00 73 4A 06 07 2A ...n.G.sQ..sJ..*
    86 48 86 FC 6B 01 60 0C 06 0A 2A 86 48 86 FC 6B .H..k.`...*.H..k
    02 02 01 01 63 09 06 07 2A 86 48 86 FC 6B 03 64 ....c...*.H..k.d
    0B 06 09 2A 86 48 86 FC 6B 04 02 15 65 0B 06 09 ...*.H..k...e...
    2B 85 10 86 48 64 02 01 03 66 0C 06 0A 2B 06 01 +...Hd...f...+..
    04 01 2A 02 6E 01 02 90 00 ..*.n....
    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 A7 C7 04 88 8C 87 3F DE 00 .P.........?..
    (68417 usec)
    <= 00 00 93 36 01 29 05 95 13 05 FF 02 00 5F E1 48 ...6.)......._.H
    67 60 FD 2F 89 FF AD A4 72 B4 17 E9 90 00 g`./....r.....
    Status: No Error
    cm> ext-auth plain
    => 84 82 00 00 10 17 6D 1C 2A 87 9E 0A 24 3F 15 83 ......m.*...$?..
    A4 84 10 C0 75 ....u
    (71713 usec)
    <= 90 00 ..
    Status: No Errorh1.
    cm> upload -d "D:\JCIDE_workspace\hello\hello\javacard\hello.cap"
    => 80 E6 02 00 12 05 A0 00 01 00 62 08 A0 00 00 00 ..........b.....
    03 00 00 00 00 00 00 00 ........
    (56499 usec)
    <= 00 90 00 ...
    Status: No Error
    => 80 E8 00 00 FF C4 82 01 A1 01 00 0F DE CA FF ED ................
    01 02 04 00 01 05 A0 00 01 00 62 02 00 1F 00 0F ..........b.....
    00 1F 00 0B 00 15 00 2E 00 0C 00 63 00 17 00 12 ...........c....
    00 00 00 6F 00 02 00 01 00 0A 02 01 00 04 00 15 ...o............
    02 03 01 07 A0 00 00 00 62 01 01 00 01 07 A0 00 ........b.......
    00 00 62 00 01 03 00 0B 01 07 A0 00 01 00 62 03 ..b...........b.> 01 00 08 06 00 0C 00 80 03 00 FF 00 07 01 00 00 ................
    > 00 1C 07 00 63 00 01 10 18 8C 00 00 7A 05 30 8F ....c.......z.0.
    > 00 01 3D 8C 00 02 18 1D 04 41 18 1D 25 8B 00 03 ..=......A..%...
    > 7A 02 21 18 8B 00 04 60 03 7A 19 8B 00 05 2D 1A z.!....`.z....-.
    > 04 25 75 00 10 00 01 00 30 00 09 18 19 8C 00 06 .%u.....0.......
    > 70 08 11 6D 00 8D 00 07 7A 05 21 19 8B 00 05 2D p..m....z.!....-
    > 7B 00 08 03 1A 03 7B 00 08 92 8D 00 09 3B 19 03 {.....{......;..
    7B 00 08 92 8B 00 0A 7A 08 00 17 00 02 00 01 00 {......z........
    01 03 00 0A 48 65 6C 6C 6F 57 6F 72 6C 64 00 00 ....HelloWorld..> 00 00 05 00 2E 00 0B 06 80 03 00 01 00 00 00 06 ................
    > 00 00 01 03 00 .....
    >(1200 msec)
    <= 6A 80 j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80

    thank you. I use jcdk 2.2.1,jcop31v232 supports jc2.2.1 and gp2.1.1
    And i can not understand this:
    your jcop card is not a javacard v3 card.
    cm> /cap-info -p "D:\JCIDE_workspace\hello\hello\javacard\hello\hello" "D:\JCIDE_workspace\hello\hello\javacard\hello.cap"
    jcshell: Cannot read file <D:\JCIDE_workspace\hello\hello\javacard\hello.cap>: Incomplete CAP file, missing mandatory component: Header.capbut there is Header.cap in hello.cap:
    hello/javacard/Header.cap :
    01 00 13 de ca ff ed 01 02 04 00 01 09 a0 00 01
    00 62 03 01 0c 02

  • Urgent!Plz help me,   Who knows below error?

    cm>  /term "Remote|localhost:56119"
    --Opening terminal
    /card -a a000000003000000 -c com.ibm.jc.CardManagerresetCard with timeout: 0 (ms)
    --Waiting for card...
    ATR=3B F8 13 00 00 81 31 FE 45 4A 43 4F 50 76 32 34    ;.....1.EJCOPv24
        31 B7                                              1.
    IOCTL().
    ATR:
             T = 1                  
    => 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00          ..............
    (552934 nsec)
    <= 6F 65 84 08 A0 00 00 00 03 00 00 00 A5 59 9F 65    oe...........Y.e
        01 FF 9F 6E 06 47 91 01 17 33 00 73 4A 06 07 2A    ...n.G...3.sJ..*
        86 48 86 FC 6B 01 60 0C 06 0A 2A 86 48 86 FC 6B    .H..k.`...*.H..k
        02 02 01 01 63 09 06 07 2A 86 48 86 FC 6B 03 64    ....c...*.H..k.d
        0B 06 09 2A 86 48 86 FC 6B 04 02 15 65 0B 06 09    ...*.H..k...e...
        2B 85 10 86 48 64 02 01 03 66 0C 06 0A 2B 06 01    +...Hd...f...+..
        04 01 2A 02 6E 01 02 90 00                         ..*.n....
    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 CC 20 E2 3A E0 F8 D6 0B 00          .P.... .:.....
    (1457 usec)
    <= 00 00 DE 81 34 18 39 B7 09 70 FF 02 00 00 3D 02    ....4.9..p....=.
        9C 31 C7 89 75 4A BD 96 F6 68 B0 CD 90 00          .1..uJ...h....
    Status: No Error
    cm>  ext-auth plain
    => 84 82 00 00 10 31 E6 FA 16 3D 47 37 FA 2E 01 1B    .....1...=G7....
        A3 33 22 63 EB                                     .3"c.
    (1576 usec)
    <= 90 00                                              ..
    Status: No Error
    cm>  delete -r 01010101010101
    => 80 E4 00 80 09 4F 07 01 01 01 01 01 01 01 00       .....O.........
    (750777 nsec)
    <= 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>  upload -c -b 250 "D:\Java workspace\Testtest\bin\Test_GPRegistryEntry_deregisterService\javacard\Test_GPRegistryEntry_deregisterService.cap"
    jcshell: Cannot read <D:\Java workspace\Testtest\bin\Test_GPRegistryEntry_deregisterService\javacard\Test_GPRegistryEntry_deregisterService.cap>: java.io.FileNotFoundException: D:\Java workspace\Testtest\bin\Test_GPRegistryEntry_deregisterService\javacard\Test_GPRegistryEntry_deregisterService.cap (The system cannot find the path specified)
    cm>  install -i 0101010101010101  -q C9#() 01010101010101 0101010101010101
    => 80 E6 0C 00 20 07 01 01 01 01 01 01 01 08 01 01    .... ...........
        01 01 01 01 01 01 08 01 01 01 01 01 01 01 01 01    ................
        00 02 C9 00 00 00                                  ......
    (1233 usec)
    <= 6A 88                                              j.
    Status: Reference data not found
    jcshell: Error code: 6a88 (Reference data not found)
    jcshell: Wrong response APDU: 6A88
    Unexpected error; aborting executionWho knows above error? its appeared during build the cap file. Who can help me how to build the cap file?

    dear shane,
    I have implemented as you said but it still have an error below. Thanks to review for me and let's me how to fix it.
    thanks very much
    cm>  /term "Remote|localhost:52510"
    --Opening terminal
    /card -a a000000003000000 -c com.ibm.jc.CardManagerresetCard with timeout: 0 (ms)
    --Waiting for card...
    ATR=3B F8 13 00 00 81 31 FE 45 4A 43 4F 50 76 32 34    ;.....1.EJCOPv24
        31 B7                                              1.
    IOCTL().
    ATR:
             T = 1                  
    => 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00          ..............
    (572674 nsec)
    <= 6F 65 84 08 A0 00 00 00 03 00 00 00 A5 59 9F 65    oe...........Y.e
        01 FF 9F 6E 06 47 91 01 17 33 00 73 4A 06 07 2A    ...n.G...3.sJ..*
        86 48 86 FC 6B 01 60 0C 06 0A 2A 86 48 86 FC 6B    .H..k.`...*.H..k
        02 02 01 01 63 09 06 07 2A 86 48 86 FC 6B 03 64    ....c...*.H..k.d
        0B 06 09 2A 86 48 86 FC 6B 04 02 15 65 0B 06 09    ...*.H..k...e...
        2B 85 10 86 48 64 02 01 03 66 0C 06 0A 2B 06 01    +...Hd...f...+..
        04 01 2A 02 6E 01 02 90 00                         ..*.n....
    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 6B F1 B2 30 86 A6 F2 E7 00          .P...k..0.....
    (1609 usec)
    <= 00 00 DE 81 34 18 39 B7 09 70 FF 02 00 00 3D 02    ....4.9..p....=.
        9C 31 C7 89 6A 38 8B BE E2 AE 5E B8 90 00          .1..j8....^...
    Status: No Error
    cm>  ext-auth plain
    => 84 82 00 00 10 4C 85 CA 7F EC 60 8A 55 75 6A 93    .....L....`.Uuj.
        8D 50 B9 70 C4                                     .P.p.
    (1507 usec)
    <= 90 00                                              ..
    Status: No Error
    cm>  delete -r 01020304050505
    => 80 E4 00 80 09 4F 07 01 02 03 04 05 05 05 00       .....O.........
    (692621 nsec)
    <= 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 -r 01020304050508
    => 80 E4 00 80 09 4F 07 01 02 03 04 05 05 08 00       .....O.........
    (692620 nsec)
    <= 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 -r 01020304050501
    => 80 E4 00 80 09 4F 07 01 02 03 04 05 05 01 00       .....O.........
    (686770 nsec)
    <= 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 -r 01020304050507
    => 80 E4 00 80 09 4F 07 01 02 03 04 05 05 07 00       .....O.........
    (689695 nsec)
    <= 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 -r 01020304050506
    => 80 E4 00 80 09 4F 07 01 02 03 04 05 05 06 00       .....O.........
    (688232 nsec)
    <= 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 -r 01020304050504
    => 80 E4 00 80 09 4F 07 01 02 03 04 05 05 04 00       .....O.........
    (691158 nsec)
    <= 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 -r 01020304050502
    => 80 E4 00 80 09 4F 07 01 02 03 04 05 05 02 00       .....O.........
    (681650 nsec)
    <= 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 -r 01020304050503
    => 80 E4 00 80 09 4F 07 01 02 03 04 05 05 03 00       .....O.........
    (682016 nsec)
    <= 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>  upload -c -b 250 "D:\Project\GP Project\FPT SVN\TestApplet\Test_GP_GPRegistryEntry_2.2.1\bin\Test_GPRegistryEntry_getPrivileges\javacard\Test_GPRegistryEntry_getPrivileges.cap"
    => 80 E6 02 00 14 07 01 02 03 04 05 05 03 08 A0 00    ................
        00 00 03 00 00 00 00 00 00 00                      ..........
    (1831 usec)
    <= 00 90 00                                           ...
    Status: No Error
    Start loading Header.cap (59 byte)
    => 80 E8 00 00 3B C4 82 02 A5 01 00 34 DE CA FF ED    ....;......4....
        02 02 04 00 01 07 01 02 03 04 05 05 03 22 54 65    ............."Te
        73 74 5F 47 50 52 65 67 69 73 74 72 79 45 6E 74    st_GPRegistryEnt
        72 79 5F 67 65 74 50 72 69 76 69 6C 65 67 65 73    ry_getPrivileges
        00                                                 .
    (1427 usec)
    <= 00 90 00                                           ...
    Status: No Error
    Header.cap loaded (59 byte)
    Start loading Directory.cap (36 byte)
    => 80 E8 00 01 24 02 00 21 00 34 00 21 00 0C 00 1E    ....$..!.4.!....
        00 4A 00 14 01 7D 00 0A 00 26 00 00 00 AC 07 DE    .J...}...&......
        00 00 00 00 00 00 03 01 00 00                      ..........
    (1278 usec)
    <= 00 90 00                                           ...
    Status: No Error
    Directory.cap loaded (36 byte)
    Start loading Import.cap (33 byte)
    => 80 E8 00 02 21 04 00 1E 03 04 01 07 A0 00 00 00    ....!...........
        62 01 01 05 01 06 A0 00 00 01 51 00 00 01 07 A0    b.........Q.....
        00 00 00 62 00 01 00                               ...b...
    (5082 usec)
    <= 6A 80                                              j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution

  • Install error -look at the code. plz help

    I have the simple applet that I'm able to compile and load on to a JCOP10 cartd. When I try to install the applet so that I can start interacting with it, I get the following error. How do I go beyond this point? I'll appreciate your help.
    JCOP shell
    Load report:
    747 bytes loaded in 0.0 seconds
    effective code size on card:
    + package AID 6
    + applet AIDs 13
    + classes 21
    + methods 470
    + statics 0
    + exports 0
    overall 510 bytes
         end
         /set-var J 0
         while ${J} < ${PKG_${I}_APP_COUNT}
              install -i ${PKG_${I}_APP_${J}_INST_AID} -q C9#(${PKG_${I}_APP_${J}_INST_DATA}) ${PKG_${I}_AID} ${PKG_${I}_APP_${J}_AID}
    => 80 E6 0C 00 24 06 11 11 11 11 11 11 06 22 22 22 ....$........"""
    22 22 22 06 22 22 22 22 22 33 01 00 0B C9 09 23 """."""""3.....#
    42 38 47 36 74 63 76 73 00 00 B8G6tcvs..
    (0 msec)
    <= 6A 80 j.
    Status: Wrong data
    Error code: 6a80 (Wrong data)
    Offending APDU: 6A80
    Here is the code.
    * Package: myWallet
    * Filename: MyWallet.java
    * Class: MyWallet
    * Date: Jan 23, 2004 2:01:58 PM
    package myWallet;
    import javacard.framework.*;
    //import javacardx.framework.*;
    public class MyWallet extends Applet
    /* constants declaration */
    // code of CLA byte in the command APDU header
    final static byte Wallet_CLA =(byte)0x80;
    // codes of INS byte in the command APDU header
    final static byte VERIFY = (byte) 0x20;
    final static byte CREDIT = (byte) 0x30;
    final static byte DEBIT = (byte) 0x40;
    final static byte GET_BALANCE = (byte) 0x50;
    // maximum balance
    final static short MAX_BALANCE = (byte)0x7FFF;
    // maximum transaction amount
    final static byte MAX_TRANSACTION_AMOUNT =(byte)0x007F;
    // maximum number of incorrect tries before the
    // PIN is blocked
    final static byte PIN_TRY_LIMIT =(byte)0x03;
    // maximum size PIN
    final static byte MAX_PIN_SIZE =(byte)0x08;
    // signal that the PIN verification failed
    final static short SW_VERIFICATION_FAILED = 0x6300;
    // signal the the PIN validation is required
    // for a credit or a debit transaction
    final static short SW_PIN_VERIFICATION_REQUIRED =     0x6301;
    // signal invalid transaction amount
    // amount > MAX_TRANSACTION_AMOUNT or amount < 0
    final static short SW_INVALID_TRANSACTION_AMOUNT = 0x6A83;
    // signal that the balance exceed the maximum
    final static short SW_EXCEED_MAXIMUM_BALANCE = 0x6A84;
    // signal the the balance becomes negative
    final static short SW_NEGATIVE_BALANCE = 0x6A85;
    /* instance variables declaration */
    OwnerPIN pin;
    short balance;
    private MyWallet (byte[] bArray,short bOffset,byte bLength)
         // It is good programming practice to allocate
         // all the memory that an applet needs during
         // its lifetime inside the constructor
         pin = new OwnerPIN(PIN_TRY_LIMIT, MAX_PIN_SIZE);
         byte iLen = bArray[bOffset]; // aid length
         bOffset = (short) (bOffset+iLen+1);
         byte cLen = bArray[bOffset]; // info length
         bOffset = (short) (bOffset+cLen+1);
         byte aLen = bArray[bOffset]; // applet data length
         // The installation parameters contain the PIN
         // initialization value
         pin.update(bArray, (short)(bOffset+1), aLen);
    register();
    } // end of the constructor
    public static void install(byte[] bArray, short bOffset, byte bLength){
         // create a Wallet applet instance
         MyWallet me = new MyWallet(bArray, bOffset, bLength);
    me.register(bArray, bOffset, bLength);
    } // end of install method
    public boolean select()
         // The applet declines to be selected
         // if the pin is blocked.
         if ( pin.getTriesRemaining() == 0 )
         return false;
         return true;
    }// end of select method
    public void deselect() {
         // reset the pin value
         pin.reset();
    public void process(APDU apdu) {
         // APDU object carries a byte array (buffer) to
         // transfer incoming and outgoing APDU header
         // and data bytes between card and CAD
         // At this point, only the first header bytes
         // [CLA, INS, P1, P2, P3] are available in
         // the APDU buffer.
         // The interface javacard.framework.ISO7816
         // declares constants to denote the offset of
         // these bytes in the APDU buffer
         byte[] buffer = apdu.getBuffer();
         // check SELECT APDU command
         buffer[ISO7816.OFFSET_CLA] = (byte)(buffer[ISO7816.OFFSET_CLA] & (byte)0xFC);
         if ((buffer[ISO7816.OFFSET_CLA] == 0) &&
         (buffer[ISO7816.OFFSET_INS] == (byte)(0xA4)) )
         return;
         // verify the reset of commands have the
         // correct CLA byte, which specifies the
         // command structure
         if (buffer[ISO7816.OFFSET_CLA] != Wallet_CLA)
         ISOException.throwIt
    (ISO7816.SW_CLA_NOT_SUPPORTED);
         switch (buffer[ISO7816.OFFSET_INS]) {
         case GET_BALANCE: getBalance(apdu);
                                  return;
         case DEBIT: debit(apdu);
                                  return;
         case CREDIT: credit(apdu);
                                  return;
         case VERIFY: verify(apdu);
                                  return;
         default: ISOException.throwIt (ISO7816.SW_INS_NOT_SUPPORTED);
    } // end of process method
    private void credit(APDU apdu)
    // access authentication
    if ( ! pin.isValidated() )
    ISOException.throwIt(
              SW_PIN_VERIFICATION_REQUIRED);
         byte[] buffer = apdu.getBuffer();
         // Lc byte denotes the number of bytes in the
         // data field of the command APDU
         byte numBytes = buffer[ISO7816.OFFSET_LC];
         // indicate that this APDU has incoming data
         // and receive data starting from the offset
         // ISO7816.OFFSET_CDATA following the 5 header
         // bytes.
         byte byteRead =
                   (byte)(apdu.setIncomingAndReceive());
         // it is an error if the number of data bytes
         // read does not match the number in Lc byte
         if ( ( numBytes != 1 ) || (byteRead != 1) )
         ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
         // get the credit amount
         byte creditAmount = buffer[ISO7816.OFFSET_CDATA];
         // check the credit amount
         if ( ( creditAmount > MAX_TRANSACTION_AMOUNT)
              || ( creditAmount < 0 ) )
              ISOException.throwIt
                        (SW_INVALID_TRANSACTION_AMOUNT);
         // check the new balance
         if ( (short)( balance + creditAmount) > MAX_BALANCE )
         ISOException.throwIt
                             (SW_EXCEED_MAXIMUM_BALANCE);
         // credit the amount
         balance = (short)(balance + creditAmount);
    } // end of deposit method
    private void debit(APDU apdu)
         // access authentication
         if ( ! pin.isValidated() )
         ISOException.throwIt
    (SW_PIN_VERIFICATION_REQUIRED);
         byte[] buffer = apdu.getBuffer();
         byte numBytes =
                   (byte)(buffer[ISO7816.OFFSET_LC]);
         byte byteRead =
                   (byte)(apdu.setIncomingAndReceive());
         if ( ( numBytes != 1 ) || (byteRead != 1) )
         ISOException.throwIt
                                  (ISO7816.SW_WRONG_LENGTH);
         // get debit amount
         byte debitAmount =
                             buffer[ISO7816.OFFSET_CDATA];
         // check debit amount
         if ( ( debitAmount > MAX_TRANSACTION_AMOUNT)
              || ( debitAmount < 0 ) )
         ISOException.throwIt
                        (SW_INVALID_TRANSACTION_AMOUNT);
         // check the new balance
         if ( (short)( balance - debitAmount ) < (short)0 )
              ISOException.throwIt(SW_NEGATIVE_BALANCE);
         balance = (short) (balance - debitAmount);
    } // end of debit method
    private void getBalance(APDU apdu) {
         byte[] buffer = apdu.getBuffer();
         // inform system that the applet has finished
         // processing the command and the system should
         // now prepare to construct a response APDU
         // which contains data field
         short le = apdu.setOutgoing();
         if ( le < 2 )
         ISOException.throwIt
                             (ISO7816.SW_WRONG_LENGTH);
         //informs the CAD the actual number of bytes
         //returned
         apdu.setOutgoingLength((byte)2);
         // move the balance data into the APDU buffer
         // starting at the offset 0
         buffer[0] = (byte)(balance >> 8);
         buffer[1] = (byte)(balance & 0xFF);
         // send the 2-byte balance at the offset
         // 0 in the apdu buffer
         apdu.sendBytes((short)0, (short)2);
    } // end of getBalance method
    private void verify(APDU apdu) {
         byte[] buffer = apdu.getBuffer();
         // retrieve the PIN data for validation.
    byte byteRead =(byte)(apdu.setIncomingAndReceive());
    // check pin
         // the PIN data is read into the APDU buffer
    // at the offset ISO7816.OFFSET_CDATA
    // the PIN data length = byteRead
    if ( pin.check(buffer, ISO7816.OFFSET_CDATA,byteRead) == false )
         ISOException.throwIt(SW_VERIFICATION_FAILED);
    } // end of validate method
    } // end of class Wallet

    How do I set a breakpoint in my install method in order to identify the error?
    I've tried changing my install method and making it look exactly like the sample wallet applications accompanying the javacard kit, but I'm still getting the same error? here else could be the possible source of the error?
    Thomas

  • Java card cap file install error in jcop tools

    When i try to run java card applet in real java card it gives this error.i used jcop tools and java version 1.5  and eclipse 3.2.when i run the applet in simulater it works fine.i saw some document it says allocate memory for the installation process.i don't know how to do that.
    /term "winscard:4|SCM Microsystems Inc. SCL010 Contactless Reader 0"
    --Opening terminal
    >  /card -a a000000003000000 -c com.ibm.jc.CardManager
    resetCard with timeout: 0 (ms)
    --Waiting for card...
    ATR=3B 8A 80 01 4A 43 4F 50 33 31 56 32 33 32 7A       ;...JCOP31V232z
    ATR: T=0, T=1, Hist="JCOP31V232"
    => 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00          ..............
    (23807 usec)
    <= 6F 65 84 08 A0 00 00 00 03 00 00 00 A5 59 9F 65    oe...........Y.e
        01 FF 9F 6E 06 47 91 73 51 2E 00 73 4A 06 07 2A    ...n.G.sQ..sJ..*
        86 48 86 FC 6B 01 60 0C 06 0A 2A 86 48 86 FC 6B    .H..k.`...*.H..k
        02 02 01 01 63 09 06 07 2A 86 48 86 FC 6B 03 64    ....c...*.H..k.d
        0B 06 09 2A 86 48 86 FC 6B 04 02 15 65 0B 06 09    ...*.H..k...e...
        2B 85 10 86 48 64 02 01 03 66 0C 06 0A 2B 06 01    +...Hd...f...+..
        04 01 2A 02 6E 01 02 90 00                         ..*.n....
    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 AC B1 90 01 BF 2D 24 A0 00          .P........-$..
    (49906 usec)
    <= 00 00 91 18 01 39 93 95 05 59 FF 02 00 2C BE 39    .....9...Y...,.9
        5E A5 07 55 87 B8 C3 A8 A6 93 66 2B 90 00          ^..U......f+..
    Status: No Error
    cm>  ext-auth plain
    => 84 82 00 00 10 0C AE 50 3E C8 7E 1D 92 29 E2 59    .......P>.~..).Y
        08 D9 DA 02 16                                     .....
    (57276 usec)
    <= 90 00                                              ..
    Status: No Error
    cm>  delete 060504030201
    => 80 E4 00 00 08 4F 06 06 05 04 03 02 01 00          .....O........
    (40041 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 010203040506
    => 80 E4 00 00 08 4F 06 01 02 03 04 05 06 00          .....O........
    (17392 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>  upload -d -b 250 "Cap File location"
    => 80 E6 02 00 13 06 01 02 03 04 05 06 08 A0 00 00    ................
        00 03 00 00 00 00 00 00 00                         .........
    (32303 usec)
    <= 00 90 00                                           ...
    Status: No Error
    => 80 E8 00 00 FA C4 81 F2 01 00 23 DE CA FF ED 02    ..........#.....
        02 04 00 01 06 01 02 03 04 05 06 12 68 6D 73 2F    ............hms/
        6A 61 76 61 63 61 72 64 2F 68 65 6C 6C 6F 02 00    javacard/hello..
        21 00 23 00 21 00 0A 00 0B 00 1E 00 0E 00 3D 00    !.#.!.........=.
        0A 00 0B 00 00 00 4D 01 BE 00 00 00 00 00 00 01    ......M.........
        01 00 04 00 0B 01 02 01 07 A0 00 00 00 62 01 01    .............b..
        03 00 0A 01 06 06 05 04 03 02 01 00 08 06 00 0E    ................
        00 00 00 80 03 00 FF 00 07 01 00 00 00 1C 07 00    ................
        3D 00 01 10 18 8C 00 05 7A 05 30 8F 00 00 3D 8C    =.......z.0...=.
        00 01 18 1D 04 41 18 1D 25 8B 00 02 7A 02 21 18    .....A..%...z.!.
        8B 00 03 60 03 7A 19 8B 00 04 2D 1A 04 25 73 00    ...`.z....-..%s.
        09 00 00 00 00 00 0F 11 6D 00 8D 00 06 7A 08 00    ........m....z..
        0A 00 00 00 00 00 00 00 00 00 00 05 00 1E 00 07    ................
        01 00 02 00 06 00 00 01 03 80 03 02 03 80 03 03    ................
        03 80 0A 01 06 80 03 00 06 80 07 01 09 00 0B 00    ................
        00 00 07 05 06 04 0A 07 07 13 0B 00 4D 01 00 00    ............M...
    (764519 usec)
    <= 6A 80                                              j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution

    Thanks ReNa
    i am using nxp jcop 31 contact-less card.and it will support for java card 2.2.1 and global-platform card specification 2.1.1 .so i am using nxp jcop training 2007 tools and it has java card 2.2.1 and global-platform card specification 2.1.1.Inside my project there are three jar files these are jc221.jar and gp211.jar and bio10.jar
    i will appreciate your help
    Thanks

  • Exception 6A80 while setting Triple DES key inside the applet constructor

    In the applet definition part, I am having these definition:
    public static final byte DEFAULT_PERSO_KEY_SET_REFERENCE = (byte) 0x81;
         public static final byte[] DEFAULT_PERSO_KEY_SET_ENC = {
              (byte) 0x52, (byte) 0x57, (byte) 0x4d, (byte) 0x41,
              (byte) 0x43, (byte) 0x45, (byte) 0x43, (byte) 0x48,
              (byte) 0x41, (byte) 0x4e, (byte) 0x54, (byte) 0x49,
              (byte) 0x4c, (byte) 0x4c, (byte) 0x4f, (byte) 0x4e
         public static final byte[] DEFAULT_PERSO_KEY_SET_MAC = {
              (byte) 0x52, (byte) 0x57, (byte) 0x45, (byte) 0x4e,
              (byte) 0x43, (byte) 0x45, (byte) 0x43, (byte) 0x48,
              (byte) 0x41, (byte) 0x4e, (byte) 0x54, (byte) 0x49,
              (byte) 0x4c, (byte) 0x4c, (byte) 0x4f, (byte) 0x4e
    public Key keyEnc;
         public Key keyMac;In the applet constructor I am having these lines of code:
    keyEnc = (DESKey) KeyBuilder.buildKey(KeyBuilder.TYPE_DES, KeyBuilder.LENGTH_DES3_2KEY,
                             false);
                   keyMac = (DESKey) KeyBuilder.buildKey(KeyBuilder.TYPE_DES, KeyBuilder.LENGTH_DES3_2KEY,
                             false);
              ((DESKey) keyMac).setKey(DEFAULT_PERSO_KEY_SET_MAC, (short) 0);
              ((DESKey) keyEnc).setKey(DEFAULT_PERSO_KEY_SET_ENC, (short) 0);On line when the MAC is setting, the next exception is thrown: 
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution

    >
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution
    >
    usually unhandled exceptions do not look like this. If you catch the exception you can try to specify the reason. May be the problem in parity bits of des keys, though this error is not listed in possible exceptions of setKey method.

  • RSA Keypair cannot be generated in javacard ?

    Hello
    I got a problem about how to generate a RSA keypair in JAVACARD, I tried many different parametres, but I cannot install my applet in my emulator.
    public class RSAencry extends Applet {
        RSAPrivateKey  rsa_PrivateKey;
        RSAPublicKey rsa_PublicKey;
        KeyPair rsa_KeyPair;
        Cipher cipherRSA;
        //private byte buffer[];
        //byte TheBuffer[];
        final short dataOffset = (short) ISO7816.OFFSET_CDATA;
        //constructor
        private RSAencry()
            //generate own rsa_keypair
             //rsa_KeyPair = new KeyPair( KeyPair.ALG_RSA_CRT, KeyBuilder.LENGTH_RSA_2048 );
             //super();
             try
             //TheBuffer = new byte[100];
             rsa_KeyPair = new KeyPair( KeyPair.ALG_RSA_CRT, KeyBuilder.LENGTH_RSA_512 );
             //rsa_PublicKey.setExponent (TheBuffer, (short)0, (short)1);
             rsa_KeyPair.genKeyPair();
            rsa_PublicKey = (RSAPublicKey) rsa_KeyPair.getPublic();
            //rsa_PrivateCrtKey = (RSAPrivateCrtKey) rsa_KeyPair.getPrivate();
            rsa_PrivateKey = (RSAPrivateKey) rsa_KeyPair.getPrivate();
            //buffer = new byte[2048];
            cipherRSA = Cipher.getInstance(Cipher.ALG_RSA_PKCS1, false);
             }catch (CryptoException ex){
                  ISOException.throwIt((short) (ex.getReason()));
            //register(bArray, (short) (bOffset), bArray[bOffset]);
         public static void install(byte[] bArray, short bOffset, byte bLength) {
              // GP-compliant JavaCard applet registration
              new RSAencry().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
         public void process(APDU apdu) {
              // Good practice: Return 9000 on SELECT
              if (selectingApplet()) {
                   return;
              byte[] buf = apdu.getBuffer();
              switch (buf[ISO7816.OFFSET_INS]) {
              case (byte) 0x00:
                   break;
              default:
                   // good practice: If you don't know the INStruction, say so:
                   ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
    }The log shows as below:
    (2233 usec)
    <= 00 90 00 ...
    Status: No Error
    Load report:
    1358 bytes loaded in 0.0 seconds
    effective code size on card:
    + package AID 6
    + applet AIDs 15
    + classes 17
    + methods 138
    + statics 0
    + exports 0
    overall 176 bytes
    cm> install -i 525341656e637279 -q C9#() 525341656e63 525341656e637279
    => 80 E6 0C 00 1F 06 52 53 41 65 6E 63 08 52 53 41 ......RSAenc.RSA
    65 6E 63 72 79 08 52 53 41 65 6E 63 72 79 01 00 encry.RSAencry..
    02 C9 00 00 00 .....
    (122771 usec)
    <= 6A 80 j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution
    I almost removed all other codes, but it still can not intalled in card emulator.
    Does anyone can tell me that's why?
    Edited by: 949003 on 2012-8-3 上午8:05
    Edited by: 949003 on 2012-8-3 上午8:07

    Thanks Shane
    I even removed those senteces.
    public class RSAencry extends Applet {
        private KeyPair rsa_KeyPair;
        Cipher cipherRSA;
        //constructor
        private RSAencry()
             try
             new KeyPair( KeyPair.ALG_RSA, KeyBuilder.LENGTH_RSA_2048 );
             rsa_KeyPair.genKeyPair();
             }catch (CryptoException ex){
                  ISOException.throwIt((short) (ex.getReason()));
            //register(bArray, (short) (bOffset), bArray[bOffset]);
         public static void install(byte[] bArray, short bOffset, byte bLength) {
              // GP-compliant JavaCard applet registration
              new RSAencry().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
         public void process(APDU apdu) {
              // Good practice: Return 9000 on SELECT
              if (selectingApplet()) {
                   return;
              byte[] buf = apdu.getBuffer();
              switch (buf[ISO7816.OFFSET_INS]) {
              case (byte) 0x00:
                   break;
              default:
                   // good practice: If you don't know the INStruction, say so:
                   ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
    }and I still got this log
    Status: No Error
    Load report:
    1089 bytes loaded in 0.0 seconds
    effective code size on card:
    + package AID 6
    + applet AIDs 15
    + classes 17
    + methods 101
    + statics 0
    + exports 0
    overall 139 bytes
    cm> install -i 525341656e637279 -q C9#() 525341656e63 525341656e637279
    => 80 E6 0C 00 1F 06 52 53 41 65 6E 63 08 52 53 41 ......RSAenc.RSA
    65 6E 63 72 79 08 52 53 41 65 6E 63 72 79 01 00 encry.RSAencry..
    02 C9 00 00 00 .....
    (7334 usec)
    <= 6A 80 j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution

  • Guyz!!! Help Needed Very Urgent.

    I am not able to upload my cap file into jcop31 card using omni key reader,wat should i do?
    What can be the problem.Please analyse.
    /term "winscard:4|OMNIKEY CardMan 5x21 0"--Opening terminal
    /card -a a000000003000000 -c com.ibm.jc.CardManagerresetCard with timeout: 0 (ms)
    --Waiting for card...
    ATR=3B 66 00 FF 4A 43 4F 50 33 30 ;f..JCOP30
    ATR: T=0, N=-1, Hist="JCOP30"
    => 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00 ..............
    (96000 usec)
    <= 6F 19 84 08 A0 00 00 00 03 00 00 00 A5 0D 9F 6E o..............n
    06 40 51 30 85 30 1A 9F 65 01 FF 90 00 [email protected]....
    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 F0 54 16 78 0C 04 84 90 00 .P....T.x.....
    (127698 usec)
    <= 00 00 61 12 00 70 38 90 95 59 FF 01 E8 34 68 A8 ..a..p8..Y...4h.
    43 E9 74 6A 69 FC AA BF EA 0A 2C AC 90 00 C.tji.....,...
    Status: No Error
    cm> ext-auth plain
    => 84 82 00 00 10 C9 DE 7E 5D 82 10 1F 49 43 4D A5 .......~]...ICM.
    E8 AD 76 46 A1 ..vF.
    (71397 usec)
    <= 90 00 ..
    Status: No Error
    cm> delete 010203040502
    => 80 E4 00 00 08 4F 06 01 02 03 04 05 02 00 .....O........
    (70050 usec)
    <= 6A 80 j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Ignoring expected error
    cm> delete 0102030405
    => 80 E4 00 00 07 4F 05 01 02 03 04 05 00 .....O.......
    (67988 usec)
    <= 6A 80 j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Ignoring expected error
    cm> upload -b 250 "D:\JAVA\ECLIPSEWTP322\workspace\handson_simple\bin\handson_simple\javacard\handson_simple.cap"
    => 80 E6 02 00 12 05 01 02 03 04 05 08 A0 00 00 00 ................
    03 00 00 00 00 00 00 00 ........
    (103546 usec)
    <= 00 90 00 ...
    Status: No Error
    => 80 E8 80 00 F0 C4 81 ED 01 00 1E DE CA FF ED 02 ................
    02 04 00 01 05 01 02 03 04 05 0E 68 61 6E 64 73 ...........hands
    6F 6E 5F 73 69 6D 70 6C 65 02 00 21 00 1E 00 21 on_simple..!...!
    00 0A 00 0B 00 1E 00 0E 00 3D 00 0A 00 0B 00 00 .........=......
    00 4D 01 CA 00 00 00 00 00 00 01 01 00 04 00 0B .M..............
    01 02 01 07 A0 00 00 00 62 01 01 03 00 0A 01 06 ........b.......
    01 02 03 04 05 02 00 08 06 00 0E 00 00 00 80 03 ................
    00 FF 00 07 01 00 00 00 1C 07 00 3D 00 01 10 18 ...........=....
    8C 00 05 7A 05 30 8F 00 06 3D 8C 00 02 18 1D 04 ...z.0...=......
    41 18 1D 25 8B 00 04 7A 02 21 18 8B 00 03 60 03 A..%...z.!....`.
    7A 19 8B 00 00 2D 1A 04 25 73 00 09 00 00 00 00 z....-..%s......
    00 0F 11 6D 00 8D 00 01 7A 08 00 0A 00 00 00 00 ...m....z.......
    00 00 00 00 00 00 05 00 1E 00 07 03 80 0A 01 06 ................
    80 07 01 06 00 00 01 03 80 03 03 03 80 03 02 06 ................
    80 03 00 01 00 02 00 09 00 0B 00 00 00 07 05 06 ................
    04 0A 07 07 13 00 ......
    (278665 usec)
    <= 6A 80 j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution

    cm>  /term "winscard:4|SCM Microsystems Inc. SCR33x USB Smart Card Reader 0"
    --Opening terminal
    /card -a a000000003000000 -c com.ibm.jc.CardManagerresetCard with timeout: 0 (ms)
    --Waiting for card...
    ATR=3B E6 00 FF 81 31 FE 45 4A 43 4F 50 33 30 07       ;....1.EJCOP30.
    ATR: T=1, N=-1, IFSC=254, BWI=4/CWI=5, Hist="JCOP30"
    => 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00          ..............
    (81900 usec)
    <= 6F 19 84 08 A0 00 00 00 03 00 00 00 A5 0D 9F 6E    o..............n
        06 40 51 22 83 30 13 9F 65 01 FF 90 00             .@Q".0..e....
    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 0F F5 A8 43 45 FB 5F 81 00          .P......CE._..
    (86324 usec)
    <= 00 00 52 15 01 07 15 90 77 50 FF 01 82 F7 42 24    ..R.....wP....B$
        95 18 B7 31 C6 47 6E 9D 94 5F D9 B1 90 00          ...1.Gn.._....
    Status: No Error
    cm>  ext-auth plain
    => 84 82 00 00 10 EF 3C A2 00 C3 8A E0 AB 29 7C EA    ......<......)|.
        7B 28 95 D6 0A                                     {(...
    (56216 usec)
    <= 90 00                                              ..
    Status: No Error
    cm>  delete 010203040502
    => 80 E4 00 00 08 4F 06 01 02 03 04 05 02 00          .....O........
    (325622 usec)
    <= 00 90 00                                           ...
    Status: No Error
    cm>  delete 0102030405
    => 80 E4 00 00 07 4F 05 01 02 03 04 05 00             .....O.......
    (264622 usec)
    <= 00 90 00                                           ...
    Status: No Error
    cm>  upload -b 250 "C:\Documents and Settings\Administrator\workspace\training\bin\training\javacard\training.cap"
    => 80 E6 02 00 12 05 01 02 03 04 05 08 A0 00 00 00    ................
        03 00 00 00 00 00 00 00                            ........
    (60562 usec)
    <= 00 90 00                                           ...
    Status: No Error
    => 80 E8 80 00 DD C4 81 DA 01 00 0F DE CA FF ED 01    ................
        02 04 00 01 05 01 02 03 04 05 02 00 1F 00 0F 00    ................
        1F 00 0A 00 0B 00 1E 00 0C 00 3D 00 0A 00 0B 00    ..........=.....
        00 00 4D 00 00 00 00 00 00 01 01 00 04 00 0B 01    ..M.............
        00 01 07 A0 00 00 00 62 01 01 03 00 0A 01 06 01    .......b........
        02 03 04 05 02 00 08 06 00 0C 00 80 03 00 FF 00    ................
        07 01 00 00 00 1C 07 00 3D 00 01 10 18 8C 00 02    ........=.......
        7A 05 30 8F 00 06 3D 8C 00 04 18 1D 04 41 18 1D    z.0...=......A..
        25 8B 00 03 7A 02 21 18 8B 00 01 60 03 7A 19 8B    %...z.!....`.z..
        00 00 2D 1A 04 25 73 00 09 00 00 00 00 00 0F 11    ..-..%s.........
        6D 00 8D 00 05 7A 08 00 0A 00 00 00 00 00 00 00    m....z..........
        00 00 00 05 00 1E 00 07 03 80 0A 01 03 80 03 03    ................
        06 80 03 00 03 80 03 02 06 00 00 01 06 80 07 01    ................
        01 00 00 00 09 00 0B 00 00 00 07 05 06 04 0A 07    ................
        07 13 00                                           ...
    (547331 usec)
    <= 00 90 00                                           ...
    Status: No Error
    Load report:
      221 bytes loaded in 0.5 seconds
      effective code size on card:
          + package AID       5
          + applet AIDs       13
          + classes           15
          + methods           64
          + statics           0
          + exports           0
            overall           97  bytes
    cm>  install -i 010203040502  -q C9#() 0102030405 010203040502
    => 80 E6 0C 00 1A 05 01 02 03 04 05 06 01 02 03 04    ................
        05 02 06 01 02 03 04 05 02 01 00 02 C9 00 00 00    ................
    (127417 usec)
    <= 00 90 00                                           ...
    Status: No Error
    cm>  card-info
    => 80 F2 80 00 02 4F 00 00                            .....O..
    (41639 usec)
    <= 08 A0 00 00 00 03 00 00 00 07 9E 90 00             .............
    Status: No Error
    => 80 F2 40 00 02 4F 00 00                            [email protected]..
    (51116 usec)
    <= 06 A0 00 00 00 00 02 07 00 06 01 02 03 04 05 02    ................
        07 00 90 00                                        ....
    Status: No Error
    => 80 F2 10 00 02 4F 00 00                            .....O..
    (27798 usec)
    <= 6A 86                                              j.
    Status: Incorrect parameters (P1,P2)
    => 80 F2 20 00 02 4F 00 00                            .. ..O..
    (116801 usec)
    <= 07 A0 00 00 00 62 00 01 01 00 07 A0 00 00 00 62    .....b.........b
        01 01 01 00 07 A0 00 00 00 62 01 02 01 00 07 A0    .........b......
        00 00 00 62 02 01 01 00 07 A0 00 00 00 03 00 00    ...b............
        01 00 06 A0 00 00 00 00 01 01 00 05 01 02 03 04    ................
        05 01 00 90 00                                     .....
    Status: No Error
    Card Manager AID   :  A000000003000000
    Card Manager state :  INITIALIZED
        Application:  SELECTABLE (--------) A00000000002   
        Application:  SELECTABLE (--------) 010203040502   
        Load File  :      LOADED (--------) A0000000620001   (java.lang)
        Load File  :      LOADED (--------) A0000000620101   (javacard.framework)
        Load File  :      LOADED (--------) A0000000620102   (javacard.security)
        Load File  :      LOADED (--------) A0000000620201   (javacardx.crypto)
        Load File  :      LOADED (--------) A0000000030000   (visa.openplatform)
        Load File  :      LOADED (--------) A00000000001   
        Load File  :      LOADED (--------) 0102030405     
    {code}
    I use your code, and upload OK.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Simulation using Eclipse plugin for JCOP tools

    Dear All,
    In search for a simulation environment for java card applet development I tried to use Eclipse plugin for JCOP tools.
    The samples which comes with the JCOP tools works fine but when try to debug my applet I receive the error: Wrong Data 6A 80.
    Generic JCOP v2.4.1 is selected for Java Card Simulation.
    Following is the JCOP Shell screen:
    cm- /term "Remote|localhost:8050"
    --Opening terminal
    /card -a a000000003000000 -c com.ibm.jc.CardManagerresetCard with timeout: 0 (ms)
    --Waiting for card...
    ATR=3B F8 13 00 00 81 31 FE 45 4A 43 4F 50 76 32 34 ;.....1.EJCOPv24
    31 B7 1.
    IOCTL().
    ATR: T=1, FI=1/DI=3 (93clk/etu), N=0, IFSC=254, BWI=4/CWI=5, Hist="JCOPv241"
    => 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00 ..............
    (908058 nsec)
    <= 6F 65 84 08 A0 00 00 00 03 00 00 00 A5 59 9F 65 oe...........Y.e
    01 FF 9F 6E 06 47 91 92 18 00 00 73 4A 06 07 2A ...n.G.....sJ..*
    86 48 86 FC 6B 01 60 0C 06 0A 2A 86 48 86 FC 6B .H..k.`...*.H..k
    02 02 01 01 63 09 06 07 2A 86 48 86 FC 6B 03 64 ....c...*.H..k.d
    0B 06 09 2A 86 48 86 FC 6B 04 02 15 65 0B 06 09 ...*.H..k...e...
    2B 85 10 86 48 64 02 01 03 66 0C 06 0A 2B 06 01 +...Hd...f...+..
    04 01 2A 02 6E 01 02 90 00 ..*.n....
    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 B1 04 15 2B 41 3F 62 AB 00 .P......+A?b..
    (2668 usec)
    <= 00 00 F9 02 71 E3 BB AD BD CD FF 02 00 00 3D 02 ....q.........=.
    9C 31 C7 89 AD 44 8E 13 17 15 2E 5A 90 00 .1...D.....Z..
    Status: No Error
    cm> ext-auth plain
    => 84 82 00 00 10 CE 6C DC D2 8C BE 5E 33 EC 58 D0 ......l....^3.X.
    57 3A 52 D2 24 W:R.$
    (2288 usec)
    <= 90 00 ..
    Status: No Error
    cm> delete -r a00000006203010c04
    => 80 E4 00 80 0B 4F 09 A0 00 00 00 62 03 01 0C 04 .....O.....b....
    00 .
    (1084 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> upload -d -b 250 "D:\JCOP\eclipse\projects\DigitalTachograph\bin\digitaltachograph\javacard\digitaltachograph.cap"
    => 80 E6 02 00 16 09 A0 00 00 00 62 03 01 0C 04 08 ..........b.....
    A0 00 00 00 03 00 00 00 00 00 00 00 ............
    (2100 usec)
    <= 00 90 00 ...
    Status: No Error
    => 80 E8 00 00 FA C4 82 84 42 01 00 25 DE CA FF ED ........B..%....
    02 02 04 00 01 09 A0 00 00 00 62 03 01 0C 04 11 ..........b.....
    64 69 67 69 74 61 6C 74 61 63 68 6F 67 72 61 70 digitaltachograp
    68 02 00 21 00 25 00 21 00 0E 00 29 03 3E 00 CD h..!.%.!...).>..
    23 D2 01 BB 04 44 00 00 09 E3 4B E5 00 11 00 05 #....D....K.....
    01 A2 04 01 00 04 00 29 04 00 01 07 A0 00 00 00 .......)........
    62 00 01 02 01 07 A0 00 00 00 62 01 01 02 01 07 b.........b.....
    A0 00 00 00 62 01 02 02 01 07 A0 00 00 00 62 02 ....b.........b.
    01 03 00 0E 01 0A A0 00 00 00 62 03 01 0C 04 01 ..........b.....
    01 DF 06 00 CD 00 00 00 80 00 00 FF 00 01 00 00 ................
    00 01 81 03 13 00 12 07 03 00 00 02 01 03 06 0B ................
    8C 81 00 00 00 80 00 0B 00 0B 01 01 00 00 0B F9 ................
    00 80 00 11 00 0F 01 01 00 10 0E A9 0D D4 0D F7 ................
    0E 07 0E 18 0E 26 0E 35 0E 44 0E 50 0E 72 0E 81 .....&.5.D.P.r..
    0E 90 0E 9B 0E F5 11 05 11 1A 11 50 00 80 00 05 ...........P....
    00 04 01 04 00 01 13 AF 13 B5 13 BA 14 0C 13 00 ................
    (6775 usec)
    <= 6A 80 j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution
    I will be very happy if you can help me. I am desperately in need of a working debugging environment.
    Thanks in advance!
    Kind regards,
    Mehmet

         * Processes incoming READ_BINARY APDUs. Returns data of the currently
         * selected file.
         * @param apdu   where the offset is carried in header bytes p1 and p2.
         * @param le  expected length by terminal
         * @return length of the response APDU
        private short processReadBinary(APDU apdu, boolean protectedApdu,  short leUnprotected) {
            if (!hasFileSelected()) {
                ISOException.throwIt(SW_CONDITIONS_NOT_SATISFIED);
            byte[] buffer = apdu.getBuffer();
            // retrieve p1p2 from apdu buffer
            byte p1 = buffer[OFFSET_P1];
            byte p2 = buffer[OFFSET_P2];
            short offset = Util.makeShort(p1, p2);     // offset encoded in P1/P2, 15 lowest bit
            // offset encoded in P1/P2, 15 lowest bit
            // check if le != 0 <-- no response expected
            if (leUnprotected == 0) {
                ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
            if (selectedFile == null) {
                ISOException.throwIt(ISO7816.SW_FILE_NOT_FOUND);
            if ((selectedFile.getAccessConditions() & READ_REQUIRES_SM) == READ_REQUIRES_SM) {
                if(!protectedApdu)
                   ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
            short fileSize = (short) selectedFile.getFileLength();
            // check offset
            if (offset >= fileSize) {
                ISOException.throwIt(ISO7816.SW_INCORRECT_P1P2);
            // check expected length
            if ((short) (offset + leUnprotected) > fileSize) {
                ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
                //ISOException.throwIt(SW_TAMAM);
            short bufferOffset = 0;
            crypto.setEncryptionStatus(isSelectedFileEncrypted());
            if (protectedApdu) {
                bufferOffset = crypto.getApduBufferOffsetDT(leUnprotected);
                if(isSelectedFileEncrypted())
                   bufferOffset = crypto.getApduBufferOffset(leUnprotected);
                apdu.setOutgoing();
            Util.arrayCopyNonAtomic(selectedFile.getData(), offset, buffer, bufferOffset, leUnprotected);
            return leUnprotected;
         * Processes and UPDATE_BINARY apdu. Writes data in the currently selected
         * file.
         * @param apdu
         *            carries the offset where to write date in header bytes p1 and
         *            p2.
        private void processUpdateBinary(APDU apdu, boolean protectedApdu) {
            if (!hasFileSelected() || isLocked()) {
                ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED);
            if ((selectedFile.getAccessConditions() & DigitalTachograph.UPDATE_ALW) != DigitalTachograph.UPDATE_ALW) {
                if ((selectedFile.getAccessConditions() & DigitalTachograph.UPDATE_REQUIRES_SM) != DigitalTachograph.UPDATE_REQUIRES_SM) {
                    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
                    return;
                }else if(!protectedApdu){
                        ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
            byte[] buffer = apdu.getBuffer();
            byte p1 = buffer[OFFSET_P1];
            byte p2 = buffer[OFFSET_P2];
            short offset = Util.makeShort(p1, p2);
            short readCount = (short) (buffer[ISO7816.OFFSET_LC] & 0xff);
            //if (!protectedApdu){
                readCount = apdu.setIncomingAndReceive();
            while (readCount > 0) {
                selectedFile.writeData(offset, buffer, OFFSET_CDATA, readCount);
                offset += readCount;
                readCount = apdu.receiveBytes(ISO7816.OFFSET_CDATA);
        private short processInternalAuthenticate(APDU apdu , boolean protectedApdu) throws CryptoException {
            byte[] buffer = apdu.getBuffer();
            short lc = (short) (buffer[OFFSET_LC] & 0xFF);
            if (lc != (short) (KID_LENGTH * 2)) {
                ISOException.throwIt(SW_WRONG_LENGTH);
            if (apdu.setIncomingAndReceive() != lc) {
                ISOException.throwIt(ISO7816.SW_WRONG_DATA);
            // Check if VU.CHR maches the one of the selected certificate on the card
            if (Util.arrayCompare(buffer, (short) (OFFSET_CDATA + KID_LENGTH), keyStore.selected_KID, (short) 0, KID_LENGTH) != 0) {
                ISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);
            if (Util.arrayCopyNonAtomic(buffer, OFFSET_CDATA, Rnd1, (short) 0, (short) 8) != (short) 8) { // Receive Rnd1
                ISOException.throwIt(ISO7816.SW_WRONG_DATA);
            // Hash(PRnd2||K1||Rnd1||VU.CHR)
            random.generateData(PRnd2, (short) 0, (short) 90);
            random.generateData(K1, (short) 0, (short) 16);
            crypto.shaDigest.update(PRnd2, (short) 0, (short) 90); // PRnd2
            crypto.shaDigest.update(K1, (short) 0, (short) 16); // PRnd2||K1
            crypto.shaDigest.doFinal(buffer, OFFSET_CDATA, lc, digest, (short) 0); //Rnd1||VU.CHR
            BigNumber mod = new BigNumber((short) 128);
            mod.init(keyStore.Card_PubMod, (short) 0, (short) keyStore.Card_PubMod.length, BigNumber.FORMAT_HEX);
            mod.subtract(signed, (short) 0, (short) 128, BigNumber.FORMAT_HEX);
            if (mod.compareTo(signed, (short) 0, (short) 128, BigNumber.FORMAT_HEX) == -1) {
                mod.toBytes(signed, (short) 0, (short) 128, BigNumber.FORMAT_HEX);
            // To be added: if the selected private key is considered corrupted, the processing state returned is '6400' or '6581'.
            signed[0] = (byte) 0x6A;
            Util.arrayCopyNonAtomic(PRnd2, (short) 0, signed, (short) 1, (short) 90);
            Util.arrayCopyNonAtomic(K1, (short) 0, signed, (short) 91, (short) 16);
            Util.arrayCopyNonAtomic(digest, (short) 0, signed, (short) 107, (short) 20);
            signed[127] = (byte) 0xBC;
            if (!keyStore.cardPrivateKey.isInitialized()) {
                CryptoException.throwIt(CryptoException.ILLEGAL_VALUE);
            try {
                crypto.rsaSigner.init(keyStore.cardPrivateKey, Signature.MODE_SIGN);
                crypto.rsaSigner.doFinal(signed, (short) 0, (short) 128, signed, (short) 0);
            } catch (Exception e) {
                ISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);
            if (!keyStore.selectedPublicKey.isInitialized()) {
                CryptoException.throwIt(CryptoException.ILLEGAL_VALUE);
            try {
                crypto.rsaCipher.init(keyStore.selectedPublicKey, Cipher.MODE_ENCRYPT);
                crypto.rsaCipher.doFinal(signed, (short) 0, (short) 128, signed, (short) 0);
            } catch (Exception e) {
                ISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);
            apdu.setOutgoing();
            Util.arrayCopyNonAtomic(signed, (short) 0, buffer, (short) 0, (short) 128);
            return (short) signed.length;
        private void processExternalAuthenticate(APDU apdu) {
            short equipmentType = 0;
            if (keyStore.Selected_Cert != null) {
                equipmentType = (short) keyStore.Selected_Cert.CHA[6]; // check equipment type
            if (equipmentType != (short) 1 && equipmentType != (short) 2 && equipmentType != (short) 3 && equipmentType != (short) 4 && equipmentType != (short) 6) {
                ISOException.throwIt(ISO7816.SW_FUNC_NOT_SUPPORTED); // Instead of 6F00 throw a more meaningfull SW in case CHA is not valid.
            if (Util.arrayCompare(keyStore.Selected_Cert.CHA, (short) 0, TACHOGRAPH_AID, (short) 0, (short) 6) != 0) {
                ISOException.throwIt(ISO7816.SW_FUNC_NOT_SUPPORTED);
            byte[] buffer = apdu.getBuffer();
            byte p1 = (byte) (buffer[OFFSET_P1] & 0xff);
            byte p2 = (byte) (buffer[OFFSET_P2] & 0xff);
            if (p1 != 0 || p2 != 0) {
                ISOException.throwIt(SW_WRONG_P1P2);
            short lc = (short) (buffer[OFFSET_LC] & 0xFF);
            if (lc != (short) (128)) {
                ISOException.throwIt(SW_WRONG_LENGTH);
            if (apdu.setIncomingAndReceive() != lc) {
                ISOException.throwIt(ISO7816.SW_WRONG_DATA);
            Util.arrayCopyNonAtomic(buffer, OFFSET_CDATA, signed, (short) 0, (short) 128); // receive the cryptogram from the VU
            // decrypt the encrypted message with the card private key
            try {
                crypto.rsaCipher.init(keyStore.cardPrivateKey, Cipher.MODE_DECRYPT);
                crypto.rsaCipher.doFinal(signed, (short) 0, (short) 128, signed, (short) 0);
            } catch (Exception e) {
                ISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);
            // verify the signature with the VU public key
            try {
                crypto.rsaCipher.init(keyStore.selectedPublicKey, Signature.MODE_VERIFY); // Cipher.MODE_ENCRYPT
                crypto.rsaCipher.doFinal(signed, (short) 0, (short) 128, signed, (short) 0);
            } catch (Exception e) {
                ISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);
            if (signed[0] != (byte) 0x6A || signed[127] != (byte) 0xBC) {
                ISOException.throwIt(Util.makeShort(signed[0], signed[127]));
            try {
                verifyCardCertificates();
                Util.arrayCopyNonAtomic(signed, (short) 1, preDigest, (short) 0, (short) 106); // accumulate preDigest
                Util.arrayCopyNonAtomic(Rnd3, (short) 0, preDigest, (short) 106, (short) 8); // accumulate preDigest
                Util.arrayCopyNonAtomic(keyStore.Card_Cert.CHR, (short) 0, preDigest, (short) 114, (short) 8); // accumulate preDigest
                Util.arrayCopyNonAtomic(signed, (short) 91, K2, (short) 0, (short) 16); // receive K2 value
                crypto.shaDigest.update(signed, (short) 1, (short) 106); // PRnd4||K2
                crypto.shaDigest.update(Rnd3, (short) 0, (short) 8); // Rnd3
                crypto.shaDigest.doFinal(keyStore.Card_Cert.CHR, (short) 0, (short) 8, digest, (short) 0); //||Card.CHR
            } catch (Exception e) {
                ISOException.throwIt(SW_TAMAM);
            if (Util.arrayCompare(signed, (short) 107, digest, (short) 0, (short) 20) != 0) {
                ISOException.throwIt(SW_TAMAM);
            volatileState[0] |= MUTUAL_AUTHENTICATED;
            try {
                DTUtil.xor(K1, (short) 0, K2, (short) 0, KaKb, (short) 0, (short) 16);
                Util.arrayCopyNonAtomic(Rnd3, (short) 4, SSC, (short) 0, (short) 4); // tail of Rnd3
                Util.arrayCopyNonAtomic(Rnd1, (short) 4, SSC, (short) 4, (short) 4); // tail of Rnd1
            } catch (Exception e) {
                ISOException.throwIt(SW_TAMAM);
            try {
                keyStore.setKey_Ka(KaKb, (short) 0);
                keyStore.setKey_Kb(KaKb, (short) 8);
                keyStore.setSecureMessagingKeys(KaKb, (short) 0, KaKb, (short) 0);
            } catch (Exception e) {
                ISOException.throwIt(SW_TAMAM_DEGIL);
            return;
        private short returnPreDigest(APDU apdu) {
            byte[] buffer = apdu.getBuffer();
            apdu.setOutgoing();
            Util.arrayCopyNonAtomic(preDigest, (short) 0, buffer, (short) 0, (short) 122);
            return (short)preDigest.length;
        private short returnDigest(APDU apdu) {
            byte[] buffer = apdu.getBuffer();
            apdu.setOutgoing();
            Util.arrayCopyNonAtomic(digest, (short) 0, buffer, (short) 0, (short) 20);
            return (short)digest.length;
        private short returnOriginalText(APDU apdu) {
            byte[] buffer = apdu.getBuffer();
            apdu.setOutgoing();
            Util.arrayCopyNonAtomic(signed, (short) 0, buffer, (short) 0, (short) 128);
            return (short)signed.length;
        private void processVerify(APDU apdu) { // Verify_CHV(Pin_Ws)
            byte[] buffer = apdu.getBuffer();
            // retrieve the PIN data for validation.
            byte byteRead = (byte) (apdu.setIncomingAndReceive());
            // the PIN data is read into the APDU buffer
            // at the offset ISO7816.OFFSET_CDATA the PIN data length = byteRead
            if (pin.check(buffer, ISO7816.OFFSET_CDATA, byteRead) == false) {
                ISOException.throwIt(SW_VERIFICATION_FAILED);
            return;
        private void processPSO(APDU apdu) { // verify certificate
            byte[] buffer = apdu.getBuffer();
            byte p1 = (byte) (buffer[OFFSET_P1] & 0xff);
            byte p2 = (byte) (buffer[OFFSET_P2] & 0xff);
            short lc = (short) (buffer[ISO7816.OFFSET_LC] & 0xFF);
            if (p1 == (byte) 0x00 && p2 == P2_VERIFYCERT) {
                if (lc != TACHO_CERT_LENGTH) {
                    ISOException.throwIt(SW_WRONG_LENGTH);
                if (apdu.setIncomingAndReceive() != lc) {
                    ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
                try { // copy the certificate to be verified from APDU buffer to cert object
                    Util.arrayCopyNonAtomic(buffer, OFFSET_CDATA, cert, (short) 0, lc);
                } catch (Exception e) {
                    ISOException.throwIt(SW_TAMAM);
                if (Util.arrayCompare(keyStore.selected_KID, (short) 0, keyStore.ERCA_KID, (short) 0, KID_LENGTH) == 0) {
                    keyStore.VUCA_Cert.verifyCert(cert, keyStore.selectedPublicKey, keyStore.selected_KID);
                } else if (Util.arrayCompare(keyStore.selected_KID, (short) 0, keyStore.VUCA_Cert.CHR, (short) 0, KID_LENGTH) == 0) {
                    keyStore.VU_Cert.verifyCert(cert, keyStore.selectedPublicKey, keyStore.selected_KID);
                } else {
                    ISOException.throwIt(SW_CERT_VERIFICATION_FAILED); // Selected keyId, with MSE, is neither ERCA_KID nor VUCA_KID
            } else {
                ISOException.throwIt(SW_CERT_VERIFICATION_FAILED);
            return;
        private short processGetChallenge(APDU apdu, boolean protectedApdu) {
            byte[] buffer = apdu.getBuffer();
            byte p1 = (byte) (buffer[OFFSET_P1] & 0xff);
            byte p2 = (byte) (buffer[OFFSET_P2] & 0xff);
            if (p1 != 0 || p2 != 0) {
                ISOException.throwIt(SW_WRONG_P1P2);
            random.generateData(Rnd3, (short) 0, (short) 8);
            short Le = apdu.setOutgoing();
            if (Le != (short) 8) {
                ISOException.throwIt(SW_WRONG_LENGTH);
            Util.arrayCopyNonAtomic(Rnd3, (short) 0, buffer, (short) 0, (short) 8);
            return Le;
        private void processMSE(APDU apdu) {
            byte[] buffer = apdu.getBuffer();
            if (buffer[OFFSET_P1] == (byte) 0xC1 && buffer[OFFSET_P2] == P2_DST) {
                short lc = (short) (buffer[OFFSET_LC] & 0xFF);
                if (lc != (short) (KID_LENGTH + 2)) {
                    ISOException.throwIt(SW_WRONG_LENGTH);
                if (apdu.setIncomingAndReceive() != lc) {
                    ISOException.throwIt(ISO7816.SW_WRONG_DATA);
                if (buffer[OFFSET_CDATA] != (byte) 0x83) {//check the tag of the data
                    ISOException.throwIt(SW_SECURE_MESSAGING_DATA_OBJECTS_MISSING);
                } else if (buffer[OFFSET_CDATA + 1] != (byte) 0x08) {
                    ISOException.throwIt(SW_INCORRECT_DATA_OBJECT); // check if the key is already selected one
                } else if (Util.arrayCompare(buffer, (short) (OFFSET_CDATA + 2), keyStore.selected_KID, (short) 0, KID_LENGTH) != 0) {
                    if (Util.arrayCompare(buffer, (short) (OFFSET_CDATA + 2), keyStore.ERCA_KID, (short) 0, KID_LENGTH) == 0) {// KID is EUR_KID
                        keyStore.selected_KID = keyStore.ERCA_KID;
                        keyStore.selectedPublicKey = keyStore.eurPublicKey;
                        keyStore.Selected_Cert = null; // ERCA public key is selected
                        return;
                    } else if (Util.arrayCompare(buffer, (short) (OFFSET_CDATA + 2), keyStore.VUCA_Cert.CHR, (short) 0, KID_LENGTH) == 0) {// KID is MSCA_KID
                        keyStore.Selected_Cert = keyStore.VUCA_Cert;
                    } else if (Util.arrayCompare(buffer, (short) (OFFSET_CDATA + 2), keyStore.VU_Cert.CHR, (short) 0, KID_LENGTH) == 0) { // KID is VU_KID
                        keyStore.Selected_Cert = keyStore.VU_Cert;
                    } else {
                        ISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);
                    }// KID not found
                    keyStore.selectedPublicKey = keyStore.Selected_Cert.publicKey;
                    keyStore.selected_KID = keyStore.Selected_Cert.CHR;
                } else { // if the KID is already set, just return
                    return;
            } else {
                ISOException.throwIt(ISO7816.SW_WRONG_P1P2);
        private void processSelectFile(APDU apdu) {
            byte[] buffer = apdu.getBuffer();
            short lc = (short) (buffer[OFFSET_LC] & 0x00FF);
            // retrieve p1p2 from apdu buffer
            byte p1 = buffer[OFFSET_P1];
            byte p2 = buffer[OFFSET_P2];
            short p1p2 = Util.makeShort(p1, p2);
            apdu.setIncomingAndReceive();
            if (p1 == 4) {
                if (lc == (short) TACHO_AID_LENGTH) {
                    if (Util.arrayCompare(buffer, (short) OFFSET_CDATA, TACHOGRAPH_AID, (short) 0, (short) TACHO_AID_LENGTH) == 0) {
                        selectedFile = fileSystem.getDT();
                        fileSystem.selectDT();
                        volatileState[0] |= FILE_SELECTED;
                        return;
                    } else {
                        ISOException.throwIt(ISO7816.SW_WRONG_DATA);
                } else if (lc != 2) {
                    ISOException.throwIt(SW_WRONG_LENGTH);
                short fid = Util.getShort(buffer, OFFSET_CDATA);
                if (fileSystem.getFile(fid) != null) {
                    selectedFile = fileSystem.getDT();
                    fileSystem.selectDT();
                    volatileState[0] |= FILE_SELECTED;
                    return;
            } else if (p1 == 2) {
                if (lc != 2) {
                    ISOException.throwIt(SW_WRONG_LENGTH);
                short fid = Util.getShort(buffer, OFFSET_CDATA);
                if (fileSystem.getFile(fid) != null) {
                    selectedFile = fileSystem.getFile(fid);
                    volatileState[0] |= FILE_SELECTED;
                    return;
            } else {
                ISOException.throwIt(ISO7816.SW_WRONG_P1P2);
            setNoFileSelected();
            ISOException.throwIt(ISO7816.SW_FILE_NOT_FOUND);
        public static void setNoFileSelected() {
            if (hasFileSelected()) {
                volatileState[0] ^= FILE_SELECTED;
        public static boolean hasFileSelected() {
            return (volatileState[0] & FILE_SELECTED) == FILE_SELECTED;
        public static boolean hasMutuallyAuthenticated() {
            return (volatileState[0] & MUTUAL_AUTHENTICATED) == MUTUAL_AUTHENTICATED;
        static boolean isLocked() {
            return (persistentState & LOCKED) == LOCKED;
        public boolean isSelectedFileEncrypted() {
            return ((selectedFile.getAccessConditions() & DigitalTachograph.ENCRYPTED) == DigitalTachograph.ENCRYPTED);
    }

  • 6A 80 on loading import.cap

    Greetings!
    I have problem with loading applet into java card. I load it with my program, but the same problem persist in JCOP tools as well. Hence the problem is not my uploader. Here is the trace from my prog:
    >
    => 84 82 00 00 10 F7 31 F6 11 E8 10 87 78 94 6A A4 C6 E9 7F E1 BC
    <= 90 00
    Authenticated!
    Get Status command: retreive Issuer Security Domain AID
    => 80 F2 80 00 02 4F 00 00
    <= 08 A0 00 00 00 03 00 00 00 01 9E 90 00
    ISD: A0 00 00 00 03 00 00 00
    Install for Load:
    => 80 E6 02 00 15 08 A0 00 00 02 47 4F 54 49 08 A0 00 00 00 03 00 00 00 00 00 00 00
    <= 00 90 00
    Load1 (C4 tag + length [27D3]):
    => 80 E8 00 00 04 C4 82 27 D3 00
    <= 00 90 00
    Load2 (header.cap):
    => 80 E8 00 01 3B 01 00 38 DE CA FF ED 02 02 04 00 01 08 A0 00 00 02 47 4F 54 49 25 63 6F 6D 2F 61 73 73 61 61 62 6C 6F 79 69 74 67 2F 72 65 73 65 61 72 63 68 2F 69 63 61 6F 2F 69 74 67 6C 64 73 00
    <= 00 90 00
    Load3 (directory.cap)
    => 80 E8 00 02 24 02 00 21 00 38 00 21 00 13 00 35 01 6A 00 20 1F 26 00 AE 02 B4 00 00 03 02 00 00 00 0A 00 05 00 95 05 02 00 00
    <= 00 90 00
    Load4 (import.cap)
    => 80 E8 00 03 38 04 00 35 05 02 01 07 A0 00 00 00 62 01 01 02 01 07 A0 00 00 00 62 02 01 02 01 07 A0 00 00 00 62 01 02 00 01 06 A0 00 00 01 51 00 00 01 0A 74 72 69 63 65 72 72 6C 69 62 00
    <= 6A 80
    Wrong Data :(
    >
    Please help me find the source of that issue.
    Any help will be gratefully appreciated.
    Regards, neutrino.
    P.S. JCOP Tools trace:
    >
    cm> upload -d -b 100 "..\itglds.cap"
    => 80 E6 02 00 15 08 A0 00 00 02 47 4F 54 49 08 A0 ..........GOTI..
    00 00 00 03 00 00 00 00 00 00 00 ...........
    (24436 usec)
    <= 00 90 00 ...
    Status: No Error
    => 80 E8 00 00 64 C4 82 24 CE 01 00 38 DE CA FF ED ....d..$...8....
    02 02 04 00 01 08 A0 00 00 02 47 4F 54 49 25 63 ..........GOTI%c
    6F 6D 2F 61 73 73 61 61 62 6C 6F 79 69 74 67 2F om/assaabloyitg/
    72 65 73 65 61 72 63 68 2F 69 63 61 6F 2F 69 74 research/icao/it
    67 6C 64 73 02 00 21 00 38 00 21 00 13 00 35 01 glds..!.8.!...5.
    6A 00 20 1F 26 00 AE 02 B4 00 00 03 02 39 16 00 j. .&........9..
    0A 00 05 00 95 05 02 00 04 00 ..........
    (177577 usec)
    <= 00 90 00 ...
    Status: No Error
    => 80 E8 00 01 64 00 35 05 02 01 07 A0 00 00 00 62 ....d.5........b
    01 01 02 01 07 A0 00 00 00 62 02 01 02 01 07 A0 .........b......
    00 00 00 62 01 02 00 01 06 A0 00 00 01 51 00 00 ...b.........Q..
    01 0A 74 72 69 63 65 72 72 6C 69 62 03 00 13 02 ..tricerrlib....
    05 A0 00 00 02 47 1F 16 07 A0 00 00 02 47 10 01 .....G.......G..
    03 BF 06 00 20 00 00 00 80 03 22 00 19 07 01 00 .... .....".....
    03 04 0E 01 54 01 B4 02 14 00 ....T.....
    (903714 usec)
    <= 6A 80 j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    {quote}
    Edited by: neutrino on Dec 2, 2007 6:07 AM
    P.P.S The versions in Header.cap and Import.cap does not match (2.2 and 1.2 respectively). I think this caused error during uploading process.
    Edited by: neutrino on Dec 2, 2007 6:35 AM

    May be this will be helpful. Here the whole load process (except data of very long components such as method component):
    >
    Install for load
    => 80 E6 02 00 18 0B A0 00 00 02 47 49 54 47 4C 44 53 08 A0 00 00 00 03 00 00 00 00 00 00 00
    <= 00 90 00
    Load C4 TLV
    => 80 E8 00 00 04 C4 82 26 AD 00
    <= 00 90 00
    Header.cap
    => 80 E8 00 01 3E *01* 00 3B DE CA FF ED 02 02 04 00 01 0B A0 00 00 02 47 49 54 47 4C 44 53 25 63 6F 6D 2F 61 73 73 61 61 62 6C 6F 79 69 74 67 2F 72 65 73 65 61 72 63 68 2F 69 63 61 6F 2F 69 74 67 6C 64 73 00
    <= 00 90 00
    Directory.cap
    => 80 E8 00 02 24 *02* 00 21 00 3B 00 21 00 0B 00 28 01 5A 00 14 1F 0E 00 1E 02 AE 00 00 02 B8 00 00 00 04 00 02 00 0E 04 01 00 00
    <= 00 90 00
    Import.cap
    => 80 E8 00 03 2B *04* 00 28 04 02 01 07 A0 00 00 00 62 01 01 02 01 07 A0 00 00 00 62 02 01 02 01 07 A0 00 00 00 62 01 02 00 01 06 A0 00 00 01 51 00 00
    <= 00 90 00
    Applet.cap
    => 80 E8 00 04 0E *03* 00 0B 01 07 A0 00 00 02 47 10 01 03 BF 00
    <= 00 90 00
    Class.cap
    => 80 E8 00 05 17 *06* 00 14 00 00 00 80 03 22 00 19 07 01 00 03 04 0E 01 54 01 B4 02 14 00
    <= 00 90 00
    Method.cap
    => 80 E8 00 06 80 *07* 1F 0E 00 04 32 18 8C 00 52 18 11 01 0A 05 8D 00 46 87 1E 18 10 0C 03 8D 00 24 87 04 18 10 0C 03 8D 00 24 87 1A 18 08 11 04 00 03 8D 00 4A 94 00 00 54 87 1D 18 08 11 04 00 03 8D 00 4A 94 00 00 54 87 07 18 04 03 8D 00 38 87 10 18 05 8D 00 53 87 14 18 06 11 00 80 03 8D 00 4A 94 00 00 25 87 13 18 06 11 00 80 03 8D 00 4A 94 00 00 25 87 05 18 10 14 03 8D 00 2A 87 0D 18 10 14 03 8D 00 00
    <= 00 90 00
    ... Here go additional LOAD commands for Method.cap ...
    => 80 E8 00 44 11 00 80 6A 08 11 6E 00 8D 00 39 11 6D 00 8D 00 39 7A 00
    <= 00 90 00
    StaticField.cap
    => 80 E8 00 45 21 *08* 00 1E 00 04 00 02 00 02 03 00 08 80 00 00 00 00 00 00 00 03 00 06 99 02 90 00 8E 08 00 00 00 00 00
    <= 00 90 00
    ConstantPool.cap
    => 80 E8 00 46 80 *05* 01 5A 00 56 02 00 02 15 02 00 02 18 02 00 02 0D 02 00 02 10 02 00 02 01 02 00 02 08 02 00 02 16 02 00 02 04 02 00 02 0F 02 00 02 0A 02 00 02 14 02 00 02 1B 02 00 02 12 02 00 02 09 02 00 02 11 02 00 02 1C 02 00 02 05 02 00 02 1A 02 00 02 1E 02 00 02 07 02 00 02 06 02 00 02 17 02 00 02 1D 02 00 02 20 02 00 02 1F 02 00 02 0E 02 00 02 02 02 00 02 0C 02 00 02 19 02 00 02 03 02 00 02 00
    <= 00 90 00
    => 80 E8 00 47 80 00 02 00 02 21 02 00 02 0B 02 00 02 13 03 80 0A 06 06 80 10 02 06 81 01 00 01 82 0A 00 06 80 10 00 06 83 03 08 05 00 00 02 06 80 08 01 06 82 0F 00 03 80 0A 09 03 80 03 02 05 00 00 00 03 80 0A 05 03 81 01 01 06 80 10 03 06 83 03 01 03 82 0B 05 06 80 08 07 06 83 03 04 03 81 01 03 03 82 0F 05 03 80 0A 07 06 82 0B 00 06 80 07 01 03 81 01 05 03 82 0F 03 06 00 02 7C 03 80 0A 08 03 80 03 00
    <= 00 90 00
    => 80 E8 00 48 5D 03 03 82 0F 07 06 80 10 06 03 00 02 82 03 82 0E 01 06 80 10 04 03 00 02 80 03 82 0B 04 06 80 08 0D 06 00 00 01 01 83 02 00 03 80 0A 04 06 82 0D 00 06 00 03 16 06 80 08 02 06 00 1A D9 03 82 0B 01 03 80 0A 01 06 80 08 0F 03 00 02 81 06 80 03 00 06 82 0E 00 01 82 08 00 01 00 02 00 00
    <= 00 90 00
    RefLocation.cap
    => 80 E8 00 49 80 *09* 02 AE 01 0C 10 09 09 0F 0F 08 07 0F 0F 09 09 08 08 0F 0F 09 09 08 08 07 07 08 04 04 08 04 0D 0C 0C 0C 1A 0E 05 28 24 14 2C 24 19 18 03 03 07 04 02 04 04 02 04 04 04 02 04 04 3D 1B 0D 0A 02 06 02 0B 0D 0A 02 06 02 09 83 80 0D FF 11 24 5C CE 27 02 17 02 11 02 19 02 21 A2 27 02 17 02 11 02 19 02 21 FC 2B 27 9F FF 0A 1C 2A 6B EB 28 11 02 17 11 02 11 02 19 11 02 21 60 28 11 02 17 11 00
    <= 00 90 00
    ... Here go additional LOAD command for RefLocation.cap ...
    => 80 E8 00 4E 31 15 13 1D 07 19 21 48 09 3C 13 09 08 0F 13 09 08 09 0D 15 0A 0D 15 0A 0D 15 09 0D 15 2B 74 05 06 0B 06 0B 06 0D 0C 07 08 0B 33 0E 08 0F 0C 05 18 06 00
    <= 00 90 00
    Descriptor.cap
    => 80 E8 00 4F 80 *0B* 02 B8 01 00 11 00 02 00 00 24 00 09 FF 1A 00 00 00 00 AE FF 1A 00 00 02 00 AE 00 12 00 02 00 00 AE 01 12 00 02 01 00 B0 02 12 00 02 02 00 B0 03 12 00 02 03 00 B4 04 12 00 02 04 00 B4 05 12 00 02 05 00 B8 06 12 00 02 06 00 BC 07 12 00 02 07 00 C0 08 12 00 02 08 00 C0 09 12 00 02 09 00 C4 0A 12 00 02 0A 00 C4 0B 12 00 02 0B 00 B0 0C 12 00 02 0C 00 B0 0D 12 00 02 0D 00 C0 0E 12 00 00
    <= 00 90 00
    => 80 E8 00 50 80 02 0E 00 C0 0F 12 00 02 0F 00 C4 10 12 00 02 10 00 C4 11 12 00 02 11 00 B0 12 12 00 02 12 00 B0 13 12 00 02 13 00 C8 14 12 00 02 14 00 C8 15 02 00 02 15 00 AE 16 02 00 02 16 00 AE 17 12 00 02 17 00 C8 19 02 00 02 19 80 04 1A 02 00 02 1A 80 04 1B 02 00 02 1B 80 04 1C 02 00 02 1C 80 02 1D 02 00 02 1D 80 02 1E 02 00 02 1E 80 02 1F 02 00 02 1F 80 02 20 02 00 02 20 80 03 21 02 00 02 21 00
    <= 00 90 00
    => 80 E8 00 51 80 80 02 18 02 00 02 18 00 CA FF 82 00 01 00 CE 01 51 00 00 00 00 80 10 01 54 00 D1 00 5E 00 00 00 00 81 10 01 B4 00 D1 00 5E 00 00 00 00 82 10 02 14 00 D5 00 66 00 00 00 00 FF 12 02 7C 00 DA 00 98 00 00 00 00 FF 12 03 16 00 DC 00 A7 00 00 00 00 00 19 03 BF 00 E1 00 4D 00 00 00 00 07 11 04 0E 00 E4 16 C9 00 00 00 00 FF 12 1A D9 00 E8 04 33 00 00 00 00 00 56 00 AE 00 CA 00 C0 00 C4 00 00
    <= 00 90 00
    => 80 E8 00 52 80 B0 00 C0 00 AE 00 B4 00 C4 00 C4 00 C8 00 ED 00 B0 00 C4 00 B0 00 EF 00 B8 00 ED 00 EF 00 C0 00 BC 00 C8 00 EF 00 F1 00 EF 00 C0 00 B0 00 B0 00 ED 00 B4 00 AE 00 EF 00 B0 00 C8 00 F3 00 F5 00 F9 FF FF 00 FE 01 02 00 AE 01 04 01 06 01 0B 00 E1 00 AE 01 0D 01 10 01 14 01 18 01 0D 01 18 01 1A 01 1E 01 10 00 F3 01 23 01 0B 01 10 01 1E 00 DA 00 CE 01 28 01 2A 01 2F 00 D5 01 0D 01 32 00 00
    <= 00 90 00
    => 80 E8 00 53 80 D1 01 04 01 35 00 CE FF FF 00 CE 01 38 00 DC 01 04 00 E8 01 10 01 3D 01 3F 00 D1 01 04 01 42 FF FF FF FF 01 B0 05 68 10 10 05 68 20 80 05 68 20 B0 05 68 20 E0 05 68 20 A0 05 68 20 F0 01 C0 05 68 30 20 03 44 10 06 44 4B 41 08 68 00 A4 41 02 B1 08 68 00 AB 41 04 B4 31 06 68 00 A1 07 68 00 AB 10 01 40 01 20 01 30 01 40 06 B4 B4 44 07 32 68 10 10 06 B4 B4 43 02 32 01 10 07 32 68 20 F0 00
    <= 00 90 00
    => 80 E8 80 54 3B 02 41 04 B4 41 06 B4 4B 44 05 B4 43 40 01 30 05 68 30 20 07 68 20 03 10 07 32 68 20 B0 01 20 07 B4 4B 44 20 04 B4 44 03 B4 40 03 43 B0 08 34 26 82 00 01 B0 03 43 C0 06 36 82 0E 00
    <NO RESPONSE>

  • Trying to run sample applet 'Wallet'. What is PIN?

    Dear
    I'm trying to run sample applet 'Wallet' in java card development kit.
    I have 2 questions.
    1) I successfully upload 'cap file'. but I got an error when I install it.
    I don't know why.
    Below is the APDU
    cm> upload "C:\wallet.cap"
    => 80 E6 02 00 16 09 77 61 6C 6C 65 74 70 6B 67 08 ......walletpkg.
    A0 00 00 00 03 00 00 00 00 00 00 00 ............
    (114664 usec)
    <= 00 90 00 ...
    Status: No Error
    => 80 E8 00 00 FF C4 82 02 A8 01 00 13 DE CA FF ED ................
    01 02 04 00 01 09 77 61 6C 6C 65 74 70 6B 67 02 ......walletpkg.
    00 1F 00 13 00 1F 00 0D 00 0B 00 66 00 12 01 87 ...........f....
    00 0A 00 3A 00 00 00 DD 00 00 00 00 00 00 01 01 ...:............
    00 04 00 0B 01 00 01 07 A0 00 00 00 62 01 01 03 ............b...
    00 0D 01 09 77 61 6C 6C 65 74 61 70 70 00 01 06 ....walletapp...
    00 12 00 80 03 02 00 01 04 04 00 00 00 3A FF FF .............:..
    00 2D 00 42 07 01 87 00 04 30 8F 00 0A 18 1D 1E .-.B.....0......
    8C 00 09 7A 05 40 18 8C 00 16 18 8F 00 10 3D 06 ...z.@........=.
    10 08 8C 00 15 87 00 AD 00 19 1E 1F 8B 00 03 18 ................
    8B 00 12 7A 01 10 AD 00 8B 00 08 61 04 03 78 04 ...z.......a..x.
    78 01 10 AD 00 8B 00 06 7A 02 21 19 8B 00 02 2D x.......z.!....-
    18 8B 00 0F 60 03 7A 1A 03 25 10 B0 6A 08 11 6E ....`.z..%..j..n
    00 8D 00 0D 1A 04 25 75 00 2D 00 04 00 20 00 27 ......%u.-... .'
    00 30 00 21 00 40 00 1B 00 50 00 15 18 19 8C 00 [email protected]......
    0E 7A 18 19 8C 00 04 7A 18 19 8C 00 17 7A 18 19 .z.....z.....z..
    8C 00 0B 7A 00 ...z.
    (551929 usec)
    <= 90 00 ..
    Status: No Error
    => 80 E8 00 01 FF 11 6D 00 8D 00 0D 7A 03 24 AD 00 ......m....z.$..
    8B 00 13 61 08 11 63 01 8D 00 0D 19 8B 00 02 2D ...a..c........-
    1A 07 25 32 19 8B 00 07 5B 29 04 1F 04 6B 07 16 ..%2....[)...k..
    04 04 6A 08 11 67 00 8D 00 0D 1A 08 25 29 05 16 ..j..g......%)..
    05 10 64 6E 06 16 05 63 08 11 6A 83 8D 00 0D AF ..dn...c..j.....
    01 16 05 41 11 27 10 6F 08 11 6A 84 8D 00 0D 18 ...A.'.o..j.....
    AF 01 16 05 41 89 01 7A 03 24 AD 00 8B 00 13 61 ....A..z.$.....a
    08 11 63 01 8D 00 0D 19 8B 00 02 2D 1A 07 25 32 ..c........-..%2
    19 8B 00 07 5B 29 04 1F 04 6B 07 16 04 04 6A 08 ....[)...k....j.
    11 67 00 8D 00 0D 1A 08 25 29 05 16 05 10 64 6E .g......%)....dn
    06 16 05 63 08 11 6A 83 8D 00 0D AF 01 16 05 43 ...c..j........C
    63 08 11 6A 85 8D 00 0D 18 AF 01 16 05 43 89 01 c..j.........C..
    7A 03 22 19 8B 00 02 2D 19 8B 00 11 32 19 05 8B z."....-....2...
    00 0C 1A 03 AF 01 8D 00 18 3B 19 03 05 8B 00 05 .........;......
    7A 04 22 19 8B 00 02 2D 19 8B 00 07 5B 32 AD 00 z."....-....[2..
    1A 08 1F 8B 00 14 61 08 11 63 00 8D 00 0D 7A 08 ......a..c....z.
    00 0A 00 00 00 .....
    (405152 usec)
    <= 90 00 ..
    Status: No Error
    => 80 E8 80 02 AE 00 00 00 00 00 00 00 00 05 00 66 ...............f
    00 19 02 00 00 00 02 00 00 01 03 80 0A 01 03 80 ................
    09 08 06 00 00 F0 03 80 0A 04 03 80 09 05 03 80 ................
    0A 06 03 80 09 02 06 00 00 0D 01 00 00 00 06 00 ................
    01 69 03 80 0A 09 06 80 07 01 06 00 01 49 03 80 .i...........I..
    03 03 01 80 09 00 03 80 0A 07 03 80 03 01 03 80 ................
    09 04 03 80 09 01 06 80 09 00 06 80 03 00 06 00 ................
    00 94 06 80 10 06 09 00 3A 00 0E 1F 02 0F 0D 5A ........:......Z
    41 11 05 05 41 0E 05 16 1A 00 28 04 06 07 04 07 A...A.....(.....
    0A 04 08 0D 07 05 10 1D 06 06 06 07 08 08 04 09 ................
    12 15 10 10 08 04 09 12 15 0D 0F 05 06 07 07 07 ................
    05 0A 08 00 ....
    (658167 usec)
    <= 00 90 00 ...
    Status: No Error
    Load report:
    684 bytes loaded in 1.8 seconds
    effective code size on card:
    + package AID 9
    + applet AIDs 16
    + classes 21
    + methods 394
    + statics 0
    + exports 0
    overall 440 bytes
    cm> install -i 77616c6c6574617070 -q C9#() 77616c6c6574706b67 77616c6c6574617070
    => 80 E6 0C 00 24 09 77 61 6C 6C 65 74 70 6B 67 09 ....$.walletpkg.
    77 61 6C 6C 65 74 61 70 70 09 77 61 6C 6C 65 74 walletapp.wallet
    61 70 70 01 00 02 C9 00 00 00 app.......
    (269663 usec)
    <= 6A 80 j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution
    Another question
    2) According to the code I have to specify PIN number when I
    install it. Is PIN different from PIN in the card?
    Is it application dependent?
    private WalletApp (byte[] bArray, short bOffset, byte bLength){
              pin = new OwnerPIN(PIN_TRY_LIMIT, MAX_PIN_SIZE);
              // bArray contains the PIN initialization value
              pin.update(bArray, bOffset, bLength);
              // register the applet instance with the JCRE
              register();
         } // end of the constructor
    Anyone can help?
    I really appreciate your help

    2) According to the code I have to specify PIN number when I
    install it. Is PIN different from PIN in the the card?
    Is it application dependent?Yes, it is an card idependent but application dependent PIN.
    Jan

  • Biometry Sample Problem on JCOP v2.4.1 R3

    Hi,
    I find some errors on running JCOP v2.4.1 R3 simulation of biometry sample included on JC 2.2.2 Dev Kit by using Eclipse. The CAP file has been produced but cannot upload like following session.
    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 19 52 78 8C 9C 5A 0D 62 00 .P....Rx..Z.b.
    (4531 usec)
    <= 00 00 DE 81 34 18 39 B7 09 70 FF 02 00 00 3D 02 ....4.9..p....=.
    9C 31 C7 89 E5 7F 86 4B FE 01 55 DA 90 00 .1.....K..U...
    Status: No Error
    cm> ext-auth plain
    => 84 82 00 00 10 12 F2 5E 0E 56 EC 74 C3 1F D9 BD .......^.V.t....
    28 6B 7B 9D F7 (k{..
    (10955 usec)
    <= 90 00 ..
    Status: No Error
    cm> delete -r a00000006203010c0f02
    => 80 E4 00 80 0C 4F 0A A0 00 00 00 62 03 01 0C 0F .....O.....b....
    02 00 ..
    (1994 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 -r a00000006203010c0f01
    => 80 E4 00 80 0C 4F 0A A0 00 00 00 62 03 01 0C 0F .....O.....b....
    01 00 ..
    (1264 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> upload -c -b 250 "C:\Downloads\Eclipse\workspace\Biometry\bin\com\sun\javacard\samples\biometry\bioServer\javacard\bioServer.cap"
    => 80 E6 02 00 17 0A A0 00 00 00 62 03 01 0C 0F 01 ..........b.....
    08 A0 00 00 00 03 00 00 00 00 00 00 00 .............
    (2812 usec)
    <= 00 90 00 ...
    Status: No Error
    Start loading Header.cap (71 byte)
    => 80 E8 00 00 47 C4 82 02 2F 01 00 40 DE CA FF ED ....G.../..@....
    02 02 04 00 01 0A A0 00 00 00 62 03 01 0C 0F 01 ..........b.....
    2B 63 6F 6D 2F 73 75 6E 2F 6A 61 76 61 63 61 72 +com/sun/javacar
    64 2F 73 61 6D 70 6C 65 73 2F 62 69 6F 6D 65 74 d/samples/biomet
    72 79 2F 62 69 6F 53 65 72 76 65 72 00 ry/bioServer.
    (2532 usec)
    <= 00 90 00 ...
    Status: No Error
    Header.cap loaded (71 byte)
    Start loading Directory.cap (36 byte)
    => 80 E8 00 01 24 02 00 21 00 40 00 21 00 0F 00 15 ....$..!.@.!....
    00 36 00 41 00 E7 00 0A 00 27 00 00 01 08 06 DE .6.A.....'......
    00 00 00 00 00 00 02 01 00 00 ..........
    (2914 usec)
    <= 00 90 00 ...
    Status: No Error
    Directory.cap loaded (36 byte)
    Start loading Import.cap (24 byte)
    => 80 E8 00 02 18 04 00 15 02 03 01 07 A0 00 00 00 ................
    62 01 01 02 01 07 A0 00 00 00 62 02 02 00 b.........b...
    (4714 usec)
    <= 6A 80 j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution
    This error is exactly same when I'm using the real NXP JCOP v2.4.1 R3 card (J3A040). What's wrong with this? I have not do any editing, just import the .java files from Dev Kit into Eclipse workspace.
    Best regards,

    Hi,
    You may be able to find an open source biometric library. It would probably not be the javacardx.biometry package though. I have not looked for one but you could search the forum for similar posts. I believe this has been discussed before.
    Cheers,
    Shane

  • Plz, help me~! not upload  cap file.

    I am new to the javacard technology.
    I have implementing an applet by using eclipse 3.1 + JCOP plug-in.
    And I set my project to build against JC211.
    The created cap-file I'm trying to upload works fine when used with a simulated card.
    But, When i try to upload it to my cards(G&D smartcare expert 3.1) I get the following error.
    upload "F:\02. 2006\05. 10\10.17\\HelloWorld\bin\HelloWorld\javacard\HelloWorld.cap"
    jcshell: Cannot read <F:\02. 2006\05. 10\10.17\\HelloWorld\bin\HelloWorld\javacard\HelloWorld.cap>: java.util.zip.ZipException
    ??> install -i d4106509900010 -q C9#() d410650990 d4106509900010
    => 80 E6 0C 00 1C 05 D4 10 65 09 90 07 D4 10 65 09 ........e.....e.
    90 00 10 07 D4 10 65 09 90 00 10 01 00 02 C9 00 ......e.........
    00 00 ..
    (121415 usec)
    <= 6A 80 j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution
    Has anyone seen this error before?
    Anyone help me, plz!!
    plz! plz! plz! plz! plz! Help me~~~!

    Make sure you are using the right java card library version (JavaCard and OpenCard version).
    Most cards only support jc2.1.2 - in opposite of the emulator which was designed for jc2.2.1.
    Jan

  • Problem with Cipher.ALG_RSA_PKCS1_OAEP constant

    Hi everybody.
    I've got some data encrypted with RSA public key and padded according to PKCS 1 OAEP.
    I tried to use this line in the constructor of my applet:
    private WiMaxApp (byte buffer[], short offset, byte length)
              rsa_PrivateCrtKey = (RSAPrivateCrtKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_CRT_PRIVATE, KeyBuilder.LENGTH_RSA_1024, false);
              /* Doing this here get error back at compilation time */
              rsa_Cipher = Cipher.getInstance(Cipher.ALG_RSA_PKCS1_OAEP, false);
              // rsa_Cipher = Cipher.getInstance(Cipher.ALG_RSA_NOPAD, false);
              // register(buffer, (short)(offset+1) ,(byte)(buffer[offset]));
              register();
         }and I get an error when I launch the simulator:
    cm>  install -i 77696d61782e617070  -q C9#() 77696d6178 77696d61782e617070
    => 80 E6 0C 00 20 05 77 69 6D 61 78 09 77 69 6D 61    .... .wimax.wima
        78 2E 61 70 70 09 77 69 6D 61 78 2E 61 70 70 01    x.app.wimax.app.
        00 02 C9 00 00 00                                  ......
    (3234 usec)
    <= 6A 80                                              j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting executionIf I put the same line in the process() method it compile well, but at run time I get an error.
    If I use the Cipher.ALG_RSA_NOPAD it does work, but when I decrypt with the private key the data, obviously, it does not decrypt correctly...
    Does anyone knows where is the problem? I'm using a Jcop simulator 41 v2.2
    Please, it's very important, I need help as soon as possible.
    Thank you very much in advance,
    emanuele

    Looks like the JCOP simulator (and probably the JCOP cards as well) do not support the PKCS#1-OAEP padding scheme.
    If I use the Cipher.ALG_RSA_NOPAD it does work, but when I decrypt
    with the private key the data, obviously, it does not decrypt correctly...I hope you did not forget to initialize the keypair (it is not part of your posted code). The KeyBuilder does only allocate the memory for storing an RSA keypair - you have to initialize (or better fill) it with a valid RSA keypair.
    Jan

  • Debug Problem on Jcop Tools

    Hello,
    I have developed a Java Card Applet on Eclipse and I can run it through Jcop Tools' simulator. However, when I try to debug it, simulator returns 6A80 to upload command. Would you please tell me, what can be the reason of this problem?
    Thanks in Advance,
    Regards

    Dear ankey21, thank you for your response. Restarting Eclipse could not solve the problem.
    Here is apdu trace:
    cm>  upload -d -b 250 "D:\**.cap"
    => 80 E6 02 00 12 05 6D 79 61 70 70 08 A0 00 00 00    ......myapp.....
        03 00 00 00 00 00 00 00                            ........
    (1556 usec)
    <= 00 90 00                                           ...
    Status: No Error
    => 80 E8 00 00 FA C4 83 01 1E D7 01 00 15 DE CA FF    ................
        ED 02 02 04 00 01 05 6D 79 61 70 70 05 6D 79 61    .......myapp.mya
        70 70 02 00 21 00 15 00 21 00 09 00 32 04 56 00    pp..!...!...2.V.
        55 4A 89 00 DD 0A 62 00 00 0C 5F B7 73 00 18 00    UJ....b..._.s...
        0B 00 B2 05 01 00 04 00 32 05 02 01 07 A0 00 00    ........2.......
        00 62 01 01 02 01 07 A0 00 00 00 62 02 01 02 01    .b.........b....
        07 A0 00 00 00 62 01 02 00 01 06 A0 00 00 01 51    .....b.........Q
        00 00 01 07 A0 00 00 00 62 00 01 03 00 09 01 05    ........b.......
        4D 79 41 70 70 04 09 06 00 55 00 00 80 00 80 03    MyApp....U......
        43 00 40 04 06 00 00 04 32 FF FF 04 1D 04 3C 32    [email protected].....<2
        E3 32 EE 00 84 00 07 00 07 01 02 00 08 47 4D 47    .2...........GMG
        72 46 56 46 66 46 95 46 D1 47 11 47 E1 47 F6 48    rFVFfF.F.G.G.G.H
        04 00 84 00 08 00 07 01 00 00 0A 49 6E 49 BA 49    ...........InI.I
        C4 49 D0 49 EB 4A 0C 4A 1B 4A 2D 4A 3F 4A 71 07    .I.I.J.J.J-J?Jq.
        4A 89 24 03 D3 80 1A 03 ED 00 00 04 25 80 04 04    J.$.........%...
        2B 00 AB 04 54 01 AE 06 04 00 64 04 54 01 AE 00    +...T.....d.T...
    (864915 nsec)
    <= 6A 80                                              j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting executionRegards,

Maybe you are looking for