📄 jcvm06cap.html
字号:
</P></TD></TR></TBODY></TABLE><BR><P CLASS="Paragraph"><A NAME="pgfId-51835"></A>The component type <KBD CLASS="Filename-Command">COMPONENT_Debug</KBD> is not intended for download to the device. It is intended to be used off-card in conjunction with a suitably instrumented Java Card virtual machine.</P><H2 CLASS="Head1"><A NAME="pgfId-16191"></A><DIV><HR ALIGN=left SIZE=6 WIDTH=15% noshade></DIV>6.3 <A NAME="24754"></A>Header <A NAME="marker-54598"></A>Component</H2><P CLASS="Paragraph"><A NAME="pgfId-16192"></A>The Header Component contains general information about this CAP file and the package it defines. It 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-1011961"></A>header_component {</P><P CLASS="TableTextCode"><A NAME="pgfId-1011963"></A> u1 tag</P><P CLASS="TableTextCode"><A NAME="pgfId-1011965"></A> u2 size</P><P CLASS="TableTextCode"><A NAME="pgfId-1011967"></A> u4 magic</P><P CLASS="TableTextCode"><A NAME="pgfId-1011969"></A> u1 minor_version</P><P CLASS="TableTextCode"><A NAME="pgfId-1011971"></A> u1 major_version</P><P CLASS="TableTextCode"><A NAME="pgfId-1011973"></A> u1 flags</P><P CLASS="TableTextCode"><A NAME="pgfId-1011975"></A> package_info package</P><P CLASS="TableTextCode"><A NAME="pgfId-1011977"></A> package_name_info package_name</P><P CLASS="TableTextCode"><A NAME="pgfId-1011979"></A>}</P></TD></TR></TBODY></TABLE><BR></DIV><P CLASS="Paragraph"><A NAME="pgfId-7101"></A>The items in the <KBD CLASS="Filename-Command">header_component</KBD> structure are as follows:</P><P CLASS="Paragraph"><A NAME="pgfId-7102"></A><KBD CLASS="Filename-Command">tag</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7103"></A>The <KBD CLASS="Filename-Command">tag</KBD> item has the value <KBD CLASS="Filename-Command">COMPONENT_Header</KBD> (1).</P><P CLASS="Paragraph"><A NAME="pgfId-7104"></A><KBD CLASS="Filename-Command">size</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7105"></A>The <KBD CLASS="Filename-Command">size</KBD> item indicates the number of bytes in the <KBD CLASS="Filename-Command">header_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-7106"></A><KBD CLASS="Filename-Command">magic</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7107"></A>The <KBD CLASS="Filename-Command">magic</KBD> item supplies the <KBD CLASS="Filename-Command">magic</KBD> number identifying the Java Card CAP file format; it has the value <KBD CLASS="Filename-Command">0xDECAFFED</KBD>.</P><P CLASS="Paragraph"><A NAME="pgfId-7108"></A><KBD CLASS="Filename-Command">minor_version, major_version</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-53656"></A>The <KBD CLASS="Filename-Command">minor_version</KBD> and <KBD CLASS="Filename-Command">major_version</KBD> items are the minor and major version numbers of this CAP file. Together, a major and a minor version number determine the version of the CAP file format. If a CAP file has the major version number of <I CLASS="Variable">M</I> and minor version number of <I CLASS="Variable">m</I>, the version of the CAP file's format is <I CLASS="Variable">M.m</I>. </P><P CLASS="ParaIndent1"><A NAME="pgfId-53721"></A>A change in the major version number indicates a major incompatibility change, one that requires a fundamentally different Java Card virtual machine. A Java Card virtual machine is not required to support CAP files with different major version numbers. A Java Card virtual machine is required to support CAP files having a given major version number and all valid minor version numbers in the range 0 through some particular <KBD CLASS="Filename-Command">minor_version</KBD> where a valid minor version number is a minor version number that has been defined in a version of the Java Card virtual machine specification.</P><P CLASS="ParaIndent1"><A NAME="pgfId-9790"></A>In this specification, the major version of the CAP file format has the value <KBD CLASS="Filename-Command">2</KBD> and the minor version has the value <KBD CLASS="Filename-Command">2</KBD>. Only Sun Microsystems, Inc. may define the meaning and values of new CAP file format versions.</P><P CLASS="Paragraph"><A NAME="pgfId-7110"></A><KBD CLASS="Filename-Command">flags</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7111"></A>The <KBD CLASS="Filename-Command">flags</KBD> item is a mask of modifiers that apply to this package. The <KBD CLASS="Filename-Command">flags</KBD> modifiers are shown in the following table.</P><BR><TABLE CLASS="Titled" BORDER=1 BORDERCOLORLIGHT="#FFFFFF" BORDERCOLORDARK="#000000" CELLPADDING=5 CELLSPACING=0 DIR="LTR"><CAPTION CLASS="TableCaption"><A NAME="pgfId-998638"> </A> TABLE 6-4 CAP <KBD CLASS="Filename-Command"> </KBD> <A NAME="90443"> </A> File Package Flags </CAPTION><THEAD><TR><TH SCOPE="COL" ROWSPAN="1" COLSPAN="1" BGCOLOR="#CCCCCC"><P CLASS="TableHead"><A NAME="pgfId-37574"></A>Flags</P></TH><TH SCOPE="COL" ROWSPAN="1" COLSPAN="1" BGCOLOR="#CCCCCC"><P CLASS="TableHead"><A NAME="pgfId-37576"></A>Value</P></TH></TR></THEAD><TBODY><TR><TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1"><P CLASS="TableText"><A NAME="pgfId-37578"></A>ACC_INT</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableText"><A NAME="pgfId-37580"></A>0x01</P></TD></TR><TR><TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1"><P CLASS="TableText"><A NAME="pgfId-37582"></A>ACC_EXPORT</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableText"><A NAME="pgfId-37584"></A>0x02</P></TD></TR><TR><TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1"><P CLASS="TableText"><A NAME="pgfId-37586"></A>ACC_APPLET</P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableText"><A NAME="pgfId-37588"></A>0x04</P></TD></TR></TBODY></TABLE><BR><P CLASS="ParaIndent1"><A NAME="pgfId-15130"></A>The ACC_INT flag has the value of one if the Java int type is used in this package. The int type is used if one or more of the following is present:</P><UL><UL><LI CLASS="Bullet2"><A NAME="pgfId-16810"></A>a parameter to a method of type int,</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet2-"><A NAME="pgfId-53055"></A>a parameter to a method of type int array,</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet2-"><A NAME="pgfId-23873"></A>a local variable of type int,</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet2-"><A NAME="pgfId-53056"></A>a local variable of type int array,</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet2-"><A NAME="pgfId-16271"></A>a field of type int,</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet2-"><A NAME="pgfId-16239"></A>a field of type int array,</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet2-"><A NAME="pgfId-47027"></A>an instruction of type int, or </LI><P CLASS="Linebreak"></P><LI CLASS="Bullet2-"><A NAME="pgfId-53057"></A>an instruction of type int array.</LI><P CLASS="Linebreak"></P></UL></UL><P CLASS="ParaIndent1"><A NAME="pgfId-47029"></A>Otherwise the <KBD CLASS="Filename-Command">ACC_INT</KBD> flag has the value of <KBD CLASS="Filename-Command">0</KBD>.</P><P CLASS="ParaIndent1"><A NAME="pgfId-16261"></A>The <KBD CLASS="Filename-Command">ACC_EXPORT</KBD> flag has the value of <KBD CLASS="Filename-Command">one</KBD> if an Export Component (<A HREF="JCVM06cap.html#Export Component" CLASS="XRef">Section 6.12, Export Component</A>) is included in this CAP file. Otherwise it has the value of 0.</P><P CLASS="ParaIndent1"><A NAME="pgfId-16288"></A>The <KBD CLASS="Filename-Command">ACC_APPLET</KBD> flag has the value of <KBD CLASS="Filename-Command">one</KBD> if an Applet Component (<A HREF="JCVM06cap.html#Applet Component" CLASS="XRef">Section 6.5, Applet Component</A>) is included in this CAP file. Otherwise it has the value of <KBD CLASS="Filename-Command">0</KBD>.</P><P CLASS="ParaIndent1"><A NAME="pgfId-16302"></A>All other bits in the flags item not defined in <A HREF="JCVM06cap.html#90443" CLASS="XRef">TABLE 6-4</A> are reserved for future use. Their values must be <KBD CLASS="Filename-Command">zero</KBD>.</P><P CLASS="Paragraph"><A NAME="pgfId-7140"></A><KBD CLASS="Filename-Command">package</KBD><A NAME="15974"></A></P><P CLASS="ParaIndent1"><A NAME="pgfId-1012143"></A>The <KBD CLASS="Filename-Command">package</KBD> item describes the package defined in this CAP file. It is represented as a <KBD CLASS="Filename-Command">package_info</KBD> 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-1012146"></A> package_info {</P><P CLASS="TableTextCode"><A NAME="pgfId-1012148"></A> u1 minor_version</P><P CLASS="TableTextCode"><A NAME="pgfId-1012150"></A> u1 major_version</P><P CLASS="TableTextCode"><A NAME="pgfId-1012152"></A> u1 AID_length</P><P CLASS="TableTextCode"><A NAME="pgfId-1012154"></A> u1 AID[AID_length]</P><P CLASS="TableTextCode"><A NAME="pgfId-1012164"></A> }</P></TD></TR></TBODY></TABLE><BR></DIV><P CLASS="ParaIndent1"><A NAME="pgfId-17554"></A>The items in the <KBD CLASS="Filename-Command">package_info</KBD> structure are as follows:</P><P CLASS="Paragraph"><A NAME="pgfId-45619"></A><KBD CLASS="Filename-Command"> minor_version, major_version</KBD><A NAME="40584"></A></P><P CLASS="ParaIndent2"><A NAME="pgfId-45620"></A>The <KBD CLASS="Filename-Command">minor_version</KBD> and major_version items are the minor and major version numbers of this package. These values uniquely identify the particular implementation of this package and indicate the binary compatibility between packages. See <A HREF="JCVM04naming.html#12240" CLASS="XRef">Section 4.5, Package Versions</A> for a description of assigning and using package version numbers.</P><P CLASS="Paragraph"><A NAME="pgfId-7151"></A><KBD CLASS="Filename-Command"> AID_length</KBD></P><P CLASS="ParaIndent2"><A NAME="pgfId-7152"></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-7153"></A><Alt CLASS="InlineAltText"> AID[]</Alt></P><P CLASS="ParaIndent2"><A NAME="pgfId-7154"></A>The <KBD CLASS="Filename-Command">AID</KBD> item represents the Java Card platform name of the package. 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="Paragraph"><A NAME="pgfId-51720"></A><KBD CLASS="Filename-Command">package_name</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-51721"></A>The <KBD CLASS="Filename-Command">package_name</KBD> item describes the name of the package defined in this CAP file. It is represented as a <KBD CLASS="Filename-Command">package_name_info[]</KBD> 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-1012205"></A> package_name_info {</P><P CLASS="TableTextCode"><A NAME="pgfId-1012207"></A> u1 name_length</P><P CLASS="TableTextCode"><A NAME="pgfId-1012209"></A> u1 name[name_length]</P><P CLASS="TableTextCode"><A NAME="pgfId-1012211"></A> }</P></TD></TR></TBODY></TABLE><BR></DIV>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -