Compiled it with java_card_kit-305u3 and GlobalPlatform 2.1.1
Successfully installed it using GlobalPlafromPro using the command
Code: Select all
/gp --install miniAppletPkg.cap -default
and verified with
Code: Select all
gp --list
When I send an apdu to the card, it should just take the data of that apdu and set it as the historical bytes, I'm also checking the return value and throw if it is False (meaning that the function had failed setting the bytes).
It calls the function, and returns fine - but the historical bytes are unchanged.
I've also tried physically removing the card and reconnecting, but it didn't change anything.
Here's my code:
Code: Select all
import javacard.framework.*;
import org.globalplatform.*;
public final class miniApplet extends Applet
{
public static void install(byte[] bArray, short bOffset, byte bLength)
{
new miniApplet();
}
public miniApplet() {
register();
}
public void process(APDU apdu)
{
if (selectingApplet())
{
return;
}
byte[] buf = apdu.getBuffer();
if (buf[ISO7816.OFFSET_CLA] != 0xA0)
ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
if (buf[ISO7816.OFFSET_INS] != 0x01)
ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
if (!GPSystem.setATRHistBytes(buf, ISO7816.OFFSET_CDATA, buf[ISO7816.OFFSET_LC]))
ISOException.throwIt(ISO7816.SW_FUNC_NOT_SUPPORTED);
}
}