This content has been marked as final. Show 7 replies
Thank you for your reply. I am a newbie about java card development, I think there are some misunderstandings. For my understanding, I can install the card applet on the local card emulator, and write the host application to connet with the card emulator.
So, in this situation(I don't have a card or card reader), how to test my host applications?
JCOP Tools has an offcard.jar library that contains the classes you need to communicate with the emulator. The emulator uses a protocol over TCP/IP and you can find help on this under Eclipse Help (NXP JCOP Tools -> Reference). You may be able to use this to test you applets with a host application.
The problem is that I want test my host application, but the APIs from smartcardio can not connet with JCOP card emulator.
The answer may be very simple, actually the JCOP has its own offcard APIs to connect with the local port, which is stroed in /lib/offcard.
Here some codes can be usefull to connect with the local card emulator:
Overall, thanks everyone here gave me help.
JCTerminal terminal = JCTerminal.getInstance("Remote", LocalhostPort); terminal.open(); TraceJCTerminal tt = new TraceJCTerminal(); tt.setLog(new PrintWriter(System.out)); tt.init(terminal); terminal = tt; JCard card = new JCard(terminal, null, 1000); byte aid = AID.getBytes(); JCApplet applet = new JCApplet(card, aid); applet.select();