4

I'm looking for a way to mark an applet as the implicit selectable/"selected by default" applet after it already has been uploaded and installed on a Global Platform/JCOP 2.4.2 R1 system (for starters in the NXP JCOP Tools Java Card Simulation).

The applet has been installed without the -d parameter in the JCOP shell:

cm> install -i a000100201100001  -q C9#() a000100201100000 a000100201100001
 => 80 E6 [...]
 90 00

after that the state is

Card Manager AID   :  A000000003000000
Card Manager state :  OP_READY

    Application:  SELECTABLE (--------) A000100201100001
    Load File  :      LOADED (--------) A0000000035350   (Security Domain)
     Module    :                        A000000003535041
    Load File  :      LOADED (--------) A000100201100000
     Module    :                        A000100201100001

The desired result is

Card Manager AID   :  A000000003000000
Card Manager state :  OP_READY

    Application:  SELECTABLE (-----D--) A000100201100001
    Load File  :      LOADED (--------) A0000000035350
    [...]

That's the output when the applet is installed with the -d|--default parameter.
I suspect changing this attribute is somehow done via the STORE-DATA command in the card manager applet but haven't been able to find the exact, detailed command (structure) - not even the tag that needs to be modified.

VolkerK
  • 95,432
  • 20
  • 163
  • 226
  • I've settled for a little makeshift workaround that intercepts the jcop shell output, looks for the install commands and keeps them in a separate list to issue the appropriate `delete` and `install -d` commands when a button is clicked. Patchy,Buggy&Ugly as can be but for the moment sufficient.... – VolkerK Apr 08 '14 at 13:31
  • I don't understand the issue I guess. You can simply instruct JCOP to issue -d. Go to Run Configurations, then Package Upload, doubleclick the applet and change the privileges. Hah, spelled "priviledges, -d for that as well :P. – Maarten Bodewes Apr 08 '14 at 14:33

1 Answers1

3

It depends on cards - not all of them seem to support making an applet default after installation. But you can use the open source GlobalPlatform tool for Java that has --make-default <AID> option:

java -jar gp.jar --make-default A000100201100001

IIRC JCOP was one of the cards that actually supported it.

Martin Paljak
  • 4,119
  • 18
  • 20
  • 2
    Huh? Wow. I stand corrected. Note that the Applet should be programmed in such a way that the file system (if any) is in the correct state if it is set to default (afterwards). – Maarten Bodewes Apr 08 '14 at 14:48