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.