简体   繁体   中英

Access an applet directly without AID selection

Usually, when you power up a JavaCard smartcard and want to communicate with an applet, you must select the applet using its AID first.

Is there any way to have a "default applet" that is selected when the card is powered up?

What I really want to do is be able to send my application level APDUs immediately upon selecting the card and not need to go through the application selection process.

Is this possible? If so, how?

If your Java Card smartcard implements the Global Platform Card specification, it will typically allow you to define an applet that is implicitly selected on the basic logical channel upon reset. Thus, upon powering up (resetting) the card the applet would be selected by default and immediately receives all commands (except those handled by the runtime environment, such as selection of other applets, logical channel management, etc.).

You can set an applet as the default selected applet by giving it the "Default Selected" (GP 2.1.1 terminology) or "Card Reset" (GP 2.2 terminology) privilege. This is set by bit 3 in the (first) privilege byte. Only one application can have this privilege.

If you use, for instance, GlobalPlatformPro , you could use the options --default (during installation) or --make-default <AID> (for an existing applet) to set this privilege.


Note that you can distinguish between being default selected and selected by AID by capturing the SELECT APDU within the Applet#process method . The best way is to call Applet.selectingApplet to check if explicit selection by AID has taken place.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM