Skip to content

Commit

Permalink
test applet to be used in MockCard
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed May 29, 2012
1 parent 9e3e978 commit 52edbb5
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.simalliance.openmobileapi.service.terminals.SamplePluginTerminal;

/**
* This mock class implements a minimum subset of the original class
* javacard.framework.Applet
*/

public abstract class Applet {

public static final int INX_CLA = 0;
public static final int INX_INS = 1;
public static final int INX_P1 = 2;
public static final int INX_P2 = 3;
public static final int INX_LC = 4;
public static final int OFFSET_CDATA = 5;

protected boolean isSelect;

public boolean isSelect() { return isSelect; }
abstract public byte[] process(byte[] command) throws Throwable;

/**
* sets the isSelect flag indicating that the current C-APDU
* is a SELECT command.
* The isSelect flag can be queried by the selectingApplet() method
*/
public void mockSetSelect(boolean isSelect) {
this.isSelect = isSelect;
} // mockSetSelect

} // class

0 comments on commit 52edbb5

Please sign in to comment.