简体   繁体   中英

Definition of package, module, applet in Java Card

I am looking for a way to explain or describe the concept of package, module & applet in Java Card. Does any one know how to describe it, so that one could easily understand.

Just to provide more information from my understanding, the structure & relationships between package, module & applet.

Package AID
  |--> Module AID
          |--> Applet AID

In Java Programming,

A Java Package is a mechanism for organizing Java classes into namespaces

But when it goes to Java Card, will it be similar? What about module?

I am still searching on the web, will be great if someone can help!

Thanks in advance.

A javacard package, containing multiple Applet, there will create multiple instances in the Applet. package, Applet and instance is real exist.

In fact, the module and Applet is the same, just different forms of existence. Module is appeared during in running or debugging. As follows:

Package <==> Load File

Applet <==> Moudle

instance <==> Application

在此处输入图片说明

Package - Provides a framework of classes and interfaces for building, communicating with and working with Java Card technology-based applets. These classes and interfaces provide the minimum required functionality for a Java Card environment. If additional functionality is desired, for example to specialize the card for a particular market, other frameworks would need to be added.

Javacards (and applets installed on javacards) support specific APDUs depending on what applets are installed (and specific APDUs for installing applets.) The javacard documentation is the best place to start learning about this.

Some smart cards come with applets pre-installed that have space reserved for biometric data; for example, "PIV" cards (and associated applet).

If your card doesn't have an applet pre-installed for storing biometric data you will need to write and install one.

A javacard package is also a mechanism for organizing java code into namespaces. In the javacard world, a package is mapped onto a CAP file, which you can load on cards. Your javacard packages may contain modules.

A Module, as you refer to it, is a class that extends Applet class and therefore contains the install() and process() methods, at least. The different between a module and standard (non-Applet) class is that the module can be instantiated and access as an application (can be selected and APDU commands may be sent to it) while a standard class can only be instantiated as a normal java object, within your javacard code.

When you instantiate a module, you also give this new instance an AID (what you refer to as Applet AID).

This is the high level answer. For further details you should read the javacard spec.

  • The AID value of the Load File is the Package AID which allows the Card Manager to identify the package from which the applet instance must be installed.
  • The AID within the Load File is the Module AID which allows the Card Manager to retrieve the AID of the applet defined in the Load File.
  • The AID of the applet instance is the Applet or Instance AID which is to be installed. The Card Manager checks this value as two on-card entities cannot have the same AID value in the card's registry. If this occurs, the command is aborted and the Card Manager recovers all the on-card resources.

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