Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

Why did my applet can not throw exception?

JavaCard Applet Development Related Questions and Answers.
corleoner
Posts: 15
Joined: Fri Dec 11, 2015 2:22 am
Points :92
Contact:

Why did my applet can not throw exception?

Post by corleoner » Fri Dec 11, 2015 4:42 am

I have finished a simple applet. But I faced a problem. I can select it successfully, but when I sent "00000000", it didn't have any reaction.
My applet can not throw exception 0x8080. It seemed that it couldn't run to this line at all.
ISOException.throwIt((short) 0x8080);
.
Kindly help please. What's wrong?
APDU:


Code:

Code: Select all

package test002;

import javacard.framework.*;

public class test extends Applet
{

   public static void install(byte[] bArray, short bOffset, byte bLength)
   {
      new test().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
   }

   public void process(APDU apdu)
   {
      if (selectingApplet())
      {
         return;
      }

      byte[] buf = apdu.getBuffer();
      switch (buf[ISO7816.OFFSET_INS])
      {
      default:
         ISOException.throwIt((short) 0x8080);

      }
   }

}
You do not have the required permissions to view the files attached to this post. Please login first.

User avatar
mabel
Posts: 237
Joined: Mon May 18, 2015 3:09 am
Points :1705
Contact:

Re: Why did my applet can not throw exception?

Post by mabel » Sun Dec 20, 2015 10:50 pm

Your problem is with the status word used.

The exception status word must conform to the 7816 specification.
ISO7816-4 said that:
any value different from '6XXX' and '9XXX' is invalid; any value '60XX' is also invalid.


So try a few in the 61xx ranges. Hope it helps!

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 47 guests

JavaCard OS : Disclaimer