Search in sources :

Example 1 with RunConfig

use of cardTools.RunConfig in project javacard-gradle-template by ph4r05.

the class SimpleAPDU method demoSingleCommand.

public static ResponseAPDU demoSingleCommand() throws Exception {
    final CardManager cardMngr = new CardManager(true, APPLET_AID_BYTE);
    final RunConfig runCfg = RunConfig.getDefaultConfig();
    // Running on physical card
    // runCfg.setTestCardType(RunConfig.CARD_TYPE.PHYSICAL);
    // Running in the simulator
    runCfg.setAppletToSimulate(MainApplet.class).setTestCardType(RunConfig.CARD_TYPE.JCARDSIMLOCAL).setbReuploadApplet(true).setInstallData(new byte[8]);
    System.out.print("Connecting to card...");
    if (!cardMngr.Connect(runCfg)) {
        return null;
    }
    System.out.println(" Done.");
    final ResponseAPDU response = sendCommandWithInitSequence(cardMngr, STR_APDU_DUMMY, null);
    System.out.println(response);
    return response;
}
Also used : CardManager(cardTools.CardManager) MainApplet(applet.MainApplet) ResponseAPDU(javax.smartcardio.ResponseAPDU) RunConfig(cardTools.RunConfig)

Aggregations

MainApplet (applet.MainApplet)1 CardManager (cardTools.CardManager)1 RunConfig (cardTools.RunConfig)1 ResponseAPDU (javax.smartcardio.ResponseAPDU)1