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.

Applet load failed when include BETLV objects

JavaCard Applet Development Related Questions and Answers.
franco
Posts: 3
Joined: Fri Feb 03, 2017 1:12 pm
Points :50
Contact:

Applet load failed when include BETLV objects

Post by franco » Tue Feb 28, 2017 2:24 pm

Hi, i'm using JCIDE to create a javacard 2.2.2 applet, but when includ a BERTLV object (Constructed o primitive, BERTLV o BERTag) the load to J3A040 card fail.

A>> T=0 (4+0031) 84E60200 1F 0A4B4F57414C534B49303108A0000000030000000000008B0ACDCD29C408FD
A<< (0001+2) (110ms) 00 9000
A>> T=0 (4+0255) 84E80000 FF C482055C01001EDECAFFED02020400010A4B4F57414C534B493031096D66696C65735F3033020021001E0021000F00200106000E02B7005600B20000022408F500100008003403010004002003030107A0000000620101000108A000000062020803000107A000000062000103000F010B4B4F57414C534B49303100023306000E00000080031A00190701000002410702B70102868007028F00380541188C0026191E25290416046108188B003C700C18191E044116048B001C188C0020188C00221808058D002587001818AD018C001A87021818AD038C001A87041818AD058C001A87061818AD078C001A87081818AD097B001D058C5BA8DC96600DB358
A<< (0000+2) (968ms) 6A80
pro.javacard.gp.GPException: LOAD failed SW: 6A80
at pro.javacard.gp.GPException.check(GPException.java:66)
at pro.javacard.gp.GlobalPlatform.loadCapFile(GlobalPlatform.java:667)
at pro.javacard.gp.GlobalPlatform.loadCapFile(GlobalPlatform.java:625)
at pro.javacard.gp.GPTool.main(GPTool.java:524)

Does anyone know what is the cause and how can I fix it?

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3053
Contact:

Re: Applet load failed when include BETLV objects

Post by UNKNwYSHSA » Tue Feb 28, 2017 10:44 pm

I write one simple applet to try. All CAP who import package javacardx.framework.tlv can't be loaded to the card. It means this package is not implemented in j2a040 card. Applet code:

Code: Select all

package testPackageTlv;

import javacard.framework.*;
import javacardx.framework.tlv.*;

public class testPackageTlv extends Applet
{

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

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

      byte[] buf = apdu.getBuffer();
      switch (buf[ISO7816.OFFSET_INS])
      {
      case (byte)0x00:
         TLVException.throwIt(TLVException.INVALID_PARAM);
         break;
      default:
         ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
      }
   }

}
sense and simplicity

franco
Posts: 3
Joined: Fri Feb 03, 2017 1:12 pm
Points :50
Contact:

Re: Applet load failed when include BETLV objects

Post by franco » Wed Mar 01, 2017 12:36 pm

Hi UNKNwYSHSA, thanks for your reply. I try with J3D081 and MDj24 too, and both fail. Is there any model that has support for TLV objects?

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3053
Contact:

Re: Applet load failed when include BETLV objects

Post by UNKNwYSHSA » Thu Mar 02, 2017 2:34 am

I don't know which card implement this function.
You can implement TLV construct/parse function in your applet.
sense and simplicity

franco
Posts: 3
Joined: Fri Feb 03, 2017 1:12 pm
Points :50
Contact:

Re: Applet load failed when include BETLV objects

Post by franco » Thu Mar 02, 2017 11:38 am

thanks for the suggestion UNKNwYSHSA, i think that could create a class for manage the static data, storing the arrays with TLV format.

tay00000
Posts: 161
Joined: Tue Sep 27, 2016 10:58 am
Points :2324
Contact:

Re: Applet load failed when include BETLV objects

Post by tay00000 » Thu Mar 02, 2017 9:37 pm

Note that for Java, anything with javax or javacardx means it is an extension package of the ordinary java or javacard and is NOT MANDATORY to be implemented by the vendor who writes the JavaCard Operating System and VM firmware.

Do always be very careful when using javax or javacardx extensions as they do not 100% guarantee support across every Java or JavaCard VM implementation. It is best to write one's own libraries (i.e. TLV) whenever possible to prevent such problems from happening.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 54 guests

JavaCard OS : Disclaimer