com.licel.jcardsim.io.JavaxSmartCardInterface Java Examples

The following examples show how to use com.licel.jcardsim.io.JavaxSmartCardInterface. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CardManager.java    From JCMathLib with MIT License 5 votes vote down vote up
private CardChannel ConnectJCardSimLocalSimulator(Class appletClass) throws Exception {
    System.setProperty("com.licel.jcardsim.terminal.type", "2");
    CAD cad = new CAD(System.getProperties());
    JavaxSmartCardInterface simulator = (JavaxSmartCardInterface) cad.getCardInterface();
    byte[] installData = new byte[0];
    AID appletAID = new AID(m_APPLET_AID, (short) 0, (byte) m_APPLET_AID.length);

    AID appletAIDRes = simulator.installApplet(appletAID, appletClass, installData, (short) 0, (byte) installData.length);
    simulator.selectApplet(appletAID);

    return new SimulatedCardChannelLocal(simulator);
}
 
Example #2
Source File: CardManager.java    From JCMathLib with MIT License 5 votes vote down vote up
private CardChannel ConnectJCardSimLocalSimulator(Class appletClass) throws Exception {
System.out.print("Setting up Javacard simulator...");
//CardSimulator simulator = new CardSimulator();
System.setProperty("com.licel.jcardsim.terminal.type", "2");
      CAD cad = new CAD(System.getProperties());
      JavaxSmartCardInterface simulator = (JavaxSmartCardInterface) cad.getCardInterface();	
byte[] installData = new byte[0];
AID appletAID = new AID(m_APPLET_AID, (short) 0, (byte) m_APPLET_AID.length);
AID appletAIDRes = simulator.installApplet(appletAID, appletClass, installData, (short) 0, (byte) installData.length);
simulator.selectApplet(appletAID);		
      return new SimulatedCardChannelLocal(simulator);
  }
 
Example #3
Source File: GidsBaseTestClass.java    From GidsApplet with GNU General Public License v3.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
    // 1. Create simulator
    byte[] TEST_APPLET_AID_BYTES = new byte[] {(byte) 0xA0,0x00,0x00,0x03,(byte) 0x97,0x42,0x54,0x46,0x59};
    AID TEST_APPLET_AID = new AID(TEST_APPLET_AID_BYTES, (short)0, (byte) TEST_APPLET_AID_BYTES.length);



    simulator = new JavaxSmartCardInterface ();

    // 2. Install applet
    simulator.installApplet(TEST_APPLET_AID, GidsApplet.class);
    simulator.selectApplet(TEST_APPLET_AID);
    // 3. Select applet
}
 
Example #4
Source File: CardMngr.java    From ECTester with MIT License 5 votes vote down vote up
public boolean prepareLocalSimulatorApplet(byte[] appletAIDArray, byte[] installData, Class<? extends Applet> appletClass) {
    simulator = new JavaxSmartCardInterface();
    AID appletAID = new AID(appletAIDArray, (short) 0, (byte) appletAIDArray.length);

    simulator.installApplet(appletAID, appletClass, installData, (short) 0, (byte) installData.length);
    return simulator.selectApplet(appletAID);
}
 
Example #5
Source File: SimulatedCardChannelLocal.java    From JCMathLib with MIT License 4 votes vote down vote up
SimulatedCardChannelLocal (JavaxSmartCardInterface simulator) {
    m_simulator = simulator;
    m_card = new SimulatedCard();
}
 
Example #6
Source File: SimulatedCardChannelLocal.java    From JCMathLib with MIT License 4 votes vote down vote up
SimulatedCardChannelLocal (JavaxSmartCardInterface simulator) {
    m_simulator = simulator;
    m_card = new SimulatedCard();
}