JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html
https://ftsafe.en.alibaba.com/index.html
Applet load failed when include BETLV objects
Applet load failed when include BETLV objects
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?
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?
- UNKNwYSHSA
- Posts: 630
- Joined: Thu May 21, 2015 4:05 am
- Points :3055
- Contact:
Re: Applet load failed when include BETLV objects
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
Re: Applet load failed when include BETLV objects
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?
- UNKNwYSHSA
- Posts: 630
- Joined: Thu May 21, 2015 4:05 am
- Points :3055
- Contact:
Re: Applet load failed when include BETLV objects
I don't know which card implement this function.
You can implement TLV construct/parse function in your applet.
You can implement TLV construct/parse function in your applet.
sense and simplicity
Re: Applet load failed when include BETLV objects
thanks for the suggestion UNKNwYSHSA, i think that could create a class for manage the static data, storing the arrays with TLV format.
Re: Applet load failed when include BETLV objects
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.
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.
Who is online
Users browsing this forum: No registered users and 51 guests