Hi All
I am writing java application to talk with smart card (need to format my 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);
it is CARD RECYCLE COMMAND
i use it to make format for my card
//Code
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()));
//implementation for connectwithCard()
try {
card = c.connect("T=0");
// System.out.println("Terminal connected");
} catch (Exception e) {
// System.out.println("Terminal NOT onnected: " + e.toString());
}
System.out.println("ATR: " + arrayToHex(((ATR) card.getATR()).getBytes()));
ch = card.getBasicChannel();
Exception is:
javax.smartcardio.CardException: sun.security.smartcardio.PCSCException: Unknown error 0x8010002f
What should i do ?
Thanks in Advance

Reply With Quote


