JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html

How to know the APDU length that has been sent to the application?

JavaCard Applet Development Related Questions and Answers.
colkif
Posts: 6
Joined: Mon Sep 25, 2017 11:21 pm
Points :76
Contact:

How to know the APDU length that has been sent to the application?

Post by colkif » Mon Oct 09, 2017 11:54 pm

Hi friends here. It's me again.

I wonder how to know the APDU length that has been sent to my application? Thanks.

tomc2016
Posts: 12
Joined: Tue Feb 16, 2016 3:45 am
Points :109
Contact:

Re: How to know the APDU length that has been sent to the application?

Post by tomc2016 » Tue Oct 10, 2017 1:16 am

Use the code below to know the length of data field.

Code: Select all

process(Apdu apdu)
{
    // Lc tells us the incoming apdu command length
     short bytesLeft = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);
   // you may also use APDU class method
       short readCount = apdu.setIncomingAndReceive();
}

Heerden
Posts: 11
Joined: Tue Dec 29, 2015 5:14 am
Points :87
Contact:

Re: How to know the APDU length that has been sent to the application?

Post by Heerden » Tue Oct 10, 2017 5:45 am

It's better for you to look through Java card API specification.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 54 guests

JavaCard OS : Disclaimer