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

📄 085-087.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 Schlumberger Multiflex Smart Card</TITLE>



<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="083-085.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="087-089.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H4 ALIGN="LEFT"><A NAME="Heading4"></A><FONT COLOR="#000077">Selecting a Directory</FONT></H4>
<P>Even though the Multiflex operating system makes the master file the current file, since you may want to use other cards with your application, it would be typical for your application program to make this selection again and, in the process, retrieve some information about the specific card with which it was dealing. The master file on all ISO 7816-compliant smart cards has the filename 3F00<SUB>16</SUB>. You can make the master file the current file by sending a 7-byte <TT>Select File</TT> command to the card with the fileId of the master file as its argument. Here&#146;s an example:</P>
<P>C0<SUB>16</SUB> A4<SUB>16</SUB> 00<SUB>16</SUB> 00<SUB>16</SUB> 02<SUB>16</SUB> 3F<SUB>16</SUB> 00<SUB>16</SUB></P>
<P>The meaning of each of the bytes in the <TT>Select File</TT> command is given in Table 5.2.</P>
<TABLE WIDTH="100%"><CAPTION ALIGN=LEFT><B>Table 5.2.</B> The 3K Multiflex <TT>Select File</TT> command.
<TR>
<TH WIDTH="23%" ALIGN="LEFT">ISO 7816 Name
<TH WIDTH="23%" ALIGN="LEFT">Description
<TH WIDTH="15%" ALIGN="LEFT">Value
<TH WIDTH="39%" ALIGN="LEFT">Interpretation
<TR>
<TD COLSPAN="4"><HR>
<TR>
<TD>CLA
<TD>Class
<TD>C0<SUB>16</SUB>
<TD>
<TR>
<TD>INS
<TD>Instruction
<TD>A4<SUB>16</SUB>
<TD>
<TR>
<TD>P1
<TD>First parameter
<TD>00<SUB>16</SUB>
<TD>
<TR>
<TD>P2
<TD>Second parameter
<TD>00<SUB>16</SUB>
<TD>
<TR>
<TD>P3
<TD>Third parameter
<TD>02<SUB>16</SUB>
<TD>Two data bytes follow
<TR>
<TD VALIGN="TOP">Data
<TD VALIGN="TOP">Data
<TD VALIGN="TOP">3F<SUB>16</SUB> 00<SUB>16</SUB>
<TD>Fileld of the file to be selected
<TR>
<TD COLSPAN="4"><HR>
</TABLE>
<P>Whenever you send a command to an ISO 7816 smart card, it will respond with two status bytes called status word 1 (SW1) and status word 2 (SW2). This will tell you what the result of processing your command was. Assuming that there is a file with the file identifier 3F00<SUB>16</SUB>, you&#146;d expect the card to respond with</P>
<P>90<SUB>16</SUB> 00<SUB>16</SUB></P>
<P>which is the required ISO 7816-4 status return code for successful completion. This would indicate that the operating system on the card found the file 3F00<SUB>16</SUB> and that it is now the current file. Instead of 90<SUB>16</SUB> 00<SUB>16</SUB> however, the 3K Multiflex card responds with</P>
<P>61<SUB>16</SUB> 14<SUB>16</SUB></P>
<P>This is also a successful completion but with some additional information. It says, &#147;I found the file you selected successfully and I have some information about it available for you.&#148; The second byte tells how much information is available: 14<SUB>16</SUB>, or 20 bytes.</P>
<P>In order to retrieve this file description information, you&#146;ll send a <TT>Get Response</TT> command to the card with the number of bytes you want to retrieve as its third argument. In particular, the bytes</P>
<P>C0<SUB>16</SUB> C0<SUB>16</SUB> 00<SUB>16</SUB> 00<SUB>16</SUB> 14<SUB>16</SUB></P>
<P>would request the operating system to send back the 20 bytes of information about the master file from your 3K Multiflex card. If you do this for the unused 3K Multiflex card contained in the book, the card returns the following 20 bytes:</P>
<P>00<SUB>16</SUB> 00<SUB>16</SUB> 0B<SUB>16</SUB> 10<SUB>16</SUB> 3F<SUB>16</SUB> 00<SUB>16</SUB> 38<SUB>16</SUB> FF<SUB>16</SUB> FF<SUB>16</SUB> 44<SUB>16</SUB> 44<SUB>16</SUB> 01<SUB>16</SUB> 05<SUB>16</SUB> 03<SUB>16</SUB> 00<SUB>16</SUB> 02<SUB>16</SUB> 00<SUB>16</SUB> 00<SUB>16</SUB> 00<SUB>16</SUB> 00<SUB>16</SUB></P>
<P>The interpretation is given in Table 5.3.</P>
<TABLE WIDTH="100%"><CAPTION ALIGN=LEFT><B>Table 5.3.</B> File control information for the master file (3F00<SUB>16</SUB>).
<TR>
<TH WIDTH="13%" ALIGN="LEFT">Byte
<TH WIDTH="33%" ALIGN="LEFT">Description
<TH WIDTH="17%" ALIGN="LEFT">Value
<TH WIDTH="37%" ALIGN="LEFT">Interpretation of Value
<TR>
<TD COLSPAN="4"><HR>
<TR>
<TD>1-2
<TD>Unused
<TD>00<SUB>16</SUB> 00<SUB>16</SUB>
<TD>Unused.
<TR>
<TD VALIGN="TOP">3-4
<TD VALIGN="TOP">Free bytes in selected file
<TD VALIGN="TOP">0B<SUB>16</SUB> 01<SUB>16</SUB>
<TD>There are 2,832 bytes available in this directory.
<TR>
<TD VALIGN="TOP">5-6
<TD VALIGN="TOP">Fileld of selected file
<TD VALIGN="TOP">3F<SUB>16</SUB> 00<SUB>16</SUB>
<TD>The selected file has fileId 3F00<SUB>16</SUB>.
<TR>
<TD VALIGN="TOP">7
<TD VALIGN="TOP">Type of selected file
<TD VALIGN="TOP">38<SUB>16</SUB>
<TD>The selected file is a directory file.
<TR>
<TD>8 High
<TD>Byte unused
<TD>F<SUB>16</SUB>
<TD>Unused.
<TR>
<TD>8 Low
<TD>Byte unused
<TD>F<SUB>16</SUB>
<TD>Unused.
<TR>
<TD VALIGN="TOP">9 High
<TD VALIGN="TOP">Byte access condition for the <TT>Directory</TT> command
<TD VALIGN="TOP">F<SUB>16</SUB>
<TD>The <TT>Directory</TT> command can never be used on this directory.
<TR>
<TD>9 Low
<TD>Byte unused.
<TD>F<SUB>16</SUB>
<TD>Unused.
<TR>
<TD VALIGN="TOP">10 High
<TD VALIGN="TOP">Byte access condition for the <TT>Delete File</TT> command
<TD VALIGN="TOP">4<SUB>16</SUB>
<TD>You must know a cryptographic key to use the <TT>Delete File</TT> command.
<TR>
<TD VALIGN="TOP">10 Low
<TD VALIGN="TOP">Byte access condition for the <TT>Create File</TT> command
<TD VALIGN="TOP">4<SUB>16</SUB>
<TD>You must know a cryptographic key to use the <TT>Create File</TT> command.
<TR>
<TD VALIGN="TOP">11 High
<TD VALIGN="TOP">Byte access condition for the <TT>Rehabilitate</TT> command
<TD VALIGN="TOP">4<SUB>16</SUB>
<TD>You must know a cryptographic key to use the <TT>Rehabilitate</TT> command.
<TR>
<TD VALIGN="TOP">11 Low
<TD VALIGN="TOP">Byte access condition for the <TT>Invalidate</TT> command
<TD VALIGN="TOP">4<SUB>16</SUB>
<TD>You must know a cryptographic key to use the <TT>Invalidate</TT> command.
<TR>
<TD>12
<TD VALIGN="TOP">Status of the selected file
<TD VALIGN="TOP">01<SUB>16</SUB>
<TD>The file is currently unblocked.
<TR>
<TD VALIGN="TOP">13
<TD>Number of bytes in following data
<TD VALIGN="TOP">05<SUB>16</SUB>
<TD VALIGN="TOP">5 bytes of data follow.
<TR>
<TD>14
<TD>Features
<TD>03<SUB>16</SUB>
<TD>Unused.
<TR>
<TD VALIGN="TOP">15
<TD VALIGN="TOP">Number of subdirectories
<TD VALIGN="TOP">00<SUB>16</SUB>
<TD>There are no subdirectories in this directory.
<TR>
<TD VALIGN="TOP">16
<TD VALIGN="TOP">Number of elementary files
<TD VALIGN="TOP">02<SUB>16</SUB>
<TD>There are two elementary files in this directory.
<TR>
<TD>17
<TD VALIGN="TOP">Number of secret codes
<TD VALIGN="TOP">00<SUB>16</SUB>
<TD>There are no secret codes in this directory.
<TR>
<TD>18
<TD>Unused
<TD>00<SUB>16</SUB>
<TD>Unused.
<TR>
<TD VALIGN="TOP">19
<TD>Status of the PIN for this directory
<TD VALIGN="TOP">00<SUB>16</SUB>
<TD>There is no PIN file in the current directory.
<TR>
<TD VALIGN="TOP">20
<TD VALIGN="TOP">Status of PIN unblocking key
<TD VALIGN="TOP">00<SUB>16</SUB>
<TD>The PIN unblocking key is not itself blocked.
<TR>
<TD COLSPAN="4"><HR>
</TABLE>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="083-085.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="087-089.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>



</BODY></HTML>

⌨️ 快捷键说明

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