JCOP and CAP file components

Hi,
I'm trying to reproduce the APDU install (for load) and load (CAP file) commands the JCOP shell executes when you run an applet whith JCOP 3.1.
I noticed that the JCOP shell executes as many load commands as the CAP file size requires since the max datafield size of an APDU command is 255 bytes. But when I add the size of of the commands, I get 793 bytes when the CAP file size is 4695 bytes.
I found in the JavaCard JCVM specification, which describes the CAP file format that a CAP file is divided in several CAP files. So It seems to me that JCOP parse the "global" CAP file and only load parts of it in the emulated card.
The question is, which "little" CAP files are required to load the applet correctly and how could you know how the CAP file is actually structured in order to parse it correctly ?

Hi,
the CAP-File is a special and very complex format and the result of the JCOP build process for a package (all applets of this package).
Loading an applet from a CAP-File via the JCShell "upload" command consists of 2 steps:
- first: send the upload initialization command
- second: send the code for this applet in (n) max. 255-byte blocks
Every code block has 6 leading command bytes.
The byte stream to send to the card or emulation depends on some requirements like header, code, debug-info, description...
So it cannot have the same size like your CAP-file!!

Similar Messages

  • Cap file Components size limit ( ? )

    Hello,
    I'm wondering if there is a limitation on the Cap file internal components size.
    as specified in the JVM Spec from SUN, a cap file consists on several elements (byte sequences) : Header.cap , Class.cap, StaticField.cap, etc.
    Does a component have a size limit ?
    I'm asking this question because I'm facing serious problem when loading Applets on Gemplus SIM cards(GemWpressoV3 ) : the load process interrupts sudenly and the card responds with 6F00 !!
    For info, the Method.cap components is 11748 bytes !!
    Thank you for your Help and Info
    Kartagos

    here is a complete description of the Cap I can't load :
        Header.cap (29 Bytes)
        Directory.cap (34 Bytes)
        Import.cap (62 Bytes)
        Applet.cap (23 Bytes)
        Class.cap (94 Bytes)
        Method.cap (8484 Bytes)
        StaticField.cap (6312 Bytes)
        ConstantPool.cap (925 Bytes)
        RefLocation.cap (1411 Bytes)
        Descriptor.cap (2340 Bytes)

  • JCWDE and CAP file

    Something is unclear to me.
    It seems like even when I don't load my applet into the "Card", everything works fine when I try it using jcwde.
    Cref is reacting differently and basically more in the way I expect it to react. If I don't load the applet using the installerapplet I get an error back when selecting my own applet.
    I shouldn't complain too much but I've got few questions to make things clear in my mind:
    1: How jcwde works to emulate an applet ?
    2: What are the files that contains the applet code when running an jcwde?
    3: Is the .app file the only file required by jcwde ?
    Thanks in advance..

    1.JCWDE v. Reference Implementation......
    JCWDE runs Java VM so no memory constraints
    JCWDE doesn't have persistance ( No E2P )
    JCWDE doesn't have firewall restrictions
    JCWDE allows NON JC primitive types
    Reference Implementation utilizes JC VM
    Reference Implementation enforces JCRE firewall, SIO, transactions, atomicity
    Reference Implementation has an E2P
    Reference Implementation uses CAP file so bytecode validation is done
    2. For the JCWDE, it's your class file since JCWDE is using the Java VM.
    3. The .app file is used to take the resolve the aid and applets. This is also done for generating a CAP file but the results are different

  • Wrong CAP file version error message

    I'm trying to write a loader application that will send a CAP file into JavaCard, and then install it automatically.
    I have developed my JavaCard Applet by using Eclipse3.1.0 and JCOP30.
    After running my JavaCard Applet by Eclipse, I got its CAP file in folder [b\bin\FVSCardPkg\javacard\[/b]
    But when I run my loader application with this CAP file, the error message will display:
    EX: msg Wrong CAP file version, class class com.ibm.jc.JCException
    Wrong CAP file version
         at com.ibm.jc.CapFile.parseHeader(Unknown Source)
         at com.ibm.jc.CapFile.readCapFile(Unknown Source)
         at com.ibm.jc.CapFile.<init>(Unknown Source)
         at LoaderPkg.loader.load(loader.java:35)
         at LoaderPkg.loader.main(loader.java:20)
    This is my loader application source code:
    import java.io.*;
    import com.ibm.jc.*;
    import com.ibm.jc.terminal.*;
    *  Sample /**
    *  Sample loader. Demonstrates how to use the offcard API to download
    *  a cap-file on a JCOP41V22 Engineering sample card and listing of applets loaded will
    * follow.
    public class loader{
         private final static String termName = "pcsc:4"; // Real card
    //     private final static String termName = "Remote"; // Simulator
         protected static final byte[] JCOP_CARD_MANAGER_AID = { (byte) 0xa0, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00};
         protected static final byte defaultInstallParam[] = { -55, 0 };
         static String[] capFileName={"D:/MyCardPkg.cap"};
         public static void main(String[] args){
              try{
                   loader l = new loader();
                   l.load();
              }catch(Exception e){
                   System.err.println("EX: msg " + e.getMessage() + ", class " + e.getClass());
                   e.printStackTrace(System.err);
              System.exit(0);
              //Likewise for simulation, be patient the port takes time to close.
              //Use command line "netstate" to check the disapperance of the port before
              // activating JCShell command to read the simulated card.
         private loader(){}
         private void load() throws Exception{
              CapFile capFile = new CapFile(capFileName[0], null);
              System.out.println("Package name: " + capFile.pkg);
              byte[][] applets = capFile.aids;
              if ((applets == null) || (applets.length == 0)){
                   throw new RuntimeException("no applets in cap file");
              // Get connection to terminal, take note that jcop.exe is required to be activated
              // in simulation mode.
              System.out.println("Open terminal ...");
              //Make sure that the simulator jcop.exe is activated before unmarking this satement
              //Remember to delete the downloaded applet before running otherwise error is
              //expected if the simulator finds the existence of the applet with the
              //same pakage name ID and AID
              //Issue /close command at "cm" prompt if the card is in use,, ie it should
              //have "-" prompt. Be patient that the port takes time to close. Use command line
              //"netstate" to check the disapperance of the port before running.
              // pcsc:4=Card Terminal  Or  Remote=LocalHost Terminal
              JCTerminal term = JCTerminal.getInstance(termName, null);
              //For real JCOP41V22 card, please unmark this statement and delete the downloaded
              //applet before running. Error expected if the card finds the existence of the applet
              //with the same pakage name ID and AID
              //Issue /close command at "cm" prompt if the card is in use,, ie it should
              //have "-" prompt.
              term.open();
              // Add in this statement for real card which requires some response time
              term.waitForCard(5000);
              // Create a logging terminal spitting out the APDUs on standard out
              TraceJCTerminal _term = new TraceJCTerminal();
              _term.setLog(new PrintWriter(System.out));
              _term.init(term);
              term = _term;
              // Get JavaCard representative, passing NULL resets card and returns ATR
              System.out.println("Get card ...");
              JCard card = new JCard(term, null, 2000);
              // Get the off-card representative for the card manager and use it to
              // select the on-card CardManager
              System.out.println("Select card manager ...");
              CardManager cardManager = new CardManager(card, CardManager.daid);
              cardManager.select();
              // For downloading something, we have to be authenticated to card manager.
              // For this, the keys must be set. The keys to use should of course
              // be configurable as well.
              byte[] dfltKey = c2b("404142434445464748494a4b4c4d4e4f");
              cardManager.setKey(new OPKey(255, 1, OPKey.DES_ECB, dfltKey));
              cardManager.setKey(new OPKey(255, 2, OPKey.DES_ECB, dfltKey));
              cardManager.setKey(new OPKey(255, 3, OPKey.DES_ECB, dfltKey));
              cardManager.setKey(new OPKey(1, 1, OPKey.DES_ECB, c2b("707172737475767778797a7b7c7d7e7f")));
              cardManager.setKey(new OPKey(1, 2, OPKey.DES_ECB, c2b("606162636465666768696a6b6c6d6e6f")));
              cardManager.setKey(new OPKey(1, 3, OPKey.DES_ECB, c2b("505152535455565758595a5b5c5d5e5f")));
              System.out.println("init Update ...");
              cardManager.initializeUpdate(255,0);
              System.out.println("Authenticate to card manager ...");
              cardManager.externalAuthenticate(OPApplet.APDU_CLR);
              // And load the cap-file, do not forget to call installForLoad
              System.out.println("Loading cap-file ...");
              byte[] cardManagerAid = cardManager.getAID();
              cardManager.installForLoad(capFile.pkgId,0, capFile.pkgId.length, cardManagerAid, 0, cardManagerAid.length, null, 0, null, 0, 0, null, 0);
              cardManager.load(capFile, null, CardManager.LOAD_ALL, null, cardManager.getMaxBlockLen());
              byte[] capaid = capFile.aids[0];
              System.out.println("Finished loading !");
              // Install applet, we try to install the first applet given in the
              // cap file, and try to instantiate it under the same AID as given for its
              // representation in the cap file. No installation data is passed.
              System.out.println("Installing applet ...");
              cardManager.installForInstallAndMakeSelectable(capFile.pkgId, 0, capFile.pkgId.length, capaid,0, capaid.length, capaid, 0, capaid.length, 0, defaultInstallParam, 0, defaultInstallParam.length, null, 0);
              System.out.println("Install succeeded!");
              // synchronize state with on-card card manager
              System.out.println("Update!");
              cardManager.update();
              // Print information regarding card manager, applets and packages on-card
              JCInfo info = JCInfo.INFO;
              System.out.println("\nCardManager AID : " + JCInfo.dataToString(cardManager.getAID()));
              System.out.println("CardManager state : " + info.toString("card.status", (byte) cardManager.getState()) + "\n");
              //Echountered error 6A 86 with this statement:Object[] app = cardManager.getApplets(CardManager.GET_APPLETS,
              //CardManager.CVM_FORMAT_HEX, true);
              //Solved the bug by playing the integers in arg0 and arg1.
              Object[] app = cardManager.getApplets(1, true);
              if (app == null) {
                   System.out.println("No applets installed on-card");
              } else {
                   System.out.println("Applets:");
                   for (int i = 0; i < app.length; i++) {
                        System.out.println(info.toString("applet.status", (byte) ((OPApplet) app).getState()) + " " + JCInfo.dataToString(((OPApplet) app[i]).getAID()));
              // List packages on card
              // Encountered error with this statement:Object[] lf = cardManager.getLoadFiles(CardManager.CVM_FORMAT_HEX, true);
              // Solved the bug by setting arg0 = 0,
              Object[] lf = cardManager.getLoadFiles(true);
              if (lf == null) {
                   System.out.println("No packages installed on-card");
              } else {
                   System.out.println("Packages:");
                   for (int i = 0; i < lf.length; i++) {
                        System.out.println(info.toString("loadfile.status", (byte)((LoadFile) lf[i]).getState()) + " " + JCInfo.dataToString(((LoadFile) lf[i]).getAID()));
              term.close();
         static String numbers = "0123456789abcdef";
         private byte[] c2b(String s) {
              if (s == null) return null;
              if (s.length() % 2 != 0) throw new RuntimeException("invalid length");
              byte[] result = new byte[s.length() / 2];
              for (int i = 0; i < s.length(); i += 2) {
                   int i1 = numbers.indexOf(s.charAt(i));
                   if (i1 == -1) throw new RuntimeException("invalid number");
                   int i2 = numbers.indexOf(s.charAt(i + 1));
                   if (i2 == -1) throw new RuntimeException("invalid number");
                   result[i / 2] = (byte) ((i1 << 4) | i2);
              return result;
    How to solve this problem?
    Thank you in advance.

    I'm not understanding if your cap file is in "b\bin\FVSCardPkg\javacard\", then why are you loading "D:/MyCardPkg.cap"?
    The issue isn't with your off card application, but the cap file version. Look at the cap file components in JCVM specification. I believe it's the Header component. The major, minor should match your card but not greater. In other words, your can't load a 2.2 on a 2.1 card, but a 2.1 can load on a 2.2

  • Eclipse-jcop project building { create .cap file } problem??????????????

    hello all,
    I am using jcop tool plugin with eclipse and my atr is:-
    --Opening terminal
    /card -a a000000003000000 -c com.ibm.jc.CardManager--Waiting for card...
    ATR=3B E9 00 00 81 31 FE 45 4A 43 4F 50 34 31 56 32    ;....1.EJCOP41V2
        32 A7                                              2.everything is fine with sample applet { it contain a empty process () or gives 90 00 for select applet apdu }
    I am using eclipse ide and jcop plugin, basically my problem is to building project when any changes occoured, initially when i start a new project with steps like:-
    1- java card project
    2-java applet
    3-package id
    4-applet id
    5-basic template of applet
    N- finish
    ok
    then when screen open, at the left side i saw cap file propery window ,and automatically there are cap file in bin folder.
    It means jcop tool used converter to make .cap file, but when i add some lines according to my requirment,
    I am unable to build it again or unable to get a new cap file. May be i need to set some build path , but first time it automatically build so it also indicate that there are no need to set the build path. I am confused in this area.
    Is i need to reference the path of converter.jar { jcdk 2.2.1 }? or jcop plugin also have the required jar for converting .class to .cap , inside it. how i rebuild it and make a new fresh .cap file.
    some jar file which i paste in plugin folder of eclipse are:-
    com.ibm.bluez.jcop.eclipse.demopack_1.0.2.jar
    com.ibm.bluez.jcop.eclipse.perftest_1.0.2.jar
    com.ibm.bluez.jcop.eclipse.signlite_1.0.2.jar
    com.ibm.bluez.jcop.eclipse.targetpack.gemplus_1.0.0.jar
    com.ibm.bluez.jcop.eclipse.targetpack_1.0.3.3.jar
    com.ibm.bluez.jcop.eclipse_1.0.3.3.jar
    com.ibm.bluez.jcop.eclipse_3.1.1.a.jarbefore i was using JCDE plugin for simulation process but here i did not use JCDE, I have only eclipse + jcop plugin
    I tried to tell you, what is my problem, If you still have any doubt , Let me know.
    Waiting for your reply and thanks for your time ............

    Thanks Umer for your suggestion , but i dont need to do this, It was my silly mistake to handle the things properly.
    Initially i was unable to getting the eclipse and JCOP concept, but now i do. now I am able to build the project or eclipse is building it automatically !!!! I faced this problem b'se i am a newbie in java card. but now things going good to me.
    I want to share my getting here:--
    My dout was - Is jcop intially have all the Jar's , converter which is required to create a cap file????
    My ans is - Yes, EVERYTHING IT HAVE INSIDE.
    you just get eclipse ide and get jcop plugin, and paste jcop plugin jar's inside the plugin folder of ecipse and START ECLIPS AGAIN.
    NOW EVERYTHING IS SET FOR YOU,
    NO REQUIREMENT OF JCDE-java card development envoirnment
    no requirement of jcdk- java card development kit ,
    no requirement of set any build path in eclipse. just make your applet , and run with jcop tool.ECIPSE AUTOMATICALLY BUILD OPTION WILL CREATE A FRESH .CAP FILE WHENEVER U MADE A NEW CHANGES
    cheers!!!

  • 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

  • Unable to load the cap file to the JCOP card

    I develop my applet by JCOP IDE and it works well in the VM. But when I want to load it on my JCOP card, I face a problem. it can successful send the 1st 254 bytes, but always return 6A86 when send the second 254 bytes to the card.
    Status: Incorrect parameters (P1,P2)
    Error code: 6a86 (Incorrect parameters (P1,P2))
    Offending APDU: 6A86
    Wrong response APDU.
    I don't know why this happen. Can anyone show some light on that. Thank you in advance.

    Have you written your own loader for this ?
    What is the prompt "cm>" from, is that a standard Java Card tool ?
    Looking at the data I can see, its looks well formed. However when I wrote my own loader I found I could only send 239 bytes of data (255 - 16) otherwise I'd get an error. Maybe part of this is todo with the option of using M-DAP to MAC each APDU. FYI its a JCOP10 I'm using.
    Also my data was never concatentated, that is to say, check your 'FileSystem.cap' file with "unzip -tv FileSystem.cap" for the real CAP files. Each of these files never crossed an APDU boundary, the first one Header.cap (IIRC) is a small file, so my first APDU was less than 40 bytes of actual data (with C4 TLV data before it), certainly not 254 bytes.
    I'm not sure if this is allowed or not, I've plans to try it out soon and see myself since i've not read anything that says you can not do this.
    This is the only obvious difference I can see to other loader scripts and programs I have seen.

  • Tokens are diffirent between CAP file and Export File

    hi Safamer, hi all guys.
    firstly, thanks all for concerning my issue.
    As i know, java card technology link components base on TOKEN.
    But the question is: the token in Export file and in the CAP file are different. So, how can off-card installer can link everything.
    For example.
    My_Package1:
    Class1:
    protected field1
    private field2
    public filed3
    ---> in the ExportFile, i have token for filed1 and field3 are 0 and 1 correspondingly. But in the CAP, these are not.
    Thanks for your answer.
    Edited by: hoan_micheal on Jun 14, 2011 1:41 AM

    dear guys!
    I check very careful for this issue. And the results are:
    - With the instance Field, virtual method ( i mean non-static), the token in the ExportFile and the token in the CAPFile is SAME
    - with the static Filed and STATIC Method, the token is different and i don't see any rule to link these tow value. For example
    --------------------------------------------------------------------CAP file --------------------------------------------ExportFile
    \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\public----------private --------------------------------------token
    \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\token-----------token------------------------------------------
    public........static     short     sf1....=......1------------12---------------------------------------------------------->0
    private......static     short     sf2....=......2----------------------------21          
    protected..static     short     sf3....=......3------------14---------------------------------------------------------->1
    private......static     short     sf4....=......4----------------------------23          
    public     .......static short     sf5....=......5------------16---------------------------------------------------------->2
    public...... static     short     sfn1-------------------------0----------------------------------------------------------> 3
    private......static     short     sfn2--------------------------------------- 6          
    protected..static     short     sfn3-------------------------2----------------------------------------------------------> 4
    ...............static     short     sfd1....=.....7-------------------------- 25          
    ..............static     short     sfd2....=.....8          
    public......static     byte     sb1....=......1------------18---------------------------------------------------------->5
    private......static     byte     sb2....=......2---------------------------27          
    protected.static     byte     sb3....=......3------------19---------------------------------------------------------->6
    private......static     byte     sb4....=......4---------------------------28          
    public...... static     byte     sb5....=......5------------20---------------------------------------------------------->7
    public ......static     byte     sbn1-----------------------4------------------------------------------------------------->8
    private......static     byte     sbn2-------------------------------------------10          
    protected..static     byte     sbn3-----------------------5     ---------------------------------------------------------->9
    ...............static     byte     sbd1....=....10------------------------------29          
    ...............static     byte     sbd2-------------------------------------------11          
    - with the Class in a package, the token is diffent. For example.
    Package library{----------------------------exportFile Token----------------------------CapFIle--- the Offset in the Class Component
    ............. Class1--------------------------->not ---------------------------------------------->0
    public.....Class2---------------------------->0-------------------------------------------------->1
    public.....Class3---------------------------->1-------------------------------------------------->2
    ............Class4---------------------------->not------------------------------------------------>3
    public.....Class5---------------------------> 2 ------------------------------------------------> 4
    Those are really different. Could you help me to understand this.
    Thanks a lot

  • I can not transfer date from one hard drive to another, I keep getting an error because I have two of the same file names and one file name is in caps and I cant change the file name

    can not transfer date from one hard drive to another, I keep getting an error because I have two of the same file names and one file name is in caps and I cant change the file name. My original external has an error and needs to be reformatted but I dont want to lose this informations its my entire Itunes library.

    Sounds like the source drive is formatted as case sensitive and the destination drive is not. The preferred format for OS X is case insensitive unless there is a compelling reason to go case sensitive.
    Why can't you change the filename? Is it because the source drive is having problems?  If so is this happening with only one or two or a few files? If so the best thing would be to copy those over individually and then rename them on the destination drive.
    If it is more then you can do manually and you can't change the name on the source you will have to reformat the destination as case sensitive.
    Btw this group is for discussion of the Support Communities itself, you;d do better posting to Lion group. I'll see if a host will move it.

  • Upload cap file by net on client card, and protect cap file. Encode cap?

    How upload cap file by internet on client card, and protect cap file. Encode cap file?
    cap file > Server (keys) --> internet --> Client Program --> JCOP10 card
    Can I use secure channel protocol ? How ?

    Thanks for response.
    Problem for me is communication between client program(computer) -> reader -> card.     
    The cap file is in Bin format.
    Transmission can by easy scanned. How to protect this step of upload process?.
    Internet is no problem.
    My English is pure, and I have problem to understand specification.
    Can I upload, install cap file encoded by Secure Channel Protocol '02' ?
    If yes, then some example, log file can help me understand how to do this and how build APDU commend. I Use my program (Delphi) to communicate with reader and card.

  • Generating the .CAP, .JCA and .EXP files.

    Hello;
    I have downloaded the java_card_kit-2_1_2 to &lsquo;C:\java_card_kit-2_2_1", and I tried to compile HelloWorld application that shipped with its distribution. I was successfully able to compile the file HelloWorld.java, but I am having lots of problems in generating the .CAP, .JCA and .EXP files.
    I tried to follow the instructions in jcdk2.2.1 user guide, but of no use.
    This is what I am basically doing:
    _Step1) Setting my Environment Variables as follows:_
    *set JC_HOME=C:\java_card_kit-2_2_1*
    *set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_16*
    *set PATH=.;%JC_HOME%\bin;%JAVA_HOME%\bin;%PATH%*
    _Step2) Compile the java file_
    The package of HelloWorld.java is : src.com.sun.javacard.samples.HelloWorld, so to compile I use the following command line:
    *javac -g -target 1.1 -source 1.3 -classpath .\classes;..\lib\api.jar;..\lib\installer.jar src\com\sun\javacard\samples\HelloWorld\*.java*
    _Step3) Converting_
    I have the class file generated in the package folder: src.com.sun.javacard.samples.HelloWorld, I generated an .opt file as follows:
    +-out EXP JCA CAP+
    +-exportpath .+
    +-debug+
    +-applet 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1:0x1 src.com.sun.javacard.samples.HelloWorld.HelloWorld+
    +src.com.sun.javacard.samples.HelloWorld 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1 1.0+
    Finally, the command line for conversion is:
    *set _CLASSES=%JC_HOME%\lib\apduio.jar;%JC_HOME%\lib\apdutool.jar;%JC_HOME%\lib\jcwde.jar;%JC_HOME%\lib\converter.jar;%JC_HOME%\lib\scriptgen.jar;%JC_HOME%\lib\offcardverifier.jar;%JC_HOME%\lib\api.jar;%JC_HOME%\lib\installer.jar;%JC_HOME%\lib\capdump.jar;%JC_HOME%\samples\classes;%CLASSPATH%;*
    *"%JAVA_HOME%\bin\java" -classpath %_CLASSES% com.sun.javacard.converter.Converter -config src\com\sun\javacard\samples\HelloWorld\HelloWorld.opt*
    After successfully executing all these lines, I get the following error:
    Java Card 2.2.1 Class File Converter, Version 1.3
    Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    *+error: class HelloWorld does not belong to package src.com.sun.javacard.samples.HelloWorld.+*
    conversion completed with 1 errors and 0 warnings.
    PLEASE HELP! I also tried adding -classdir to the opt file, but still did not work.
    The whole point behind this exercise is to import a javacard framework of version 1.0
    Really appreciate anyone's help! Thanks in advance.

    Thank you Shane, but my claSs file is indeed saved in "C:\java_card_kit-2_2_1\samples\src\com\sun\javacard\samples\HelloWorld"
    Now since I am running my command lines from C:\java_card_kit-2_2_1\samples, so I guess that the class directory is:
    src.com.sun.javacard.samples.HelloWorld
    Right?

  • IDES for writing Java card applets and converting the applets as CAP FILE.

    I have developed a JAVA CARD APPLET , FindMFValueJCA.java . It gets compiles in net beans 6.0 But while converting the applet to CAP file i am getting some errors. Is there any other IDES which take care of converting the CAP files

    What's the Java version you are using?
    As the java card tool kit has version dependencies. If you are using java_card _kit 2.2.2 then 1.5 is fine.                                                                                                                                                                                                                                                                                                   

  • Error in convertionof .class to CAP file

    we are using java_card_kit-2_2_1 with j2sdk-1.4.2_12 for developing Applet for Smart card.We are new to the javacard enviornment.We are testng with the avvailable samples in java card kit.
    The steps we are following is given below:
    1.Convertion of java file to class file.
    Class file generated in the path- c:\java_card_kit-2_2_1\samples\src\com\sun\javacard\samples\Helloworld
    2. convertion of class file to Cap file:
    we are using one batch file -run.bat
    run.bat:
    set CLASSES=%JCHOME%\lib\apduio.jar;...;%JC_HOME%\lib\api.jar;%JC_HOME%\lib\capdump.jar;
    xcopy /s %JC_HOME%\api_export_files\*.* exp
    java -classpath %_CLASSES% samples.src.com.sun.javacard.samples
    converter -config HelloWorld.opt
    3.We are running the run.bat file when exp folder is created having the .exp files init.
    4.Then we are using the converter as:
    converter -config ...HelloWorld.opt.
    the .opt file contains..
    -out EXP JCA CAP
    -exportpath C:\java_card_kit-2_2_1\api_export_files
    -applet 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1:0x1
    com.sun.javacard.samples.HelloWorld.HelloWorld
    com.sun.javacard.samples.HelloWorld
    0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1 1.0
    Then the error is generated as:
    error:export file framework.exp of package javacard.framework not found.
    the above run.bat file the line below needs explanation..
    java -classpath %_CLASSES% samples.src.com.sun.javacard.samples
    converter -config HelloWorld.opt
    plz reply
    Message was edited by:
    jit_hk

    converting .class files to a loadable format for the smart card creates .cap file and .exp files. the .exp files specify information about any (shared) libraries.
    i dunno how exactly to do it with the java card kit from sun. look into the jcop converter tric.jar .

  • CAP file generating ERROR

    Hi everybody ,
    I'm trying to build a javacard project by using ANT tool . The problem is when i use the JCOP tool converter (tric.jar) with JRE 1.4 or 1.5 i got the following error :
    Error: class java.lang.RuntimeException, resolving constant-pool of clazz Lhun/eid/javacard/EIDApplet; failed: no such method getClass, ()Ljava/lang/Class; in Ljava/lang/Object;
    and JCOP tool converter with JRE 1.6 , igot another error : invalid magic cafebabe
    After that , i replaced the JCOP tool's converter by using the java_card_kit-2_2_2's converter , and i got another error :
    [java] converting hun.eid.javacard.EIDApplet
    [java] parsing C:\Users\mannykitty\workspace NEW\HUNEID\lib\api_export_files\javacard\framework\javacard\framework.exp
    [java] parsing C:\Users\mannykitty\workspace NEW\HUNEID\lib\api_export_files\javacardx\crypto\javacard\crypto.exp
    [java] error: line 2094: hun.eid.javacard.EIDApplet: method getClass() of class java.lang.Object not found in export file lang.exp or the method signature has changed.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class not found in export file lang.exp.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class in return type of method java.lang.Object.getClass() not found.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: method getClass() of class java.lang.Object not found in export file lang.exp or the method signature has changed.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class not found in export file lang.exp.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class in return type of method java.lang.Object.getClass() not found.
    [java] conversion completed with 6 errors and 0 warnings.
    [java] Java Result: 1
    Can someone tell me how to fix this ? Any help will be appreciated !

    I've added the api.jar to class path for compiling but it's seemed not to be changed . Here is my ANT build.xml config :
    <property name="lib" value="lib"/>
         <property name="JCKlibHome" value="c:\Java\java_card_kit-2_2_2\lib"/>
    <property name="JCOPlib" value="${lib}/slbJIop.jar;${lib}/jc_api_212.jar;${lib}/jce1_2_2.jar;${lib}/sunjce_provider.jar"/>
    <property name="JCOPtools" value="${JCKlibHome}/converter.jar;${JCKlibHome}/offcardverifier.jar"/>
    <property name="src" value="src"/>
         <property name="build" value="build"/>
    <property name="classes" value="${build}/classes"/>
    <property name="cardout" value="${build}/card"/>
    <property name="tmp" value="${build}/tmp"/>
    <property name="buildcp" value="${JCOPlib};${JCKlibHome}/api.jar"/>
    Compile :
    <target name="compile" depends="init" description="Compile the javacard source into class files">
    <!-- Compile the java code from ${src} into ${classes} -->
    <javac debug="yes" classpath="${buildcp}" srcdir="${src}" destdir="${classes}"/>
    </target>
    CAP generation:
    <target name="createCAP" depends="compile,capuptodatecheck" unless="capfile.uptodate" description="Create the CAP file from the class files">
    <java classname="com.sun.javacard.converter.Converter" classpath="${JCOPtools}" fork="yes">
         <arg line="-classdir ${classes}" />
         <arg line="-exportpath ${JCOPlib};C:\Java\java_card_kit-2_2_2\api_export_files"/>
         <arg line="-d ${cardout}" />
         <arg line="-v" />
         <arg line="-out CAP EXP JCA" />
         <arg line="-applet 0x41:0x70:0x70:0x68:0x75:0x6e:0x65:0x69:0x64 hun.eid.javacard.EIDApplet hun.eid.javacard 0x41:0x70:0x70:0x68:0x75:0x6e:0x65:0x69:0x64:0x01" />
         <arg line="1.0" />
    ERROR :
    [java] error: line 2094: hun.eid.javacard.EIDApplet: method getClass() of class java.lang.Object not found in export file lang.exp or the method signature has changed.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class not found in export file lang.exp.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class in return type of method java.lang.Object.getClass() not found.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: method getClass() of class java.lang.Object not found in export file lang.exp or the method signature has changed.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class not found in export file lang.exp.
    [java] error: line 2094: hun.eid.javacard.EIDApplet: class java.lang.Class in return type of method java.lang.Object.getClass() not found.
    [java] conversion completed with 6 errors and 0 warnings.
    [java] Java Result: 1
    :(

  • JavaCard .cap file generation throws IllegalArgumentException

    Hi all,
    I'm trying to generate a .cap file for some applet source provided externally, and capgen/converter are throwing an IllegalArgumentException when I attempt to generate a .cap (either straight from .opt or using capgen on a pre-generated .jca file). I'm able to generate/run the .cap file from JCOP tools for eclipse, so I'm able to verify it's authenticity.
    The output I'm getting is pretty basic even in verbose mode:
    C:\projects\MWallet\src>converter -config .\com\schip_select\schip.opt
    Java Card 2.2.1 Class File Converter, Version 1.3
    Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    parsing C:\projects\MWallet\src\com\mycard\schip_select\Constants.class
    parsing C:\projects\MWallet\src\com\mycard\schip_select\schip.class
    parsing C:\projects\MWallet\src\com\mycard\schip_select\schip_pin.class
    parsing C:\projects\MWallet\src\com\mycard\schip_select\protected_array.class
    converting com.mycard.schip_select.Constants
    converting com.mycard.schip_select.schip
    parsing C:\JavaCardDevelopment\api_export_files\javacard\framework\javacard\framework.exp
    parsing C:\JavaCardDevelopment\api_export_files\java\lang\javacard\lang.exp
    parsing C:\gp211\org\globalplatform\javacard\globalplatform.exp
    parsing C:\JavaCardDevelopment\api_export_files\javacard\security\javacard\security.exp
    converting com.mycard.schip_select.schip_pin
    converting com.mycard.schip_select.protected_array
    parsing C:\JavaCardDevelopment\api_export_files\javacardx\crypto\javacard\crypto.exp
    writing C:\projects\MWallet\src\com\mycard\schip_select\javacard\schip_select.jca
    java.lang.IllegalArgumentException
    Cap file generation failed.
    conversion completed with 1 errors and 0 warnings.
    The opt file I've got should be fairly un-offensive:
    -out CAP
    -exportpath "c:\JavaCardDevelopment\api_export_files;C:\gp211;.\"
    -debug
    -i
    -v
    -noverify
    -applet 0xA0:0x00:0x00:0x00:0x04:0x10:0x10 com.schip_select.schip
    com.schip_select
    0xA0:0x00:0x00:0x00:0x04:0x10 1.0
    I've tried with or without the -noverify flag.
    I'm using Java JDK Standard Edition (build 1.4.1_07-b02) to run the converter, and compile the source files. And I've tried the converter in the Sun Java Card Development kit 2.2.1 and 2.2.2. I've also tried attaching the jdb.exe to converter to see whats going on, I can see that it fails in a function:
    com.sun.javacard.jcasm.cap.ReferenceLocationComponent.addTwoByteOffset()
    But can't get anymore information than that. Any pointers to what could be causing this (I frankly don't know where to start) would be greatly appreciated.
    Thanks,
    James

    6A80 is the error which says that there is mismatch between jc version of card and java version.
    For Javacard 2.2.1 java version is jdk.1.4.1
    But lets not focus on that
    I tried to recreate the problem. You were using GP classes to create a cap file so I downloaded GP exp files from
    [http://www.globalplatform.org/specificationform2.asp|http://www.globalplatform.org/specificationform2.asp].
    Compiled files as
    javac -g -classpath .\classes;..\lib\api.jar;..\lib\installer.jar;libs/gp211.jar;libs/jc221.jar {PACKAGE_DIR}\*.javaMy opt file is as
    -out EXP JCA CAP
    -exportpath C:\java_card2.2.1\java_card_kit-2_2_1\api_export_files;C:\GP211\GP_exportA00000015100
    -applet <APPLET_AID> <Applet_DIR>
    <PACKAGE>
    <PACKAGE_AID> 1.0and called converter command as
    converter -config {PATH_TO_EXPORT_FILE}\HelloWorld.optI was able to create the CAP file successfully.

Maybe you are looking for

  • Problem while writing in a file

    Hi, i want to write some bytes in a file but it is producing an error error: ==== java.io.FileNotFoundException: C:\Documents and Settings\rrus\My Documents\data.pkcs7data (The system cannot find the path specified) code: ==== File obj_file = new Fil

  • 2LIS_02_SCL update issue

    Dear sir, Issue I created a Purchase order for an article to a site.It is required to update in a Data source .But it is not updating . Please help me. Anlysis I tried after doing Goods receipt too, but it is not working. I need it to update it becau

  • BPM Alerts Method/Function Module

    Hi, Which MTE Method sends SMS for BPM? I want to change the SMS content. If I can know the Method name, I can edit the function module. If any further infromation is required please let me know. Points gauranteed. Please help. --Ragu

  • From paintComponent to actionPerformed

    hi , i have the following code and i want to perform the commands i am doing in paintComponent when i press my button (actionPerformed method) can anyone please tell me how to do that ? i've searched some swing books/documentation with no success. pa

  • NVL2 in Expression

    Hi All, Im facing a problem at a map when i use the NVL2 in the expression the following error appears Line 1,col 1 PLS-00201: idnetifier 'NVL2' must be declared it can be done through transformation, But i think its duable through the expression ple