Page 1 of 1

Got "6985" when loading applet into card

Posted: Fri Jan 22, 2016 5:16 am
by shyjarod
I have written a simple applet.
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!

Re: Got "6985" when loading applet into card

Posted: Fri Jan 22, 2016 6:18 am
by UNKNwYSHSA
Which tool you used to load the cap to your card?
Show us load APDU commands and responses.