简体   繁体   English

Java卡中Applet的最大和最小大小是多少

[英]What is Max and Min size of Applet in java card

I am working on java card and i want to know: 我正在使用Java卡,但我想知道:

  1. what is max and min size of an applet in java card and on which parameter it depends? Java卡中小程序的最大和最小大小是多少,它取决于哪个参数?
  2. How many applet we can install on smart card? 我们可以在智能卡上安装多少个applet?

I am using: 我在用:

  • smart card type = contact card 智能卡类型=联系人卡
  • using java card 2.2.2 with jcop using apdu 在使用apdu的jcop中使用Java卡2.2.2

I don't know a concrete limit for the applet size, however there are other limits that affect the maximum size: 我不知道applet大小的具体限制,但是还有其他限制会影响最大大小:

According to the Java Card 2.2 Virtual Machine Specification the limits are as follows: 根据Java Card 2.2虚拟机规范,限制如下:

Package References: A package can reference at most 128 other packages. 程序包引用:一个程序包最多可以引用其他128个程序包。

Package Name: The fully qualified name of a package may contain a maximum of 255 characters. 软件包名称:软件包的标准名称最多可以包含255个字符。 The package name size is further limited if it contains one or more characters which, when represented in UTF-8 format, requires multiple bytes. 如果包名称包含一个或多个字符(如果以UTF-8格式表示,则需要多个字节),则包名称大小会受到进一步限制。

Classes in a Package: A package can contain at most 255 classes and interfaces. 程序包中的类:一个程序包最多可以包含255个类和接口。

Interfaces: A class can implement at most 15 interfaces, including interfaces implemented by superclasses. 接口:一个类最多可以实现15个接口,包括由超类实现的接口。 An interface can inherit from at most 14 superinterfaces. 一个接口最多可以继承14个超级接口。

Static Fields: A class in an applet package can have at most 256 public or protected static non-final fields. 静态字段: applet程序包中的类最多可以具有256个公共或受保护的静态非最终字段。 A class in a library package can have at most 255 public or protected static non-final fields. 库包中的类最多可以包含255个公共或受保护的静态非最终字段。 There is no limit on the number of static final fields (constants) declared in a class. 在类中声明的静态最终字段(常量)的数量没有限制。

Static Methods: A class in an applet package can have at most 256 public or protected static methods. 静态方法: applet程序包中的类最多可以具有256个公共或受保护的静态方法。 A class in a library package can have at most 255 public or protected static methods. 库包中的类最多可以包含255个公共或受保护的静态方法。

Methods: A class can implement a maximum of 128 public or protected instance methods, and a maximum of 128 instance methods with package visibility. 方法:一个类最多可以实现128个公共或受保护的实例方法,并且最多可以实现128个具有程序包可见性的实例方法。 These limits include inherited methods. 这些限制包括继承的方法。

Class Instances: Class instances can contain a maximum of 255 fields, where an int data type is counted as occupying two fields. 类实例:类实例最多可以包含255个字段,其中int数据类型被视为占据两个字段。

Arrays: Arrays can hold a maximum of 32767 fields. 数组:数组最多可容纳32767个字段。

There is no official size limit (above the ones Robert already posted). 没有官方的大小限制(高于Robert已经发布的限制)。 Cards may have their own limits depending on available memory - but there is no fixed value for that; 卡可能有其自身的限制,具体取决于可用的内存,但是没有固定的值。 depends on what has already been installed, how their VM works internally and so on. 取决于已安装的内容,其VM在内部的工作方式等等。

There is no specification that mentions the maximum size for an applet. 没有任何说明提到小程序的最大大小。 It all depends on OS, so yeah you should definitely ask NXP. 这完全取决于操作系统,是的,您绝对应该问一下恩智浦。

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

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