简体   繁体   English

Java卡中包装,模块,小程序的定义

[英]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. 我正在寻找一种方法来解释或描述Java Card中的包,模块和applet的概念。 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, 在Java编程中,

A Java Package is a mechanism for organizing Java classes into namespaces Java包是一种将Java类组织到名称空间中的机制

But when it goes to Java Card, will it be similar? 但是,当涉及到Java Card时,会类似吗? 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. 一个包含多个Applet的javacard程序包将在Applet中创建多个实例。 package, Applet and instance is real exist. 包,Applet和实例是真实存在的。

In fact, the module and Applet is the same, just different forms of existence. 实际上,模块和Applet是相同的,只是存在形式不同。 Module is appeared during in running or debugging. 在运行或调试期间出现模块。 As follows: 如下:

Package <==> Load File 包<==>加载文件

Applet <==> Moudle 小程序<==> Moudle

instance <==> Application 实例<==>应用程序

在此处输入图片说明

Package - Provides a framework of classes and interfaces for building, communicating with and working with Java Card technology-based applets. 包-提供用于构建,与基于Java Card技术的applet进行通信和一起使用的类和接口的框架。 These classes and interfaces provide the minimum required functionality for a Java Card environment. 这些类和接口为Java Card环境提供了最低要求的功能。 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. Javacard(以及安装在javacard上的applet)支持特定的APDU,具体取决于所安装的applet(以及用于安装applet的特定APDU)。javacard文档是开始学习此内容的最佳位置。

Some smart cards come with applets pre-installed that have space reserved for biometric data; 一些智能卡预先安装了Applet,这些Applet保留了用于生物识别数据的空间。 for example, "PIV" cards (and associated applet). 例如“ PIV”卡(和关联的小程序)。

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. Javacard包也是一种将Java代码组织到名称空间中的机制。 In the javacard world, a package is mapped onto a CAP file, which you can load on cards. 在javacard的世界中,程序包已映射到CAP文件,您可以将其加载到卡上。 Your javacard packages may contain modules. 您的javacard软件包可能包含模块。

A Module, as you refer to it, is a class that extends Applet class and therefore contains the install() and process() methods, at least. 正如您所指,Module是扩展Applet类的类,因此至少包含install()和process()方法。 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. 模块和标准(非Applet)类之间的区别在于,模块可以作为应用程序进行实例化和访问(可以选择并可以向其发送APDU命令),而标准类只能作为普通Java实例化。对象,在您的javacard代码中。

When you instantiate a module, you also give this new instance an AID (what you refer to as Applet AID). 实例化模块时,还为该新实例提供了AID(您称为Applet AID)。

This is the high level answer. 这是高级答案。 For further details you should read the javacard spec. 有关更多详细信息,请阅读javacard规范。

  • 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. 加载文件的AID值是Package AID ,它使Card Manager可以标识必须从中安装applet实例的程序包。
  • 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. 加载文件中的Module AIDModule AID ,它允许卡管理器检索在加载文件中定义的applet的AID。
  • The AID of the applet instance is the Applet or Instance AID which is to be installed. Applet or Instance AID是要安装的Applet or Instance AID The Card Manager checks this value as two on-card entities cannot have the same AID value in the card's registry. 卡片管理器会检查此值,因为两个卡片上的实体在卡片的注册表中不能具有相同的AID值。 If this occurs, the command is aborted and the Card Manager recovers all the on-card resources. 如果发生这种情况,该命令将中止,并且卡管理器将恢复所有卡上资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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