How to load an applet in card?

Hi everyone,
I use NetBeans and its JavaCard Simulator, protocol T = 0, and I am wandering how to load an applet using APDU tool instead of clicking on Run Projetc which do the mentioned thing. It would be helpfull if someone post ouptut and explain all used apdu commands.
Thanks,
Mare.

Here is the APDU trace:
Select Card Manager
=> 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00
<= 6F 10 84 08 A0 00 00 00 03 00 00 00 A5 04 9F 65
    01 FF 90 00
Authenticate
cm>  init-update 255
=> 80 50 00 00 08 09 41 55 62 DF F5 61 2B 00
<= 00 00 C6 D8 6A 1C B2 02 14 13 FF 02 00 00 93 73
    3A B8 2C 0F 8E A4 1D EF 84 60 77 12 90 00
cm>  ext-auth plain
=> 84 82 00 00 10 B5 AA A8 E6 8B 73 57 F9 5D 37 6C
    D1 FE CF 56 32
<= 90 00
Install For Load
=> 80 E6 02 00 12 05 11 11 11 11 11 08 A0 00 00 00
    03 00 00 00 00 00 00 00
<= 00 90 00
Load Block 1
=> 80 E8 00 00 FF C4 82 01 65 01 00 1A DE CA FF ED
    02 02 04 00 01 05 11 11 11 11 11 0A 68 65 6C 6C
    6F 57 6F 72 6C 64 02 00 21 00 1A 00 21 00 0A 00
    0B 00 2A 00 0E 00 A1 00 0A 00 17 00 00 00 5A 02
    5A 00 00 00 00 00 00 01 01 00 04 00 0B 01 02 01
    07 A0 00 00 00 62 01 01 03 00 0A 01 06 11 11 11
    11 11 11 00 08 06 00 0E 00 00 00 80 03 00 FF 00
    07 01 00 00 00 1C 07 00 A1 00 01 10 18 8C 00 04
    7A 05 30 8F 00 09 3D 8C 00 02 18 1D 04 41 18 1D
    25 8B 00 03 7A 04 22 18 8B 00 07 60 03 7A 19 8B
    00 06 2D 1A 04 25 75 00 6D 00 06 00 00 00 1D 00
    01 00 2C 00 02 00 3B 00 40 00 4A 00 41 00 57 00
    42 00 62 19 8B 00 05 3B 19 03 1A 07 25 8B 00 08
    70 49 19 8B 00 05 3B 19 03 1A 07 25 8B 00 08 70
    3A 19 8B 00 05 3B 19 03 1A 07 25 8B 00 08 70 2B
    03 32 04 8D 00 00 32 1F 8D 00 01 70 1E 05 8D 00
    00 32 1F 8D 00
<= 00 90 00
Load other Blocks with  80 E8 00 xx ... which xx is the Block number
Load Last Block
=> 80 E8 80 01 6A 00 01 70 13 03 8D 00 00 32 1F 8D
    00 01 70 08 11 6D 00 8D 00 01 7A 08 00 0A 00 00
    00 00 00 00 00 00 00 00 05 00 2A 00 0A 06 80 08
    10 06 80 07 01 06 00 00 01 03 80 03 02 06 80 03
    00 03 80 0A 06 03 80 0A 01 03 80 03 03 03 80 0A
    08 01 00 02 00 09 00 17 00 00 00 13 05 06 04 0A
    07 07 25 09 06 09 06 09 08 05 06 05 06 05 08 00
<= 00 90 00
Install For Install
cm>  install -i 111111111111  -q C9#() 1111111111 111111111111
=> 80 E6 0C 00 1A 05 11 11 11 11 11 06 11 11 11 11
    11 11 06 11 11 11 11 11 11 01 00 02 C9 00 00 00
<= 90 00Note that if you want to use APDU manually, you should do the authenticate process and loading all blocks of the CAP file yourself.
Note that this is the APDU for a real card that is executed in JCOP Environment. I think it should work for the simulators too except the authentication commands.

Similar Messages

  • How to load Java applets on Gemxplore 3G card ? (APDU inside)

    Hi,
    Does anyone have experience on how to load Java applets into Gemxplore 3G card ?
    I tried to load the tck applets into Gemxplore 3G card but the got sw 6985 for INSTALL FOR INSTALL Make Selectable
    Here is the details on APDUs.
    Do you know what is wrong ?
    Regards
    -guoqing
    SELECT
    *00 A4 04 00 07 A0 00 00 00 18 43 4D*
    *61 1A [Normal ending of the command with <26> bytes of extra information.]*
    INITIALIZE UPDATE
    *80 50 01 01 08 00 01 02 03 04 05 06 07 (1C)*
    *43 4D 6D FF 23 B5 C4 13 20 1A 01 01 9F 15 97 A5 CE E9 CF A7 19 C6 8D F9 8B 9A 78 DB, 90 00 [Normal ending of the command.]*
    EXTERNAL AUTHENTICATE
    *84 82 01 00 10 EB 88 23 3C B6 4E 23 E9 69 1B 30 08 56 7A 1F 8F*
    *90 00 [Normal ending of the command.]*
    INSTALL FOR LOAD
    *84 E6 02 00 24 09 A0 00 00 00 62 B0 BA A1 01 00 00 0E EF 0C C6 02 00 00 C8 02 00 00 C7 02 00 00 00 53 9D 96 C2 D4 8F 41 6B (00)*
    *00, 90 00 [Normal ending of the command.]*
    SELECT
    *00 A4 04 00 07 A0 00 00 00 18 43 4D*
    *61 1A [Normal ending of the command with <26> bytes of extra information.]*
    INITIALIZE UPDATE
    *80 50 01 01 08 00 01 02 03 04 05 06 07 (1C)*
    *43 4D 6D FF 23 B5 C4 13 20 1A 01 01 A5 57 A0 A0 00 7E 5A 3F A5 10 6A 37 69 16 AA 6F, 90 00 [Normal ending of the command.]*
    EXTERNAL AUTHENTICATE
    *84 82 01 00 10 28 BA 3A C4 D6 05 C9 C9 70 37 39 F1 7B 6D F8 80*
    *90 00 [Normal ending of the command.]*
    INSTALL FOR INSTALL Make Selectable
    *84 E6 0C 00 36 09 A0 00 00 00 62 B0 BA A1 01 09 A0 00 00 00 62 B0 BA A1 81 09 A0 00 00 00 62 B0 BA A1 81 01 00 0C EF 08 C7 02 00 00 C8 02 00 00 C9 00 00 A4 CE 57 8B 19 F2 9E 0A (00)*
    *69 85*
    Edited by: guoqing on May 19, 2008 6:06 AM
    Edited by: guoqing on May 19, 2008 6:20 AM

    I don't have any experience with GTO's cards, but one would expect they provide a user guide or a data sheet how to load applications.. Reasons could be:
    1. Issuer policy to have a certain security level for content management --> raise the security level to C_MAC + ENC
    2. Issuer policy this card is static --> no post-issuance

  • How to load an Applet application for 1000cards?

    Hi Friends..
    I want to know How to load an Applet application for 1000cards?..
    Assume that, i have an Applet application that need to loaded into 1000cards..
    So, how to solve this?
    Do i must to load an application manually for each card?
    Is there any another way?
    Thanks in advance..

    for 1000 cards you can use a "small" printer like an evolis "dualis" or something like that
    we've produced thousands of cards with this method in my company.
    the pro is that you can also print the cards in the same time.
    they usually have simple APIS like get_new_card_from_loader(), put_card_on_contacts(), eject_card()
    you can connect any reader on the printer , the raw card contacts are available on a connector.
    some printers also have contactless couplers.
    but remember that deploying cards in the field is not just loading an applet.
    it's also a cryptographic challenge, you need to change the card keys or anyone will be able to play with your cards, adding and removing applets as they want.
    typically this is achieved by using an ultra secret mother key and whatever derivation algorithm you like using data from INIT UPDATE as diversifier. example, you can TDES cipher part of the INIT UPDATE data using the mother key as TDES key, or use something involving SHA1, using a HSM if you are serious, etc.
    for your entertainment here is a high volume card personnalization machine. That's amazing.
    http://www.youtube.com/watch?v=6ZBF_yKRF5w

  • How to load an applet using custom classloader ?

    Hi All,
    How to load an applet using custom classloader rather than using default browsers classloader i.e AppletClassLoader usually ?
    Regards,
    Kumar.

    I would guess that that would require two applets.
    The first does nothing but create the custom class loader and then load the second applet.

  • How to load an applet jar file?

    Hello everyone,
    I have an applet that uses my own jar file and approximately 6 third party jar files. I set up jar indexing (jar -i) which will download the jar files when they are needed. All seems to work well, but now I want to manually load the jar files which I cannot get working.
    When the applet starts, about 1/2 of the jar files are downloaded (because they are needed at startup). I then want to load the additional jar files in the background, after the gui is initialized. I have tried this using the below thread which is executed from within the applet's start method:
    // Try to load additional jar files in background by loading a class from each jar file.
    Thread loadClass = new Thread() {
      public void run() {
        System.out.println("Loading classes...");
        try {
          // Tried loading classes this way, doesn't work.
          getClass().getClassLoader().loadClass("pkg1.Class1");
          getClass().getClassLoader().loadClass("pkg2.Class2");
          getClass().getClassLoader().loadClass("pkg3.Class4");
          getClass().getClassLoader().loadClass("pkg4.Class4");
          /* Loading classes this way doesn't work either.
          Class.forName("pkg1.Class1");
          Class.forName("pkg2.Class2");
          Class.forName("pkg3.Class3");
          Class.forName("pkg4.Class4");
        catch(ClassNotFoundException e) {
          // First attempt to load a class (pkg1.Class1) throws exception.
          System.out.println("Can't find class: " + e.getMessage());
    loadClass.start();As you can see from above I am trying to load a class from each of the jar files so that the jar files would load into memory/cache. Unfortunately, it cannot find the classes. These are the errors from the java console:
    Loading classes...
    Loading: pkg1.Class1
    Connecting http://my.server.com/my_dir/pkg1/Class1.class with no proxy
    Connecting http://my.server.com/my_dir/pkg1/Class1.class with cookie "JSESSIONID=some_big_long_char_list"
    Can't find class: pkg1.Class1
    So it appears the jar file is not being downloaded. When I take away the dynamic jar loading (removing the "jar -i" & adding them all to the applet archive list) the thread executes correctly. So I know the class names, etc, are correct. How does one load an applet jar file?
    Any help/suggestions are appreciated.

    The above error I posted was because I forgot to index the jar files. That is why it couldn't find the jar file. I thought I was getting farther along with my problem, but I apparently just forgot to index the jars. I am now getting the problem that I got yesterday...
    The applet freezes/hangs when it hits the thread. The GUI never opens (even though I'm running this thread right after the gui shows). The java console quits responding and the applet just stays the grey screen. I also tried the invoke later that you suggested.
    public void start() {
      // ...initialize gui...
      // Applet freezes and remains grey, also the java console freezes.
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          System.out.println("Loading classes...");
          try {
            // When I comment out the below forName calls, the thread will still run evidenced through the done print statement.
            Class.forName("pkg1.Class1");
         Class.forName("pkg2.Class2");
         Class.forName("pkg3.Class3");
         Class.forName("pkg4.Class4");
            System.out.println("...Done loading classes");
          catch(Exception e)     {
            System.out.println("Can't find class: " + e.getMessage());
    }

  • How to load an applet in a swing frame?

    Hi All,
    Can any one tell how to load a HTML applet in a Swing frame, I have a requirement where in the swing frame must contain a HTML applet.
    Thanks in advance...
    Panneer.

    Panneerselvam wrote:
    Can any one tell how to load a HTML applet in a Swing frame, I have a requirement where in the swing frame must contain a HTML applet.You don't. The requirement reeks of the ridiculous.
    Also, what is an "HTML" applet and how is it different from a regular applet or JApplet? I feel a case of jargonitis coming on.

  • How to load an applet with older version of JRE?

    Hi All,
    I'm writing an applet which should read the username from the user's system using System.getProperty("user.name") method. I've JRE 1.4.2 in my browser, and it's throwing a AccessControlException whenever the applet is trying to read the "user.name" system property. So, I want to load this particular applet with an older version of JRE, say JRE 1.3. I've tried various approaches like,
    <jsp:plugin type="applet" code="LoginApplet.class" archive="login.jar"
         jreversion="1.3"     iepluginurl="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
    </jsp:plugin>
    and also tried OBJECT tag,
    <OBJECT
    classid="clsid:CAFEEFAC-0013-0000-0000-ABCDEFFEDCBA" codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"
         width="200" height="200" align="baseline" >
    <PARAM NAME="code" VALUE="LoginApplet.class">
    <PARAM NAME="archive" VALUE="login.jar">
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
    <PARAM NAME="scriptable" VALUE="true">
    No Java 2 SDK, Standard Edition v 1.3 support for APPLET!!
    </OBJECT>
    I've not tried the simple APPLET tag because we can't specify a java plugin using the APPLET tag.
    In both the above methods, I'm still getting AccessControlException. In Java console, I'm seeing Java Plugin as 1.4.2.
    Can someone tell me is it possible to read the "user.name" system property from user's machine using Applets? If yes, how?
    Thanks,
    Tarun.

    Applets are prevented from doing certain things - reading data is one - to maximize security. You can either add permissions to the computer that the applet is running on, or you can sign the applet.
    See
    http://java.sun.com/docs/books/tutorial/security1.2/tour1/step2.html
    and
    http://forum.java.sun.com/thread.jspa?threadID=686184&tstart=45

  • How to load an Applet on a panel, within another Applet

    Hi,
    I want to know if and how it is possible to load an applet/application on a Panel within another Applet/Apllication.
    Who can help me?
    tnx

    You want to use an applet inside an other applet?
    Applet extends Panel
    you can take the source of the second applet, and instead of extending Applet extends Panel, and call the init method from the first applet.
    Hope this help

  • How to load an applet in different folder??

    Hello, (sorry about my english, I speak spanish)
    I have an applet in :
    E:/ProyectosPrueba/testJSP/classes/testjsp/AppletConfig.class
    and I have a Page JSP (that call it (the applet)) in:
    E:/ProyectosPrueba/testJSP/jspConnectApplet.jsp
    inside this page I have the tag:
    <APPLET
    CODEBASE = "."
    CODE = "testJSP.AppletConfig.class"
    NAME = "SA"
    WIDTH = 120
    HEIGHT = 20
    </APPLET>
    I works in JBuilder 5.0 and inside it, this works well, but when
    I attempt to do this in Internet Explorer doesn't load the applet
    the error is :
    java.lang.ClassNotFoundException: testJSP.AppletConfig
         at com/ms/vm/loader/URLClassLoader.loadClass
         at com/ms/vm/loader/URLClassLoader.loadClass
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.run
         at java/lang/Thread.run
    Can someone help me??

    Try to write the path to the applet after "codebase". Maybe it will help.
    Ex. <applet code="test.class" codebase="test/classes">
    /A

  • How to load java applet to java-enabled card

    I have downlaoded the sdk n run some samples. but when i connect the card as through pcsc reader, and tried to install some ready applet in the card explorer,it fail n give me 6a80.
    How can i load a java card applet into a java-card?

    You will need a loader. To develop a loader, you will need to follow the steps outlined in the Global Platform specs to establish a secure channel and install.

  • How to load an applet with 2 classes and get it to display properly

    Ok I am a very newbie as you can tell by code below but I need help duh. I am a student taking a Java course on my own (ie no marks) so I know what I am doing in a second level java courseI am not sure if my problem is with "Forte for Java 4, CE" or my code. I have two files. Door.java and Exercise4a.java
    The code is as follows:
    Door.java
    package Exercise4.Exercise4a;
    import java.awt.*;
    import java.applet.*;
    public class Door extends java.applet.Applet {
    /** Creates a new instance of Door */
    int x;
    int y;
    public void init() {
    Graphics b;
    public Door(Point aPoint)
    x = (int)aPoint.getX();
    y = (int)aPoint.getY();
    public void paint(Graphics graphics)
    graphics.drawRect(0 + x ,0 + y, 20,30);
    graphics.setColor(Color.black);
    graphics.fillOval(15 + x,15 + y ,5,5);
    graphics.drawImage(buffer,0,0,this);
    public static void main(String args[]){}
    and Exercise4a.java
    package Exercise4.Exercise4a;
    import java.awt.*;
    import java.applet.*;
    public class Exercise4a extends java.applet.Applet {
    Graphics b;
    public void init() {
    Point a = new Point(0,0);
    Door door = new Door(a);
    My problem is that I do not see my door when I compile either file.
    What am I doing wrong? Is this acode problem. ie how do I load the graphics or is it that I am not compiling it correctly.

    package Exercise4.Exercise4a;
    import java.awt.*;
    import java.applet.*;
    public class Exercise4a extends java.applet.Applet {
    Graphics b;
    public void init() {
    Point a = new Point(0,0);
    Door door = new Door(a);// door.paint (b)

  • How to load an applet from Cache

    I have a signed applet that accesses the file structure of the local machine. I dont want this applet to be downloaded everytime a user goes to that url. I want the applet to be loaded from the browser's cache. The size of the jar file is very big so it takes a lot of time to download the jar files. PLease help

    specify the following in the html file containing the applet
    i.e. inside the applet tag.
    <applet>
    <PARAM NAME="cache_option" VALUE="Plugin">
    </applet>
    In this case, it will take the latest cached version from the java plug installed on ur system.
    Have a nice day,
    Balaji.

  • Loading the applet

    Hi All,
    I've been asked to produce documentation for java card beginners. I'd like to double check much of what I write. Is this right: the easiest way to convert a class file to an applet and load it on to a card is to use a vendor package, like Gemplus's RAD III?
    Is it any easier to do this using the latest java card kit than it was with 2.1.2, or is the vendor package still the way to go?
    I suspect the vendor package will still get the nod. If so, which one is the one to go for? It may be that it is a case of six of the one or half a dozen of the other. I am only familiar with RAD III.
    Does any one know how to load a pure java card application not importing or implemeting visa.openplatform but only importing javacard.framework? I'd like to make the first applet example as simple as possible.
    Thanks
    Chris

    Most, if not all, vendors use the standard, Sun Converter. This is what converts your java class file into a CAP file. This cap file is what gets downloaded onto a JC. Since you get the Sun converter with the Sun JC kit, that's the easiest way to convert. I recommend this way to assure that the cap files you are generating are adhereing to standards. see VerifyCap. As far as a loader, you may develop your own OR use a vendor specific tool.
    The Sun kit version is for the card, not client side. Therefore, you need to check the version of the card you are using. Currently most, if not all, are 2.1.x.
    For starting out, I'd say use a vendor's kit. In my opinion there are only 2 good kits out there. I'd worry more about who can give you the better simulator, since they all provide a loader.
    You only need to import visa.openplatform if you are implementing it in your applet. So if you don't use any openplatform, you won't need to import it. Keep in mind the implementation is already loaded onto your card.
    To see a simple applet look at the Sun's HelloWorld applet.

  • How to load a java card applet into a java card

    Dear All,
    I am a novice to java card technology..
    I have done some search on how to load a java card applet into a smart card but haven't found a satisfactory answer. I have read about installer.jar and scriptgen tool but I want to load the applet from a java program and not from command line. It would be of great help if somebody can help me out.
    If somebody can share a sample program which load a javacard applet(.CAP file) into a smart card, I will be very thankful.
    I am able to find some client applications which help us send APDU commands and recieve response APDU's to interact with an applet loaded on to the smart card but not application which actually load the applet.
    I have heard of OCF and GP.. some say that OCF technology is outdated and no longer in use.. can somebosy throw some light on this too..
    cheers,
    ganesh

    hi siavash,
    thanks for the quick response.. i checked out GPShell as suggested, it looked like a tool by which one can load an applet on to card and send some sample apdu commands... but I want to load the applet from the code.
    My application should look something like this.. it will be a swing applicaton where I have a drop down with a list of readers, I select the one desired and then click on "LOAD" after inserting a blank java card, at this point my applet which is stored in my DB should get loaded on to the java card. The next step should be to personalize it where I enter the values for the static variables of my applet and click "PERSONALIZE", at this point all these values should be embedded into APDU commands and sent to the java card for processing.
    For achieving this I am yet to find a comprehensive sample or documentation on the net.
    Please help...
    regards,
    ganesh

  • How to know the size of the EEPROM after loading any Applet

    How can I know the size of the EEPROM after loading any applet..
    Any comments on this is appreciated
    Thank you in advance

    kishansaralaya wrote:
    Thanks for your suggestion.
    But when I try to use
    short memRemaining = JCSystem.getAvailableMemory(JCSystem.MEMORY_TYPE_PERSISTENT);
    it always shows 32767. Even after loading some applet.
    And I am using 72K Java card then how it can show only 32Kbyte as the remaining memory value.This is because a short isn't big enough to display a number above 32767. One way around this is to use a byte[] to fill up some of the space with your temporary applet.
    byte[] memoryFiller = new byte[32767];
    short memRemaining = JCSystem.getAvailableMemory(JCSystem.MEMORY_TYPE_PERSISTENT);The value of memRemaining + 32767 is the amount of persistent memory left on the card. If memRemaining is still 32767, you can add another byte[] starting with small values and increase the size until you get a meaning ful result (less than 32K).

Maybe you are looking for