📄 jcvm05export.html
字号:
<P CLASS="TableTextCode"><A NAME="pgfId-998782"></A><KBD CLASS="Filename-Command">3</KBD></P></TD></TR><TR><TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1"><P CLASS="TableTextCode"><A NAME="pgfId-998784"></A><KBD CLASS="Filename-Command">CONSTANT_Utf8</KBD></P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableTextCode"><A NAME="pgfId-998786"></A><KBD CLASS="Filename-Command">1</KBD></P></TD></TR></TBODY></TABLE><BR><H3 CLASS="Head2"><A NAME="pgfId-7592"></A>5.6.1 <A NAME="26538"></A>CONSTANT_Package<A NAME="marker-20706"></A></H3><P CLASS="Paragraph"><A NAME="pgfId-7029"></A>The <KBD CLASS="Filename-Command">CONSTANT_Package_info</KBD> structure is used to represent a package:</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-1002693"></A>CONSTANT_Package_info {</P><P CLASS="TableTextCode"><A NAME="pgfId-1002695"></A> u1 tag</P><P CLASS="TableTextCode"><A NAME="pgfId-1002697"></A> u1 flags</P><P CLASS="TableTextCode"><A NAME="pgfId-1002699"></A> u2 name_index</P><P CLASS="TableTextCode"><A NAME="pgfId-1002701"></A> u1 minor_version</P><P CLASS="TableTextCode"><A NAME="pgfId-1002703"></A> u1 major_version</P><P CLASS="TableTextCode"><A NAME="pgfId-1002705"></A> u1 aid_length</P><P CLASS="TableTextCode"><A NAME="pgfId-1002707"></A> u1 aid[aid_length]</P><P CLASS="TableTextCode"><A NAME="pgfId-1002709"></A>}</P></TD></TR></TBODY></TABLE><BR></DIV><P CLASS="Paragraph"><A NAME="pgfId-7038"></A>The items of the <KBD CLASS="Filename-Command">CONSTANT_Package_info</KBD> structure are the following:</P><P CLASS="Paragraph"><A NAME="pgfId-7039"></A><KBD CLASS="Filename-Command">tag</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7040"></A>The tag item has the value of <KBD CLASS="Filename-Command">CONSTANT_Package</KBD> (13).</P><P CLASS="Paragraph"><A NAME="pgfId-9547"></A><KBD CLASS="Filename-Command">flags</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-9548"></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-997915"> </A> TABLE 5-2 Export File Package Flags </CAPTION><THEAD><TR><TH SCOPE="COL" ROWSPAN="1" COLSPAN="1" BGCOLOR="#CCCCCC"><P CLASS="TableHead"><A NAME="pgfId-997919"></A>Flags</P></TH><TH SCOPE="COL" ROWSPAN="1" COLSPAN="1" BGCOLOR="#CCCCCC"><P CLASS="TableHead"><A NAME="pgfId-997921"></A>Value</P></TH></TR></THEAD><TBODY><TR><TD SCOPE="ROW" ROWSPAN="1" COLSPAN="1"><P CLASS="TableTextCode"><A NAME="pgfId-997923"></A><KBD CLASS="Filename-Command">ACC_LIBRARY</KBD></P></TD><TD ROWSPAN="1" COLSPAN="1"><P CLASS="TableTextCode"><A NAME="pgfId-997925"></A><KBD CLASS="Filename-Command">0x01</KBD></P></TD></TR></TBODY></TABLE><BR><P CLASS="ParaIndent1"><A NAME="pgfId-10943"></A>The <KBD CLASS="Filename-Command">ACC_LIBRARY</KBD> flag has the value of one if this package does not define and declare any applets. In this case it is called a library package. Otherwise <KBD CLASS="Filename-Command">ACC_LIBRARY</KBD> has the value of zero.</P><P CLASS="ParaIndent1"><A NAME="pgfId-9601"></A>If the package is not a library package this export file can only contain shareable interfaces.<A NAME="fnote2"></A><A HREF="#pgfId-11608" CLASS="footnote"><SUP>[2]</SUP></A> A shareable interface is either the <KBD CLASS="Filename-Command">javacard.framework.Shareable</KBD> interface or an interface that extends the <KBD CLASS="Filename-Command">javacard.framework.Shareable</KBD> interface.</P><P CLASS="ParaIndent1"><A NAME="pgfId-9576"></A>All other flag values are reserved. Their values must be zero.</P><P CLASS="Paragraph"><A NAME="pgfId-7041"></A><KBD CLASS="Filename-Command">name_index</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7042"></A>The value of the <KBD CLASS="Filename-Command">name_index</KBD> item must be a valid index into the <KBD CLASS="Filename-Command">constant_pool</KBD> table. The <KBD CLASS="Filename-Command">constant_pool</KBD> entry at that index must be a <KBD CLASS="Filename-Command">CONSTANT_Utf8_info</KBD> (<A HREF="JCVM05export.html#53940" CLASS="XRef">Section 5.6.4, CONSTANT_Utf8</A>) structure representing a valid Java package name.</P><P CLASS="ParaIndent1"><A NAME="pgfId-16070"></A>As in Java class files, ASCII periods (`.') that normally separate the identifiers in a package name are replaced by ASCII forward slashes (`/'). For example, the package name <KBD CLASS="Filename-Command">javacard.framework</KBD> is represented in a <KBD CLASS="Filename-Command">CONSTANT_Utf8_info</KBD> structure as <KBD CLASS="Filename-Command">javacard/framework</KBD>.</P><P CLASS="Paragraph"><A NAME="pgfId-7044"></A><KBD CLASS="Filename-Command">minor_version, major_version</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-9449"></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-7046"></A><KBD CLASS="Filename-Command">aid_length</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7047"></A>The value of the <KBD CLASS="Filename-Command">aid_length</KBD> item gives the number of bytes in the aid array. Valid values are between 5 and 16, inclusive.</P><P CLASS="Paragraph"><A NAME="pgfId-7048"></A><KBD CLASS="Filename-Command">aid[]</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7049"></A>The <KBD CLASS="Filename-Command">aid</KBD> array contains the ISO AID of this package (<A HREF="JCVM04naming.html#28462" CLASS="XRef">Section 4.2, AID-based Naming</A>).</P><H3 CLASS="Head2"><A NAME="pgfId-999162"></A>5.6.2 <A NAME="22612"></A>CONSTANT_Classref<A NAME="marker-999161"></A></H3><P CLASS="Paragraph"><A NAME="pgfId-999164"></A>The <KBD CLASS="Filename-Command">CONSTANT_Classref_info</KBD> structure is used to represent a class or interface:</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-1002842"></A>CONSTANT_Classref_info {</P><P CLASS="TableTextCode"><A NAME="pgfId-1002844"></A> u1 tag</P><P CLASS="TableTextCode"><A NAME="pgfId-1002846"></A> u2 name_index</P><P CLASS="TableTextCode"><A NAME="pgfId-1002848"></A>}</P></TD></TR></TBODY></TABLE><BR></DIV><P CLASS="Paragraph"><A NAME="pgfId-1002851"></A>The items of the <KBD CLASS="Filename-Command">CONSTANT_Classref_info</KBD> structure are the following:</P><P CLASS="Paragraph"><A NAME="pgfId-16032"></A><KBD CLASS="Filename-Command">tag</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-999202"></A>The tag item has the value of <KBD CLASS="Filename-Command">CONSTANT_Classref</KBD> (7).</P><P CLASS="Paragraph"><A NAME="pgfId-7060"></A><KBD CLASS="Filename-Command">name_index</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-999207"></A>The value of the <KBD CLASS="Filename-Command">name_index</KBD> item must be a valid index into the <KBD CLASS="Filename-Command">constant_pool</KBD> table. The constant_pool entry at that index must be a <KBD CLASS="Filename-Command">CONSTANT_Utf8_info</KBD> (<A HREF="JCVM05export.html#53940" CLASS="XRef">Section 5.6.4, CONSTANT_Utf8</A>) structure representing a valid fully qualified Java class or interface name. This name is fully qualified since it may represent a class or interface defined in a package other than the one described in the export file.</P><P CLASS="ParaIndent1"><A NAME="pgfId-7062"></A>As in Java class files, ASCII periods (`.') that normally separate the identifiers in a class or interface name are replaced by ASCII forward slashes (`/'). For example, the interface name <KBD CLASS="Filename-Command">javacard.framework.Shareable</KBD> is represented in a <KBD CLASS="Filename-Command">CONSTANT_Utf8_info</KBD> structure as <KBD CLASS="Filename-Command">javacard/framework/Shareable</KBD>.</P><H3 CLASS="Head2"><A NAME="pgfId-7063"></A>5.6.3 <A NAME="11600"></A>CONSTANT_Integer<A NAME="marker-20708"></A></H3><P CLASS="Paragraph"><A NAME="pgfId-7064"></A>The CONSTANT_Integer_info structure is used to represent four-byte numeric (<KBD CLASS="Filename-Command">int</KBD>) constants:</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-1002859"></A>CONSTANT_Integer_info {</P><P CLASS="TableTextCode"><A NAME="pgfId-1002861"></A> u1 tag</P><P CLASS="TableTextCode"><A NAME="pgfId-1002863"></A> u4 bytes</P><P CLASS="TableTextCode"><A NAME="pgfId-1002865"></A>}</P></TD></TR></TBODY></TABLE><BR></DIV><P CLASS="Paragraph"><A NAME="pgfId-7069"></A>The items of the <KBD CLASS="Filename-Command">CONSTANT_Integer_info</KBD> structure are the following:</P><P CLASS="Paragraph"><A NAME="pgfId-7070"></A><KBD CLASS="Filename-Command">tag</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7071"></A>The <KBD CLASS="Filename-Command">tag</KBD> item has the value of <KBD CLASS="Filename-Command">CONSTANT_Integer</KBD> (3).</P><P CLASS="Paragraph"><A NAME="pgfId-7072"></A><KBD CLASS="Filename-Command">bytes</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-17898"></A>The <KBD CLASS="Filename-Command">bytes</KBD> item of the <KBD CLASS="Filename-Command">CONSTANT_Integer_info</KBD> structure contains the value of the <KBD CLASS="Filename-Command">int</KBD> constant. The bytes of the value are stored in big-endian (high byte first) order.</P><P CLASS="ParaIndent1"><A NAME="pgfId-17908"></A>The value of a <KBD CLASS="Filename-Command">boolean</KBD> type is <KBD CLASS="Filename-Command">1</KBD> to represent true and <KBD CLASS="Filename-Command">0</KBD> to represent false.</P><H3 CLASS="Head2"><A NAME="pgfId-17901"></A>5.6.4 <A NAME="53940"></A>CONSTANT_Utf8<A NAME="marker-20709"></A></H3><P CLASS="Paragraph"><A NAME="pgfId-7075"></A>The <KBD CLASS="Filename-Command">CONSTANT_Utf8_info</KBD> structure is used to represent constant string values. UTF-8 strings are encoded in the same way as described in<I CLASS="Title"> The Java Virtual Machine Specification </I>(§ 4.4.7).</P><P CLASS="Paragraph"><A NAME="pgfId-7076"></A>The <KBD CLASS="Filename-Command">CONSTANT_Utf8_info</KBD> structure is:</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-1002911"></A>CONSTANT_Utf8_info {</P><P CLASS="TableTextCode"><A NAME="pgfId-1002913"></A> u1 tag</P><P CLASS="TableTextCode"><A NAME="pgfId-1002915"></A> u2 length</P><P CLASS="TableTextCode"><A NAME="pgfId-1002917"></A> u1 bytes[length]</P><P CLASS="TableTextCode"><A NAME="pgfId-1002919"></A>}</P></TD></TR></TBODY></TABLE><BR></DIV><P CLASS="Paragraph"><A NAME="pgfId-7082"></A>The items of the <KBD CLASS="Filename-Command">CONSTANT_Utf8_info</KBD> structure are the following:</P><P CLASS="Paragraph"><A NAME="pgfId-7083"></A><KBD CLASS="Filename-Command">tag</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7084"></A>The <KBD CLASS="Filename-Command">tag</KBD> item has the value of <KBD CLASS="Filename-Command">CONSTANT_Utf8</KBD> (1).</P><P CLASS="Paragraph"><A NAME="pgfId-7085"></A><KBD CLASS="Filename-Command">length</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7086"></A>The value of the <KBD CLASS="Filename-Command">length</KBD> item gives the number of bytes in the bytes array (not the length of the resulting string). The strings in the <KBD CLASS="Filename-Command">CONSTANT_Utf8_info</KBD> structure are not null-terminated.</P><P CLASS="Paragraph"><A NAME="pgfId-7087"></A><KBD CLASS="Filename-Command">bytes[]</KBD></P><P CLASS="ParaIndent1"><A NAME="pgfId-7088"></A>The <KBD CLASS="Filename-Command">bytes</KBD> array contains the bytes of the string. No byte may have the value <KBD CLASS="Filename-Command">(byte)0</KBD> or (<KBD CLASS="Filename-Command">byte)0xF0-(byte)0xFF</KBD>.</P><H2 CLASS="Head1"><A NAME="pgfId-7089"></A>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -