This discussion is archived
8 Replies Latest reply: Dec 18, 2012 3:05 AM by 936354 RSS

Writing a Java card client

936354 Newbie
Currently Being Moderated
I need to have a computer to access the Java card terminal.
I don't derive from the class Applet, right.
What I want to do is to get the IP of the terminal and start from there.
But what's next? How do I grab the data from the terminal to the local computer/server?
Thanks
Jack
  • 1. Re: Writing a Java card client
    Umer Journeyer
    Currently Being Moderated
    is your terminal is based on TCPIP ?
    If yes then you can create socket to communicate with it. You might need internal API/libraries specific to the terminal to do this.
  • 2. Re: Writing a Java card client
    936354 Newbie
    Currently Being Moderated
    Opencard framework - 2 questions

    I am looking into the OCF which seems to be easier to code with.
    Thanks
  • 3. Re: Writing a Java card client
    Umer Journeyer
    Currently Being Moderated
    933351 wrote:
    I am looking into the OCF which seems to be easier to code with.
    This should not be the reason for adapting a specific language platform. OpenCard is obsolete now after smartcardio has come with java. But the choice is yours.
  • 4. Re: Writing a Java card client
    936354 Newbie
    Currently Being Moderated
    http://umer555.wordpress.com/2012/06/04/java-card-host-application-offcard-application/

    The author informs us that that set of api doesn't work well with the Java Card Simulator.
    That's my major concern.
    Thanks
    Jack
  • 5. Re: Writing a Java card client
    Umer Journeyer
    Currently Being Moderated
    By the way i am the author of this blog.
    My point was that always try to avoid using obsolete technologies. But if you are happy with Opencard then you use it either way.
    As for as simulator is concern yes smartcardio communicates with real card. But even then for debugging of java card applets you can use tools like jcop and after installing your debugged applet on real card you can debug your client/host application code, that is how i program.
  • 6. Re: Writing a Java card client
    936354 Newbie
    Currently Being Moderated
    Hell Umer
    Didn't notice that I was you, but where can I get JCOP plugin? went to eclipse website, look in plugin section and type "JCOP" to no avail
    I'd like to know how can you make sure there is nothing wrong between the host application and the applet as you can't test them as a whole unit?
    Thanks
    Jack

    Edited by: 933351 on Dec 13, 2012 6:28 PM
  • 7. Re: Writing a Java card client
    Umer Journeyer
    Currently Being Moderated
    but where can I get JCOP plugin? went to eclipse website, look in plugin section and type "JCOP" to no avail
    Unfortunately JCOP is not a opensource or freeware. You need to get its license from NXP.
    I'd like to know how can you make sure there is nothing wrong between the host application and the applet as you can't test them as a whole unit?
    First write your java card applet and debug/test it by using some tool. When you will done with it install it on real card and write a host application to communicate with the card. For debugging of host application you may not need any special tool/api as by using netbeans or eclipse you can write your host/client application and by making breakpoints you can send and receive APDUs to/from card while testing/debugging.
    And this is always be a good practice to test application on real card.
  • 8. Re: Writing a Java card client
    936354 Newbie
    Currently Being Moderated
    Hello

    I found this.

    http://code.google.com/p/jcardsim/
       public static void main(String[] arg)
       {
           //1. create simulator
           Simulator simulator = new Simulator();
           //2. install applet
            simulator.installApplet(AID, TimeAttendApplet.class);
            //3. select applet
            simulator.selectApplet(AID);
            //4. send apdu
            ResponseAPDU response = simulator.transmitCommand(new CommandAPDU(0x01, 0x01, 0x00, 0x00));
            //5. check response
            
       }
    I follow the coding, but I have a problem.

    I think I should put the Applet in the same project as the host application.

    Or I should place the host application in the same Applet application project.

    In either ways, I couldn't
    a) recognize the Applet class in my host application
    b) recognize the jCardSim library in my host application

    http://youtu.be/-EWKnH8-4Fk

    Edited by: 933351 on 2012-12-18 上午3:05

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points