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.

How to know Le in APDU command ?

JavaCard Applet Development Related Questions and Answers.
Anenl
Posts: 8
Joined: Mon Jul 31, 2017 3:22 am
Points :108
Contact:

How to know Le in APDU command ?

Post by Anenl » Mon Sep 04, 2017 3:53 am

We can use apdu.setIncomeandReceive to get the byte number we received, and compared with Lc to make sure if the APDU command is incorrect or correct.If I send Le in my APDU, it must be one byte of Data field.

And I found there is not a ISO7816,OFFSET_LE, so how can the card get the Le?
In java card API specification I found

Code: Select all

short le = apdu.setOutgoing();

How can this command get the Le ?

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

Re: How to know Le in APDU command ?

Post by mabel » Tue Sep 05, 2017 5:36 am

It is managed by the CAD. In case of T=1, you can get the Le value directly. even there you can't be sure, because it also could be Lc.

But in case of T=0 it is different, as the CAD sends only the header at the beginning. Then you need to evaluate Lc and optionally get the data with setIncomingAndReceive(). The Le is kept in the CAD and can be retrieved only via setOutgoing().

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 20 guests

JavaCard OS : Disclaimer