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

📄 255-257.html

📁 Smart Card Developer s Kit, a smart card manual for development, English
💻 HTML
字号:
<!-- Edit EirGrabber 3.01 -->
<HTML>
<HEAD>
<TITLE>Smart Card Developer's Kit:The FlexCash Card: An E-commerce Smart Card Application</TITLE>



<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="251-255.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="257-262.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H3><A NAME="Heading5"></A><FONT COLOR="#000077">The FlexCash Card Browser and Editor</FONT></H3>
<P>The FlexCash card browser/editor program lets you toggle the Cyberflex card between being an off-the-shelf Version 1.0 Java Card and being a FlexCash card and, in turn, one of the three imaginary e-purse cards. When the card is set to be a Java Card, you can send the card any of the commands supported by the Java Card 1.0 bootstrap loader, including sending it a new Java program to run. The Java Card 1.0 bootstrap loader command set is implemented by code that is stored in and run from the ROM of the Cyberflex card. Since the point of the Cyberflex card is for you to provide the code that turns it into whatever card you like, there are just enough commands in the command set to let you get your code onto the card securely and kick it off. Here is the list of Java Card 1.0 boot loader commands:
</P>
<DL>
<DD><B>&#149;</B>&nbsp;&nbsp;<TT>Select File</TT>
<DD><B>&#149;</B>&nbsp;&nbsp;<TT>Verify Key</TT>
<DD><B>&#149;</B>&nbsp;&nbsp;<TT>Create File</TT>
<DD><B>&#149;</B>&nbsp;&nbsp;<TT>Read Binary</TT>
<DD><B>&#149;</B>&nbsp;&nbsp;<TT>Write Binary</TT>
<DD><B>&#149;</B>&nbsp;&nbsp;<TT>Set Default ATR</TT>
<DD><B>&#149;</B>&nbsp;&nbsp;<TT>Execute Application</TT>
</DL>
<P>The only two of these commands that you haven&#146;t seen before in reading about ISO 7816 smart cards and that are in fact atypical for off-the-shelf smart cards are <TT>Set Default ATR</TT> and <TT>Execute Application</TT>.</P>
<P>The <TT>Set Default ATR</TT> command lets you set the ATR returned by the card when it is reset. The ATR from a smart card identifies what applications or application suites the smart card contains. It is used by smart card terminals and host application programs to determine if they are able to deal with the card. If you are going to make a Java Card behave like one or more existing smart cards, or if you are going to make it behave like a brand new smart card, you have to be able to set the ATR to meet the requirements of the terminals and host programs with which it will communicate. If you don&#146;t reset the ATR, the card simply identifies itself as an unprogrammed Java Card.</P>
<P><TT>The Execute Application</TT> command instructs the card to execute your program when it is reset rather than the Java Card bootstrap loader. This is how your program takes over the Java Card and turns the card into the card defined by your program rather than a generic Java Card.</P>
<P>Rather than sporting a rich set of ISO 7816 commands, the Cyberflex card offers a rich set of function calls to your on-card program. It is your program that defines the commands to which the card responds. The commands supported by an off-the-shelf Java Card are only those needed to get your program onto the card and to let your program take charge of the card.</P>
<P>When the card is set to be a FlexCash card, you can send the card any of the commands supported by the FlexCash program in Listing 11.1. An executable version of this program is stored in and run from the transparent file 2222<SUB>16</SUB>, which is in the master file of the Cyberflex card. After the program was loaded into this file, an <TT>Execute Application</TT> command was sent to the card telling it to &#147;become&#148; the program in file 2222<SUB>16</SUB>; that is, to run the program in this file when it was reset. Once this is done, the card responds only to the commands implemented by the program and only the program can turn the card back into a Java Card.</P>
<P>Once we have turned the Java Card into a FlexCash card, we are ready to build the host application&#151;a FlexCash card browser and editor that communicates with this card.</P>
<P>Figure 11.3 shows the human interface to the FlexCash card browser and editor and Listing 11.2 shows the MFC C&#43;&#43;, which implements this human interface and the program behind it.</P>
<P><A NAME="Fig3"></A><A HREF="images/11-03.jpg"><IMG SRC="images/11-03t.jpg"></A>
<BR><A HREF="images/11-03.jpg"><FONT COLOR="#000077"><B>Figure 11.3.</B></FONT></A>&nbsp;&nbsp;The Human Interface of the FlexCash card browser and editor.<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="251-255.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="257-262.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>



</BODY></HTML>

⌨️ 快捷键说明

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