Page 1 of 1

convert my CAP file into sequence of APDU

Posted: Tue May 03, 2016 2:48 am
by Jpita
Hi all,

I want to know how to convert my CAP file into sequence of APDU. Then I can use these APDU to download my applet into my smart card.
Is there anyone that know this? Many thanks..

Cheers,
Jpita

Re: convert my CAP file into sequence of APDU

Posted: Tue May 03, 2016 5:58 am
by Crawford
You can refer to JCVM and GP specification. The JCVM spec defines the order in which the components of the CAP file should be put together and then it is multiple LOAD APDU's to send the data to the card.

Re: convert my CAP file into sequence of APDU

Posted: Tue May 03, 2016 8:23 am
by lostsiwonlw
Check GP pecification "9. APDU Command Reference"

Re: convert my CAP file into sequence of APDU

Posted: Tue May 03, 2016 8:30 am
by Jpita
Thanks for your help!

The section you mentioned only defines the structure of the Load File, but not the way of converting .cap file into a sequence of APDUs data block.

Re: convert my CAP file into sequence of APDU

Posted: Tue May 03, 2016 8:37 am
by Crawford
Jpita wrote:Thanks for your help!

The section you mentioned only defines the structure of the Load File, but not the way of converting .cap file into a sequence of APDUs data block.


Use the order for creating a binary blob of data from the cap file and then use the GP LOAD command.

A CAP file is a JAR file with the actual CAP file components. You extract them from the JAR and concatenate the raw data into one large blob. The components are joined in that order.

Re: convert my CAP file into sequence of APDU

Posted: Tue May 03, 2016 8:51 am
by Jpita
Thanks for all your help! I will have a try!