Hi All
I am writing java application to talk with smart card
every thing is ok till i reach to this command:
private static byte[] COMMAND2 = {(byte) 0xEF, (byte) 0xFA, (byte) 0xCE, (byte) 0x00, (byte) 0xFF};
private static CommandAPDU COMMAND2_APDU = new CommandAPDU(COMMAND2);
connectWithCard();
sendAPDU1();
card.disconnect(true); //Reset must occur before
try{
Thread.sleep(1000);
}
catch(InterruptedException e)
{
System.out.println("Exception for sleep : "+e.getMessage());
}
connectWithCard();
ra=ch.transmit(COMMAND2_APDU);//Exception occur here
System.out.println("Response due to COMMAND2_APDU : " + arrayToHex(ra.getBytes()));
JOptionPane.showMessageDialog(null,"Response due to COMMAND2_APDU : " + arrayToHex(ra.getBytes()), "Status", JOptionPane.ERROR_MESSAGE);
//implementation for connectwithCard()
try {
card = c.connect("T=0");
// System.out.println("Terminal connected");
JOptionPane.showMessageDialog(null,"Terminal connected", "Status", JOptionPane.ERROR_MESSAGE);
} catch (Exception e) {
// System.out.println("Terminal NOT onnected: " + e.toString());
JOptionPane.showMessageDialog(null,"Terminal NOT onnected: " + e.toString(), "Status", JOptionPane.ERROR_MESSAGE);
}
System.out.println("ATR: " + arrayToHex(((ATR) card.getATR()).getBytes()));
JOptionPane.showMessageDialog(null,"ATR: " + arrayToHex(((ATR) card.getATR()).getBytes()), "Status", JOptionPane.ERROR_MESSAGE);
ch = card.getBasicChannel();
Exception is:
javax.smartcardio.CardException: sun.security.smartcardio.PCSCException: Unknown error 0x8010002f
What should i do ?
Thanks in Advance
Edited by: Nabil_ on Aug 7, 2008 3:23 AM
Edited by: Nabil_ on Aug 7, 2008 3:31 AM