Question

I'm using Eclipse with EclipseJCDE.

I made a simple java card applet as a .cap file to install on the simulator. I don't know if the installation failed because the download script is a bunch of ADPU commands which I don't understand. Is there any way to see what applets are currently on the simulator and what their AIDs are?

I then made a script for ADPUtool with just one command, selecting the applet. According to the .jca file in my project.

  • The AID for my applet:

    0x1:0x2:0x3:0x4:0x5:0x6:0x7:0x8:0x9:0x0:0x0.

  • The command I made for selecting the applet:

    0x00 0xA4 0x04 0x00 0x0b 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0x0 0x0

The 0x00 0xA4 0x04 0x00 at the beginning is for the select command, then 0x0b for the length, than the AID, and then 0x0 at the end for the Le byte which I don't think matters for this command. When I run this script with the ADPU tool I get this:

  • CLA: 00
  • INS: a4
  • P1: 04
  • P2: 00
  • Lc: 0b 01 02 03 04 05 06 07 08 09 00 00
  • Le: 00
  • SW1: 6d
  • SW2: 00

I believe the SW1 and SW2 bytes are the response to my command and I think 6d means it didn't find or wasn't able to load the applet. What am I doing wrong?

Was it helpful?

Solution

6D00 means bad instruction (INS byte 'A4' not existing in class '00').

Post full trace of APDUs after ATR else I recommend you to check section 10 from http://www.etsi.eu/deliver/etsi_ts/102200_102299/102221/08.02.00_60/ts_102221v080200p.pdf, for example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top