Page 1 of 1

Video Tutorial - Create new project and debug javacard applet with JCIDE.

Posted: Fri Aug 21, 2015 3:44 am
by product
This video shows how to create new project and debug javacard applet with JCIDE.

phpBB [video]


Note:
    1. Download the attachment to view this video.
    2. Download the video from Google Drive.

Re: Create new project and debug javacard applet with JCIDE.

Posted: Fri Aug 21, 2015 9:45 am
by javacardbr
Very good! Thanks.
Waiting the next guide :)

Re: Create new project and debug javacard applet with JCIDE.

Posted: Wed Aug 26, 2015 10:07 pm
by product
The code used in this video as follows:

Code: Select all

package testApplet;

import javacard.framework.*;

public class testApplet extends Applet
{

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

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

      byte[] buf = apdu.getBuffer();
      apdu.setIncomingAndReceive();
      short res = 0;
      switch (buf[ISO7816.OFFSET_INS])
      {
      case (byte)0x01:
         short tmp1 = buf[ISO7816.OFFSET_P1];
         short tmp2 = buf[ISO7816.OFFSET_P2];
         res  = (short)(tmp1 + tmp2);
         Util.setShort(buf, (short)0, res);
         apdu.setOutgoingAndSend((short)0, (short)2);
         break;
      case (byte)0x02:
         apdu.setOutgoingAndSend((short)0, (short)5);
         break;
      default:
         ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
      }
   }

}

Re: Create new project and debug javacard applet with JCIDE.

Posted: Thu Sep 10, 2015 10:31 pm
by GraceGIRL
Thank you for sharing this video. :)