But when I launch the card with the simulator generic JCOPv2.2.1 and my client application.
The card is connected but the app is blocked on the powerUp() instruction.Could anyone point me if it is the correct way to connect and to create a session between the application and the simulator?
Code: Select all
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.net.Socket;
import utils.Constants;
import com.sun.javacard.apduio.Apdu;
import com.sun.javacard.apduio.CadT1Client;
public class Reader {
public static void main(String[] args) throws Exception {
/* Connection to the Javacard */
CadT1Client cad;
Socket sckCarte;
try {
sckCarte = new Socket("localhost", 8050);
sckCarte.setTcpNoDelay(true);
BufferedInputStream input = new BufferedInputStream(
sckCarte.getInputStream());
BufferedOutputStream output = new BufferedOutputStream(
sckCarte.getOutputStream());
cad = new CadT1Client(input, output);
} catch (Exception e) {
System.out.println("Error : impossible to connect to the Javacard");
return;
}
System.out.println("Card Connected");
/* Power up the card */
try {
cad.powerUp();
} catch (Exception e) {
System.out.println("Error powerup to Javacard");
return;
}
System.out.println("Card power up!");
}
}