Hello! I have a problem - can't get CPLC with classes from javax.smartcardio (get SW=6a88), but I easily get it with com.sun.javacard.apduio classes from Java Card Kit 2.2.2.
Here the test code for javax.smartcardio :
import java.util.List;
import javax.smartcardio.*;
public class TestSmartCardJSE60
{
public static void main(String[] args)
{
try
{
TerminalFactory tf = TerminalFactory.getInstance("PC/SC", null);
CardTerminals cts = tf.terminals();
List<CardTerminal> avaiableTerminals = cts.list();
CardTerminal ct = avaiableTerminals.get(0);
Card card = ct.connect("*");
try
{
CardChannel channel = card.getBasicChannel();
CommandAPDU capdu = new CommandAPDU(0x80, 0xCA, 0x9F, 0x7F);
ResponseAPDU res = channel.transmit(capdu);
System.out.printf("%s%n", res);
}
finally
{
card.disconnect(true);
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
And here the same for com.sun.javacard.apduio
import com.sun.javacard.apduio.*;
public class TestSmartCardJCK222
{
public static void main(String[] args)
{
try
{
CadClientInterface cad = CadDevice.getPCSCClientInstance(0);
cad.powerUp();
try
{
Apdu capdu = new Apdu();
capdu.command[Apdu.CLA] = (byte) 0x80;
capdu.command[Apdu.INS] = (byte) 0xCA;
capdu.command[Apdu.P1] = (byte) 0x9F;
capdu.command[Apdu.P2] = 0x7F;
cad.exchangeApdu(capdu);
System.out.printf("%s%n", capdu);
capdu.setLe(0x2D);
cad.exchangeApdu(capdu);
System.out.printf("%s%n", capdu);
}
finally
{
cad.powerDown(true);
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
I run both tests under WindowsXP SP3 with ORGA ECO5000 Usb and JCOP21 smart card.
What is my problem? Actualy I want to use javax.smartcardio for my application, because classes from that package more useful than com.sun.javacard.apduio;
Any ideas?