⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jcvm06cap.html

📁 JAVA CARD 开发包规格说明,版本为2.2.2
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<P CLASS="ParaIndent1"><A NAME="pgfId-55046"></A>The items in the <KBD CLASS="Filename-Command">package_name_info[]</KBD> structure are as follows:</P><P CLASS="Paragraph"><A NAME="pgfId-51750"></A><KBD CLASS="Filename-Command">   name_length</KBD></P><P CLASS="ParaIndent2"><A NAME="pgfId-51751"></A>The <KBD CLASS="Filename-Command">name_length</KBD> item is the number of bytes used in the name item to represent the name of this package in UTF-8 format. The value of this item may be zero if and only if the package does not define any remote interfaces or remote classes.</P><P CLASS="Paragraph"><A NAME="pgfId-51752"></A><KBD CLASS="Filename-Command">   name[]</KBD></P><P CLASS="ParaIndent2"><A NAME="pgfId-1010634"></A>The <KBD CLASS="Filename-Command">name[]</KBD> item is a variable length representation of the fully qualified name of this package in UTF-8 format. The fully qualified name is represented in internal form as described in <I CLASS="Title"></I><EM CLASS="Emphasis">Java Virtual Machine Specification</EM><I CLASS="Title"></I> (Section 4.2).</P><H2 CLASS="Head1"><A NAME="pgfId-1010640"></A><DIV><HR ALIGN=left SIZE=6 WIDTH=15% noshade></DIV>6.4	<A NAME="Directory Component"></A>Directory <A NAME="marker-1010639"></A>Component</H2><P CLASS="Paragraph"><A NAME="pgfId-47187"></A>The Directory Component lists the size of each of the components defined in this CAP file. When an optional component is not included, such as the Applet Component (<A HREF="JCVM06cap.html#Applet Component" CLASS="XRef">Section 6.5, Applet Component</A>), Export Component (<A HREF="JCVM06cap.html#Export Component" CLASS="XRef">Section 6.12, Export Component</A>), or Debug Component (<A HREF="JCVM06cap.html#26211" CLASS="XRef">Section 6.14, Debug Component</A>), it is represented in the Directory Component with size equal to zero. The Directory Component also includes entries for new (or custom) components.</P><P CLASS="Paragraph"><A NAME="pgfId-1012346"></A>The Directory Component is described by the following variable-length structure:</P><DIV CLASS="Code"><BR><TABLE CLASS="Code" BORDER=1 BORDERCOLORLIGHT="#FFFFFF" BORDERCOLORDARK="#000000" CELLPADDING=5 CELLSPACING=0 DIR="LTR"><TBODY><TR><TD SCOPE="ROW"><P CLASS="TableTextCode"><A NAME="pgfId-1012349"></A>directory_component {</P><P CLASS="TableTextCode"><A NAME="pgfId-1012351"></A>       u1 tag</P><P CLASS="TableTextCode"><A NAME="pgfId-1012353"></A>       u2 size</P><P CLASS="TableTextCode"><A NAME="pgfId-1012355"></A>       u2 component_sizes[12]</P><P CLASS="TableTextCode"><A NAME="pgfId-1012357"></A>       static_field_size_info static_field_size</P><P CLASS="TableTextCode"><A NAME="pgfId-1012359"></A>       u1 import_count</P><P CLASS="TableTextCode"><A NAME="pgfId-1012361"></A>       u1 applet_count</P><P CLASS="TableTextCode"><A NAME="pgfId-1012363"></A>       u1 custom_count</P><P CLASS="TableTextCode"><A NAME="pgfId-1012365"></A>       custom_component_info custom_components[custom_count]</P><P CLASS="TableTextCode"><A NAME="pgfId-1012367"></A> }</P></TD></TR></TBODY></TABLE><BR></DIV><P CLASS="Paragraph"><A NAME="pgfId-7172"></A>The items in the <KBD CLASS="Filename-Command">directory_component</KBD> structure are as follows:</P><P CLASS="Paragraph"><A NAME="pgfId-7173"></A><KBD CLASS="Filename-Command">tag</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7174"></A>The tag item has the value <KBD CLASS="Filename-Command">COMPONENT_Directory</KBD> (2).</P><P CLASS="Paragraph"><A NAME="pgfId-7175"></A><KBD CLASS="Filename-Command">size</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7176"></A>The <KBD CLASS="Filename-Command">size</KBD> item indicates the number of bytes in the <KBD CLASS="Filename-Command">directory_component</KBD> structure, excluding the <KBD CLASS="Filename-Command">tag</KBD> and <KBD CLASS="Filename-Command">size</KBD> items. The value of the <KBD CLASS="Filename-Command">size</KBD> item must be greater than zero.</P><P CLASS="Paragraph"><A NAME="pgfId-7181"></A><KBD CLASS="Filename-Command">component_sizes[]</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7182"></A>The <KBD CLASS="Filename-Command">component_sizes</KBD> item is an array representing the number of bytes in each of the components in this CAP file. All of the 12 components defined in this chapter are represented in the <KBD CLASS="Filename-Command">component_sizes</KBD> array. The value of an index into the array is equal to the value of the tag of the component represented at that entry, minus 1.</P><P CLASS="ParaIndent1"><A NAME="pgfId-24314"></A>The value in each entry in the <KBD CLASS="Filename-Command">component_sizes</KBD> array is the same as the size item in the corresponding component. It represents the number of bytes in the component, excluding the <KBD CLASS="Filename-Command">tag</KBD> and <KBD CLASS="Filename-Command">size</KBD> items.</P><P CLASS="ParaIndent1"><A NAME="pgfId-24327"></A>The value of an entry in the <KBD CLASS="Filename-Command">component_sizes</KBD> array is zero for components not included in this CAP file. Components that may not be included are the Applet Component (<A HREF="JCVM06cap.html#Applet Component" CLASS="XRef">Section 6.5, Applet Component</A>), the Export Component (<A HREF="JCVM06cap.html#Export Component" CLASS="XRef">Section 6.12, Export Component</A>), and the Debug Component (<A HREF="JCVM06cap.html#26211" CLASS="XRef">Section 6.14, Debug Component</A>). For all other components the value is greater than zero.</P><P CLASS="Paragraph"><A NAME="pgfId-24428"></A><KBD CLASS="Filename-Command">static_field_size</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-24429"></A>The <KBD CLASS="Filename-Command">static_field_size</KBD> item is a <KBD CLASS="Filename-Command">static_field_size_info</KBD> structure. The structure is defined as:</P><DIV CLASS="Code"><BR><TABLE CLASS="Code" BORDER=1 BORDERCOLORLIGHT="#FFFFFF" BORDERCOLORDARK="#000000" CELLPADDING=5 CELLSPACING=0 DIR="LTR"><TBODY><TR><TD SCOPE="ROW"><P CLASS="TableTextCode"><A NAME="pgfId-1012426"></A>   static_field_size_info {</P><P CLASS="TableTextCode"><A NAME="pgfId-1012428"></A>      u2 image_size</P><P CLASS="TableTextCode"><A NAME="pgfId-1012430"></A>      u2 array_init_count</P><P CLASS="TableTextCode"><A NAME="pgfId-1012432"></A>      u2 array_init_size</P><P CLASS="TableTextCode"><A NAME="pgfId-1012434"></A>   }</P></TD></TR></TBODY></TABLE><BR></DIV><P CLASS="ParaIndent1"><A NAME="pgfId-16549"></A>The items in the <KBD CLASS="Filename-Command">static_field_size_info</KBD> structure are the following:</P><P CLASS="Paragraph"><A NAME="pgfId-16474"></A><KBD CLASS="Filename-Command">  image_size</KBD></P><P CLASS="ParaIndent2"><A NAME="pgfId-16475"></A>The <KBD CLASS="Filename-Command">image_size</KBD> item has the same value as the <KBD CLASS="Filename-Command">image_size</KBD> item in the Static Field Component (<A HREF="JCVM06cap.html#40036" CLASS="XRef">Section 6.10, Static Field Component</A>). It represents the total number of bytes in the <KBD CLASS="Filename-Command">static</KBD> fields defined in this package, excluding final <KBD CLASS="Filename-Command">static</KBD> fields of primitive types.</P><P CLASS="Paragraph"><A NAME="pgfId-16479"></A><KBD CLASS="Filename-Command">  array_init_count</KBD></P><P CLASS="ParaIndent2"><A NAME="pgfId-16480"></A>The <KBD CLASS="Filename-Command">array_init_count</KBD> item has the same value as the <KBD CLASS="Filename-Command">array_init_count</KBD> item in the Static Field Component (<A HREF="JCVM06cap.html#40036" CLASS="XRef">Section 6.10, Static Field Component</A>). It represents the number of arrays initialized in all of the <KBD CLASS="Filename-Command">&lt;clinit&gt;</KBD> methods in this package.</P><P CLASS="Paragraph"><A NAME="pgfId-16495"></A><KBD CLASS="Filename-Command">  array_init_size</KBD></P><P CLASS="ParaIndent2"><A NAME="pgfId-16496"></A>The <KBD CLASS="Filename-Command">array_init_size</KBD> item represents the sum of the count items in the <KBD CLASS="Filename-Command">array_init</KBD> table item of the Static Field Component (<A HREF="JCVM06cap.html#40036" CLASS="XRef">Section 6.10, Static Field Component</A>). It is the total number of bytes in all of the arrays initialized in all of the <KBD CLASS="Filename-Command">&lt;clinit&gt;</KBD> methods in this package.</P><P CLASS="Paragraph"><A NAME="pgfId-24341"></A><KBD CLASS="Filename-Command">import_count</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-24342"></A>The <KBD CLASS="Filename-Command">import_count</KBD> item indicates the number of packages imported by classes and interfaces in this package. This item has the same value as the count item in the Import Component (<A HREF="JCVM06cap.html#41659" CLASS="XRef">Section 6.6, Import Component</A>).</P><P CLASS="Paragraph"><A NAME="pgfId-24346"></A><KBD CLASS="Filename-Command">applet_count</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-24375"></A>The <KBD CLASS="Filename-Command">applet_count</KBD> item indicates the number of applets defined in this package. If an Applet Component <A HREF="JCVM06cap.html#Applet Component" CLASS="XRef">Section 6.5, Applet Component</A>) is not included in this CAP file, the value of the <KBD CLASS="Filename-Command">applet_count</KBD> item is zero. Otherwise the value of the <KBD CLASS="Filename-Command">applet_count</KBD> item is the same as the value of the count item in the Applet Component (<A HREF="JCVM06cap.html#Applet Component" CLASS="XRef">Section 6.5, Applet Component</A>).</P><P CLASS="Paragraph"><A NAME="pgfId-24351"></A><KBD CLASS="Filename-Command">custom_count</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-24352"></A>The <KBD CLASS="Filename-Command">custom_count</KBD> item indicates the number of entries in the <KBD CLASS="Filename-Command">custom_components</KBD> table. Valid values are between 0 and 127, inclusive.</P><P CLASS="Paragraph"><A NAME="pgfId-7190"></A><KBD CLASS="Filename-Command">custom_components[]</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-46122"></A>The <KBD CLASS="Filename-Command">custom_components</KBD> item is a table of variable-length <KBD CLASS="Filename-Command">custom_component_info</KBD> structures. Each new component defined in this CAP file must be represented in the table. These components are not defined in this standard.</P><P CLASS="ParaIndent1"><A NAME="pgfId-46123"></A>The <KBD CLASS="Filename-Command">custom_component_info</KBD> structure is defined as:</P><DIV CLASS="Code"><BR><TABLE CLASS="Code" BORDER=1 BORDERCOLORLIGHT="#FFFFFF" BORDERCOLORDARK="#000000" CELLPADDING=5 CELLSPACING=0 DIR="LTR"><TBODY><TR><TD SCOPE="ROW"><P CLASS="TableTextCode"><A NAME="pgfId-1012510"></A>   custom_component_info {</P><P CLASS="TableTextCode"><A NAME="pgfId-1012512"></A>       u1 component_tag</P><P CLASS="TableTextCode"><A NAME="pgfId-1012514"></A>       u2 size</P><P CLASS="TableTextCode"><A NAME="pgfId-1012516"></A>       u1 AID_length</P><P CLASS="TableTextCode"><A NAME="pgfId-1012518"></A>       u1 AID[AID_length]</P><P CLASS="TableTextCode"><A NAME="pgfId-1012520"></A>       }</P></TD></TR></TBODY></TABLE><BR></DIV><P CLASS="ParaIndent1"><A NAME="pgfId-24192"></A>The items in entries of the <KBD CLASS="Filename-Command">custom_component_info</KBD> structure are:</P><P CLASS="Paragraph"><A NAME="pgfId-7192"></A><KBD CLASS="Filename-Command">  component_tag</KBD></P><P CLASS="ParaIndent2"><A NAME="pgfId-7193"></A>The <KBD CLASS="Filename-Command">component_tag</KBD> item represents the tag of the component. Valid values are between 128 and 255, inclusive.</P><P CLASS="Paragraph"><A NAME="pgfId-7194"></A><KBD CLASS="Filename-Command">  size</KBD></P><P CLASS="ParaIndent2"><A NAME="pgfId-7195"></A>The <KBD CLASS="Filename-Command">size</KBD> item represents the number of bytes in the component, excluding the <KBD CLASS="Filename-Command">tag</KBD> and <KBD CLASS="Filename-Command">size</KBD> items.</P><P CLASS="Paragraph"><A NAME="pgfId-7196"></A><KBD CLASS="Filename-Command">  AID_length</KBD></P><P CLASS="ParaIndent2"><A NAME="pgfId-7197"></A>The <KBD CLASS="Filename-Command">AID_length</KBD> item represents the number of bytes in the <KBD CLASS="Filename-Command">AID</KBD> item. Valid values are between 5 and 16, inclusive.</P><P CLASS="Paragraph"><A NAME="pgfId-7198"></A><KBD CLASS="Filename-Command">  AID[]</KBD></P><P CLASS="ParaIndent2"><A NAME="pgfId-7199"></A>The <KBD CLASS="Filename-Command">AID</KBD> item represents the Java Card platform name of the component. See ISO 7816-5 for the definition of an AID (<A HREF="JCVM04naming.html#28462" CLASS="XRef">Section 4.2, AID-based Naming</A>).</P><P CLASS="ParaIndent2"><A NAME="pgfId-24281"></A>Each component is assigned an AID conforming to the ISO 7816-5 standard. Beyond that, there are no constraints on the value of an <KBD CLASS="Filename-Command">AID</KBD> of a custom component.</P><H2 CLASS="Head1"><A NAME="pgfId-7200"></A><DIV><HR ALIGN=left SIZE=6 WIDTH=15% noshade></DIV>6.5	<A NAME="Applet Component"></A>Applet <A NAME="marker-54600"></A>Component</H2><P CLASS="Paragraph"><A NAME="pgfId-24536"></A>The Applet Component contains an entry for each of the applets defined in this package. Applets are defined by implementing a non-abstract subclass, direct or indirect, of the <KBD CLASS="Filename-Command">javacard.framework.Applet</KBD> class.<A NAME="fnote2"></A><A HREF="#pgfId-24544"  CLASS="footnote"><SUP>[2]</SUP></A> If no applets are defined, this component must not be present in this CAP file. </P><P CLASS="Paragraph"><A NAME="pgfId-24539"></A>The Applet Component is described by the following variable-length structure:</P><DIV CLASS="Code"><BR><TABLE CLASS="Code" BORDER=1 BORDERCOLORLIGHT="#FFFFFF" BORDERCOLORDARK="#000000" CELLPADDING=5 CELLSPACING=0 DIR="LTR"><TBODY><TR><TD SCOPE="ROW"><P CLASS="TableTextCode"><A NAME="pgfId-1012596"></A>applet_component {</P><P CLASS="TableTextCode"><A NAME="pgfId-1012598"></A>     u1 tag</P><P CLASS="TableTextCode"><A NAME="pgfId-1012600"></A>     u2 size</P><P CLASS="TableTextCode"><A NAME="pgfId-1012602"></A>     u1 count</P><P CLASS="TableTextCode"><A NAME="pgfId-1012604"></A>       { u1 AID_length</P><P CLASS="TableTextCode"><A NAME="pgfId-1012606"></A>         u1 AID[AID_length]</P><P CLASS="TableTextCode"><A NAME="pgfId-1012608"></A>         u2 install_method_offset</P><P CLASS="TableTextCode"><A NAME="pgfId-1012610"></A>       } applets[count]</P><P CLASS="TableTextCode"><A NAME="pgfId-1012612"></A>}</P></TD></TR></TBODY></TABLE><BR></DIV><P CLASS="Paragraph"><A NAME="pgfId-7212"></A>The items in the <KBD CLASS="Filename-Command">applet_component</KBD> structure are as follows:</P><P CLASS="Paragraph"><A NAME="pgfId-7213"></A><KBD CLASS="Filename-Command">tag</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7214"></A>The tag item has the value <KBD CLASS="Filename-Command">COMPONENT_Applet</KBD> (3).</P><P CLASS="Paragraph"><A NAME="pgfId-7215"></A><KBD CLASS="Filename-Command">size</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7216"></A>The <KBD CLASS="Filename-Command">size</KBD> item indicates the number of bytes in the <KBD CLASS="Filename-Command">applet_component</KBD> structure, excluding the <KBD CLASS="Filename-Command">tag</KBD> and <KBD CLASS="Filename-Command">size</KBD> items. The value of the <KBD CLASS="Filename-Command">size</KBD> item must be greater than zero.</P><P CLASS="Paragraph"><A NAME="pgfId-47970"></A><KBD CLASS="Filename-Command">count</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7218"></A>The <KBD CLASS="Filename-Command">count</KBD> item indicates the number of applets defined in this package. The value of the <KBD CLASS="Filename-Command">count</KBD> item must be greater than zero.</P><P CLASS="Paragraph"><A NAME="pgfId-7219"></A><KBD CLASS="Filename-Command">applets[]</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-14247"></A>The <KBD CLASS="Filename-Command">applets</KBD> item represents a table of variable-length structures each describing an applet defined in this package.</P><P CLASS="ParaIndent1"><A NAME="pgfId-14254"></A>The items in each entry of the <KBD CLASS="Filename-Command">applets</KBD> table are defined as follows:</P><P CLASS="Paragraph"><A NAME="pgfId-7221"></A><KBD CLASS="Filename-Command">  AID_length</KBD></P><P CLASS="ParaIndent2"><A NAME="pgfId-7222"></A>The <KBD CLASS="Filename-Command">AID_length</KBD> item represents the number of bytes in the AID item. Valid values are between 5 and 16, inclusive.</P><P CLASS="Paragraph"><A NAME="pgfId-9768"></A><KBD CLASS="Filename-Command">  AID[]</KBD>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -