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

📄 jcrespec11installer.html

📁 JAVA CARD 开发包规格说明,版本为2.2.2
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><HTML LANG="en"><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"><META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"><META NAME="GENERATOR" CONTENT="Adobe FrameMaker 7.0/HTML Export Filter"><LINK REL="STYLESHEET" HREF="unx_unstr_styles.css" CHARSET="ISO-8859-1" TYPE="text/css"><META name="DC.TITLE" content="Runtime Environment Specification for the Java Card Platform, Version 2.2.2"><TITLE>C H A P T E R    11 - Applet Installation and Deletion </TITLE></HEAD><BODY BGCOLOR="#ffffff"><DIV><div class="navbar" align="center"><table dir="LTR" summary="Navigation bar, includes the book title and navigation buttons" width=100% cellpadding="0" cellspacing="0" border="0"><colgroup span="2" width="100%"><col id="1" span="1" width="50%"><col id="2" span="1" width="50%"><tr bgcolor="#cccccc"><td class="navbartitle" align=left rowspan="1" colspan="1" abbr="ChapTitle">&nbsp;&nbsp;Runtime Environment Specification for the Java Card Platform, Version 2.2.2</td><td valign="top" align="right" rowspan="1" colspan="1" abbr="NavButtons"><a href="index.html"><img src="shared/toc01.gif" title="Table Of Contents" alt="Table Of Contents" width="30" height="26" border="0"></a><a href="JCRESpec10vm.html"><img src="shared/prev01.gif" title="Previous Chapter" alt="Previous Chapter" width="30" height="26" border="0"></a><a href="JCRESpec12constants.html"><img src="shared/next01.gif" title="Next Chapter" alt="Next Chapter" width="30" height="26" border="0"></a><a href="ix.html"><img src="shared/index01.gif" title="Book Index" alt="Book Index" width="30" height="26" border="0"></a></td></tr></table><br><br></div></DIV><TABLE DIR="LTR" SUMMARY="Chapter Number" ABBR="ChapNum" WIDTH="100%" BORDER="0"><COLGROUP SPAN="1" WIDTH="100%"><COL ID="1" SPAN="1"><TR><TD ALIGN="right" CLASS="ChapNumber"><SPAN CLASS="ChapNumPrefix"><A NAME="pgfId-409324"></A>C H A P T E R    </SPAN>&nbsp;<SPAN CLASS="ChapNumNum">11</SPAN><A NAME="17042"></A></TD></TR></TABLE><TABLE DIR="LTR" SUMMARY="Chapter Title" ABBR="ChapTitle" WIDTH="100%" BORDER="0"><COLGROUP SPAN="1" WIDTH="100%"><COL ID="1" SPAN="1" WIDTH="100%"><TR><TD ALIGN="right" CLASS="ChapTitle"><HR SIZE=7 NOSHADE><A NAME="pgfId-409325"></A><A NAME="20884"></A><A NAME="marker-413213"></A>Applet Installation and Deletion</TD></TR></TABLE><P CLASS="Paragraph"><A NAME="pgfId-418418"></A>Applet installation and deletion on smart cards using Java Card technology is a complex topic. The design of the <EM CLASS="Emphasis">Application Programming Interface, Java Card Platform, Version 2.2.2</EM> is intended to give Java Card RE implementers as much freedom as possible in their implementations. However, some basic common specifications are required to allow Java Card applets to be installed and deleted without knowing the implementation details of a particular installer or deletion manager.</P><P CLASS="Paragraph"><A NAME="pgfId-407505"></A>This specification defines the concepts of an Installer and an Applet Deletion Manager and specifies minimal requirements to achieve interoperability across a wide range of possible Installer implementations. </P><P CLASS="Paragraph"><A NAME="pgfId-407507"></A>The Applet Installer is an optional part of the <EM CLASS="Emphasis">Runtime Environment Specification, Java Card Platform, Version 2.2.2</EM>. An implementation of the Java Card RE does not necessarily need to include a post-issuance Installer. However, if implemented, the installer is required to support the behavior specified in this chapter.</P><P CLASS="Paragraph"><A NAME="pgfId-410253"></A>If the implementation of the Java Card RE includes a post-issuance Installer, an Applet Deletion Manager that supports the behavior specified in this chapter is also required.</P><P CLASS="Paragraph"><A NAME="pgfId-417544"></A><A HREF="JCRESpec11installer.html#10326" CLASS="XRef">Section 11.1, The Installer</A> describes CAP file loading and linking. For more information on CAP files, see the <EM CLASS="Emphasis">Virtual Machine Specification, Java Card Platform, Version 2.2.2</EM>. <A HREF="JCRESpec11installer.html#42591" CLASS="XRef">Section 11.2, The Newly Installed Applet</A> describes applet installation. Even though the loading and linking operations are described together with the installation operations, there is no requirement that they be performed together during the same card session for the following reasons:</P><UL><LI CLASS="Bullet1"><A NAME="pgfId-417573"></A>Applet packages in ROM are preloaded and prelinked at card issuance, but instances of applets from these packages may be installed by the Installer during a card session.</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-417574"></A>Applet packages may be downloaded and linked by the Installer during one card session, but applet instances from these packages may be installed by the Installer during a different card session.</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-417585"></A>Library packages may be preloaded in ROM or downloaded and linked by the Installer during a card session. There are no applets to install within a library package.</LI><P CLASS="Linebreak"></P></UL><H2 CLASS="Head1"><A NAME="pgfId-407517"></A><DIV><HR ALIGN=left SIZE=6 WIDTH=15% noshade></DIV>11.1	<A NAME="10326"></A>The <A NAME="marker-413214"></A>Installer</H2><P CLASS="Paragraph"><A NAME="pgfId-407519"></A>The mechanisms necessary to install an applet on smart cards using Java Card technology are embodied in an on-card component called the Installer.</P><P CLASS="Paragraph"><A NAME="pgfId-407521"></A>To the CAD the Installer appears to be an applet. It has an AID, and it becomes the currently selected applet when this AID is successfully processed by a SELECT FILE command. Once selected on a logical channel, the Installer behaves in much the same way as any other applet, as follows:</P><UL><LI CLASS="Bullet1"><A NAME="pgfId-407523"></A>It receives all APDUs dispatched to this logical channel just like any other active applet.</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-407525"></A>Its design specification prescribes the various kinds and formats of APDUs that it expects to receive along with the semantics of those commands under various preconditions.</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-407527"></A>It processes and responds to all APDUs that it receives. Response to incorrect APDUs include an error condition of some kind.</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-407529"></A>When another applet is selected on this logical channel (or when the card is reset or when power is removed from the card), the Installer becomes deselected and remains suspended until the next time that it is selected.</LI><P CLASS="Linebreak"></P></UL><H3 CLASS="Head2"><A NAME="pgfId-407537"></A>11.1.1	Installer Implementation</H3><P CLASS="Paragraph"><A NAME="pgfId-411061"></A>The Installer need not be implemented as an applet on the card. The requirement is only that the Installer functionality be SELECTable. The corollary to this requirement is that Installer component shall not be able to be invoked on a logical channel on which a non-Installer applet is an active applet instance nor when no applet is active.</P><P CLASS="Paragraph"><A NAME="pgfId-410416"></A>Obviously, a Java Card RE implementer could choose to implement the Installer as an applet. If so, then the Installer might be coded to extend the <KBD CLASS="Filename-Command">Applet</KBD> class and respond to invocations of the <KBD CLASS="Filename-Command">select</KBD>, <KBD CLASS="Filename-Command">process</KBD>, and <KBD CLASS="Filename-Command">deselect</KBD> methods; and, if necessary, the methods of the <KBD CLASS="Filename-Command">javacard.framework.MultiSelectable</KBD> interface.</P><P CLASS="Paragraph"><A NAME="pgfId-407541"></A>But a Java Card RE implementer could also implement the Installer in other ways, as long as it provides the SELECTable behavior to the outside world. In this case, the Java Card RE implementer has the freedom to provide some other mechanism by which APDUs are delivered to the Installer code module.</P><H3 CLASS="Head2"><A NAME="pgfId-407551"></A>11.1.2	Installer AID</H3><P CLASS="Paragraph"><A NAME="pgfId-407553"></A>Because the Installer is SELECTable, it shall have an AID. Java Card RE implementers are free to choose their own AIDs by which their Installer is selected. Multiple installers may be implemented.</P><H3 CLASS="Head2"><A NAME="pgfId-407561"></A>11.1.3	Installer APDUs</H3><P CLASS="Paragraph"><A NAME="pgfId-407563"></A>The Java Card specification does not specify any APDUs for the Installer. Java Card RE implementers are free to choose their own APDU commands to direct their Installer in its work. </P><P CLASS="Paragraph"><A NAME="pgfId-407565"></A>The model is that the Installer on the card is initiated by an installation program running on the CAD. For installation to succeed, this CAD installation program shall be able to do the following:</P><UL><LI CLASS="Bullet1"><A NAME="pgfId-407567"></A>Recognize the card.</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-407569"></A>SELECT FILE the Installer on the card.</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-407571"></A>Coordinate the installation process by sending the appropriate APDUs to the card Installer. These APDUs will include the following:</LI><P CLASS="Linebreak"></P><UL><LI CLASS="Bullet2"><A NAME="pgfId-407573"></A>Authentication information, to ensure that the installation is authorized.</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet2"><A NAME="pgfId-407575"></A>The applet code to be loaded into the card's memory.</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet2"><A NAME="pgfId-407577"></A>Linkage information to link the applet code with code already on the card.</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet2"><A NAME="pgfId-407579"></A>Instance initialization parameter data to be sent to the applet's <KBD CLASS="Filename-Command">install</KBD> method.</LI><P CLASS="Linebreak"></P></UL></UL><P CLASS="Paragraph"><A NAME="pgfId-407583"></A>The <EM CLASS="Emphasis">Application Programming Interface, Java Card Platform, Version 2.2.2</EM> does not specify the details of the CAD installation program nor the APDUs passed between it and the Installer.</P><H3 CLASS="Head2"><A NAME="pgfId-411001"></A>11.1.4	CAP File Versions</H3><P CLASS="Paragraph"><A NAME="pgfId-411002"></A>The Installer shall support the following CAP file versions:</P><UL><LI CLASS="Bullet1"><A NAME="pgfId-411003"></A>Version 2.1 as specified in the Java Card 2.1.1 Virtual Machine Specification.</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-410184"></A>Version 2.2 as specified in the <EM CLASS="Emphasis">Virtual Machine Specification, Java Card Platform, Version 2.2.2</EM>.</LI><P CLASS="Linebreak"></P></UL><H3 CLASS="Head2"><A NAME="pgfId-410185"></A>11.1.5	Installer Behavior</H3><P CLASS="Paragraph"><A NAME="pgfId-407593"></A>Java Card RE implementers shall also define other behaviors of their Installer, including the following:</P><UL><LI CLASS="Bullet1"><A NAME="pgfId-407595"></A>Whether or not installation can be aborted and how this is done</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-407597"></A>What happens if an exception, reset, or power fail occurs during installation</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-407599"></A>What happens if another applet is selected before the Installer is finished with its work</LI><P CLASS="Linebreak"></P></UL><P CLASS="Paragraph"><A NAME="pgfId-407601"></A>The Java Card RE shall guarantee that an applet will not be deemed successfully installed in the following cases:</P><UL><LI CLASS="Bullet1"><A NAME="pgfId-407603"></A>The applet package as identified by the package AID is already resident on the card.</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-413638"></A>The applet package contains an applet with the same Java Card platform name as that of another applet already resident on the card. The Java Card platform name of an applet identified by the AID item is described in Section 6.5 of the <EM CLASS="Emphasis">Virtual Machine Specification, Java Card Platform, Version 2.2.2</EM>.</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-413356"></A>The applet package requires more memory than is available on the card. </LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-407605"></A>The applet package references a package that is not resident on the card. </LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-409535"></A>The applet package references another package already resident on the card, but the version of the resident package is not binary compatible with the applet package. For more information on binary compatibility in the Java programming language, see <EM CLASS="Emphasis">Java</EM><EM CLASS="Emphasis"></EM><EM CLASS="Emphasis"> Language Specification</EM>. Binary compatibility in Java Card technology is discussed in the <EM CLASS="Emphasis">Virtual Machine Specification, Java Card Platform, Version 2.2.2</EM>. </LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-409539"></A>A class in the applet package is found to contain more package visible virtual methods or instance fields than the limitations enumerated in Section 2.2.4.3 of the <EM CLASS="Emphasis">Virtual Machine Specification, Java Card Platform, Version 2.2.2</EM>.</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-409992"></A>A reset or power fail occurs while executing the applet's <KBD CLASS="Filename-Command">install</KBD> method and before successful return from the <KBD CLASS="Filename-Command">Applet.register</KBD> method (see <A HREF="JCRESpec03appletlife.html#21819" CLASS="XRef">Section 3.1, install Method</A>).</LI><P CLASS="Linebreak"></P><LI CLASS="Bullet1"><A NAME="pgfId-410213"></A>The applet's <KBD CLASS="Filename-Command">install</KBD> method throws an exception before successful return from the <KBD CLASS="Filename-Command">Applet.register</KBD> method (see <A HREF="JCRESpec03appletlife.html#21819" CLASS="XRef">Section 3.1, install Method</A>).</LI>

⌨️ 快捷键说明

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