Skip to Main Content

Java Card

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java and Smart Card.

mc1976Jun 20 2006 — edited Jul 23 2008
Hi guys ! I'm trying to develop a simple application to store a digital certificate on a Smart Card with Java... As first efford, I tried to use OCF but no result.... Now, I read that Mustang supports "natively" smart cards thru javax.smartcardio.* classes. I tried with this code:
TerminalFactory factory = TerminalFactory.getDefault();
List<CardTerminal> terminals = factory.terminals();
System.out.println("Terminals: " + terminals);
 // get the first terminal
CardTerminal terminal = terminals.get(0);
 terminal.waitForCardPresent(10000);
 if(terminal.isCardPresent())
      System.out.println(" Card Inserted");
 else
     System.out.println(" TimeOut reached.");
    
//    Card carta = terminal.connect("T=0");
//    carta.disconnect(true);
    
The code shown above works, and I can detect card insertion. Anyway, i f I uncomment the rows:
 Card carta = terminal.connect("T=0");
 carta.disconnect(true);
    
I get an exception:

sun.security.smartcardio.PCSCException: SCARD_W_UNRESPONSIVE_CARD. What does it mean ?

I'm sure this question is rather trivial for an advanced user, but I'm a newby on smart card usage... Can anybody help me ?

TIA !

Claudio.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 20 2008
Added on Jun 20 2006
6 comments
822 views