Here is the code.
Code: Select all
package Test;
import javacardx.framework.util.*;
public class Test extends javacard.framework.Applet {
private byte[] RAM = JCSystem.makeTransientByteArray((short)200, JCSystem.CLEAR_ON_DESELECT);
private short[] arrayShort = JCSystem.makeTransientShortArray((short)100, JCSystem.CLEAR_ON_DESELECT);
private AppTest (byte bArray[], short bOffset, byte bLength)
{
register();
}
public static void install(byte[] bArray, short bOffset, byte bLength) {
new Test(bArray, (short)bOffset, bLength);
}
public void process(APDU apdu) {
byte[] buf = apdu.getBuffer();
short byteRead, rsltShort;
boolean rsltBool;
rsltShort = (short)0;
byteRead = apdu.setIncomingAndReceive();
switch (buf[ISO7816.OFFSET_INS]) {
case (byte) 0xA4:
if (selectingApplet())
{
}
else
{
ISOException.throwIt(ISO7816.SW_FILE_NOT_FOUND);
}
break;
case (byte)0xF4:
if (buf[ISO7816.OFFSET_P1] == (byte)0x00)
{
UtilException.throwIt(UtilException.ILLEGAL_VALUE);
}
break;
default:
ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
}
}
}
I can create the cap file successfully. But when I upload my applet into java card, it returned 0x6985.
I can not find the reason. Does anyone come across this problem? Please help!