2 Replies Latest reply: Dec 5, 2012 2:00 AM by 975608 RSS

    How do I communicate a Java Card applet with a server?

    975608
      I'm new to Java and Java Card and currently developing a smart card system. I'm not sure what to use on my applet or server, JCSystem or SecureConnection or something else?
      If I'm writing a server application, then how do I install it so that I can simulate it with cjre?

      Thanks in advance.

      p/s: Connection is using TSL.
        • 1. Re: How do I communicate a Java Card applet with a server?
          safarmer
          Is the requirement to have a java card connected to a client computer that connects to a remote server through some software on the client? Or do you mean you are developing a JC3 connected servlet and you want this to connect to a remote server?

          - Shane
          • 2. Re: How do I communicate a Java Card applet with a server?
            975608
            The flow is like this:
            Java Card --> POS terminal -> Server

            Yes. I'm using JC3.

            Here's what I've achieved so far using SocketConnection
            SocketConnection sc = (SocketConnection) Connector.open("socket://localhost:50007");
                        
            InputStream is = sc.openInputStream();
            OutputStream os = sc.openOutputStream();
                        
            os.write("Hello world!".getBytes());
            is.read(buffer);
            os.close();
            is.close();
            sc.close(); 
            Edited by: andirady on Dec 4, 2012 11:59 PM