简体   繁体   中英

Extended APDU in NetBeans Emulator not being parsed

I am using the Netbeans IDE for the JavaCard 3.0.2 RE. I want to send to my applet an Extended APDU. I am trying to to that through scripts. I am using a 3 byte Lc and my class implements the ExtendedLength interface.

However, when I try to send the Extended APDU through the script, the NetBeans build.xml gives me "Input data length != Lc around line ... " . I am trying to send 275 characters, apart from the header, so my command is:

CLA  INS   P1   P2   Lc   Lch  Lcl   Data   End
0xAB 0x00 0x00 0x00 0x00 0x01 0x13 .......  0x7F;

The header parameters (CLA, INS, etc) are custom and I have written code to process this kind of command. However, the APDU is not even accepted by my method, because I use some print command which are not displayed.

I think the problem has to do with the NetBeans simulator accepting Extended APDUs. If I change the APDU to normal length and not Extended, everything is fine. Do you know what I have to do?

I dont know about the NetBeans Emulator, but I would say the APDU is in non-valid format. If you use three bytes for Lc beginning with leading zero you indicate Extended Length. Yet if you append Le byte this Le byte must be two bytes in this case! Try:

CLA  INS   P1   P2   Lc   Lch  Lcl   Data   Le1   Le2
0xAB 0x00 0x00 0x00 0x00 0x01 0x13 .......  0x00 0x7F;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM