matheus ribeiro wrote:
> Hi Snit,
> 
> what jdk version are you using? Using the cap file in GPShell, I was
> able to create and load the bin file with no problems. Then, I got the
> HelloWorld applet code and:
> 
> - compiled with jdk1.4.2_06 to generate class files;
> - converted the class with java_card_kit-2.2.1 to generate cap;
> - extracted the cap using jar and created the bin file as per your
> instructions (following even the order of files).
> - deleted the applets using delete script;
> - loaded the new bin file.

Again look in the documentation of your smart card. Each manufacturer
should describe precisely what version of the JDK and Java Card is
needed for his card. jdk1.4.x may be a problem. Use 1.3 or 1.2, what the
manufacturer says. But your problem is probably the Java Card Kit. If
you still have the Orga card which supports Open Platform 2.0.1' this
version is often bundled with Java Card 2.1.... Give version 2.1.2 a
try, at least a CyberFlex card needs this version. Java Card 2.2 has
some features which your card does not know about, so the generated CAP
file is wrong.

Karsten

> 
> Then I got the error (trace enabled):
> 
> ===========================================
> [EMAIL PROTECTED]:~/src/GlobalPlataform/GPShell-src-1.1.1-old/matheus$
> gpshell helloInstall.txt
> enable_trace
> establish_context
> card_connect
> select -AID a0000000030000
> --> 00A4040007A0000000030000
> <-- 6F198408A000000003000000A50D9F6E064051302320179F6501FF9000
> open_sc -security 1 -keyind 0 -keyver 0 -mac_key
> 404142434445464748494a4b4c4d4e4f -enc_key
> 404142434445464748494a4b4c4d4e4f // Open secure channel
> --> 8050000008896A6A145B4418FF00
> <-- 00003087000769902236FF011A2971E6E9F1348BC5E24B67F9A5ADFC9000
> --> 84820100102E330639AA6BE4361B1D98FAD50816E3
> <-- 9000
> install_for_load -AID a00000006203010c01 -nvCodeLimit 1000
> --> 80E602001409A00000006203010C01000006EF04C60203F80000
> <-- 009000
> load -file HelloWorld.bin
> -->
> 80E80000EFC482019B010013DECAFFED010204000109A00000006203010C0102001F0013001F000E000B0036000C0067000A00130000006C00000000000001010004000B01020107A000000062010103000E010AA00000006203010C0101001406000C00800301000107010000001F070067000210188C000118110100900B8700188B00027A02308F00033D8C00043B7A0523198B00052D198B0006320329041F651B1A08AD0016041F8D00073B16041F41290419088B00083270E6198B00093B19160408418B000A1903088B000B19AD000316048B000C7A08000A00000000000000000000050036000D020000000680030003
> 
> <-- 6A80
> load_applet() returns 0x80206A80 (6A80: Wrong data / Incorrect values in
> command data.)
> ======================================
> 
> So I suppose its some kind of java version incompatibility. Any clue?
> BTW, I noticed a bug in the helloInstall.txt. It tries to delete the
> package before the applet. The lines:
> 
> ==========================
> delete -AID a00000006203010c01
> delete -AID a00000006203010c0101
> ==========================
> 
> should be:
> ==========================
> delete -AID a00000006203010c0101
> delete -AID a00000006203010c01
> ==========================
> 
> Thanks
> Matheus
> 
> 
>         Hi, Matheus,
> 
>         Just to complement Karsten's comment, here's an example of
>         exracting
>         contents from a .cap file and creating a .bin file.
> 
>         cp com/sun/javacard/samples/HelloWorld/javacard/HelloWorld.cap .
>         jar xvf HelloWorld.cap
>         extracted: com/sun/javacard/samples/HelloWorld/javacard/Header.cap
>         extracted:
>         com/sun/javacard/samples/HelloWorld/javacard/Directory.cap
>         extracted: com/sun/javacard/samples/HelloWorld/javacard/Applet.cap
>         extracted: com/sun/javacard/samples/HelloWorld/javacard/Import.cap
>         extracted:
>         com/sun/javacard/samples/HelloWorld/javacard/ConstantPool.cap
>         extracted: com/sun/javacard/samples/HelloWorld/javacard/Class.cap
>         extracted: com/sun/javacard/samples/HelloWorld/javacard/Method.cap
>         extracted:
>         com/sun/javacard/samples/HelloWorld/javacard/StaticField.cap
>         extracted:
>         com/sun/javacard/samples/HelloWorld/javacard/RefLocation.cap
>         extracted:
>         com/sun/javacard/samples/HelloWorld/javacard/Descriptor.cap
> 
>         cat com/sun/javacard/samples/HelloWorld/javacard/Header.cap
>         com/sun/javacard/samples/HelloWorld/javacard/Directory.cap
>         com/sun/javacard/samples/HelloWorld/javacard/Import.cap
>         com/sun/javacard/samples/HelloWorld/javacard/Applet.cap
>         com/sun/javacard/samples/HelloWorld/javacard/Class.cap
>         com/sun/javacard/samples/HelloWorld/javacard/Method.cap
>         com/sun/javacard/samples/HelloWorld/javacard/StaticField.cap
>         com/sun/javacard/samples/HelloWorld/javacard/ConstantPool.cap
>         com/sun/javacard/samples/HelloWorld/javacard/RefLocation.cap
>         com/sun/javacard/samples/HelloWorld/javacard/Descriptor.cap >
>         HelloWorld.bin
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Muscle mailing list
> [email protected]
> http://lists.drizzle.com/mailman/listinfo/muscle

_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to