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

📄 index.html

📁 用来测试任何pcsc兼容读卡器
💻 HTML
📖 第 1 页 / 共 2 页
字号:
        PCSC readers.</td>
    </tr>
    <tr>
        <td><a href="../samples/sample10.exe"><img
        src="HelpFiles/doc1.i3.jpg" border="0"
        width="32" height="32"></a></td>
        <td>Sample10.dpr</td>
        <td>Example of using transactions.<A href='#prob'><sup>1</sup></A></td>
    </tr>
    <tr>
        <td><a href="../samples/sample11.exe"><img
        src="HelpFiles/doc1.i3.jpg" border="0"
        width="32" height="32"></a></td>
        <td>Sample11.dpr</td>
        <td>Example of using TGSMCard component and monitoring
        multiple readers.<A href='#prob'><sup>2</sup></A></td>
    </tr>
    <tr>
        <td><a href="../samples/sample11.exe"><img
        src="HelpFiles/doc1.i3.jpg" border="0" width="32" height="32"></a></td>
        <td>Sample13.dpr</td>
        <td>Presents most of TReaderDialog properties and
        options.</td>
    </tr>
    <tr>
        <td><a href="../samples/apdu2.exe"><img
        src="HelpFiles/doc1.i3.jpg" border="0"
        width="32" height="32"></a></td>
        <td><a href="#3">APDU2.dpr</a></td>
        <td>Simple application for testing apdu commands (a bit
        more advanced than Sample7).</td>
    </tr>
</table>

<A NAME='prob'>
<p><sup>1</sup> There is a known problem concerning transactions
- a transaction request cannot be cancelled. That is contrary to
PCSC specification and can results in hanging of waiting
instances.</p>
</A>

<p><sup>2</sup> There is a known problem occuring during
monitoring multiple readers - if a reader has multiple
&quot;aliases&quot;, then trying to monitor the state multiple
aliases will result in an error. This is handled in this version
of the classes by ignoring some errors returned by the Resource
Manager, but it is only a temporary solution.</p>


<a name="2"><h1>2.How-tos.</a></h1>

<p>The basic object that is always used with PCSC is a Resource
Manager (RM). It manages all connections between applications and
readers, and cards. Almost always, any communication between the
card and application is routed through the RM, then to the PCSC
reader driver, next to the driver and at the very end to the
card. </p>

<h2>2.1 How to do commmunication with a card using APDU?</h2>

<ol>
    <li>Create a Resource Manager object.</li>
    <li>Create an APDUCard ( or its descendant) object.</li>
    <li>Connect the APDUCard object to the Resource Manager,
        using ResourceManager property of APDUCard.</li>
    <li>Set the ReaderName property of APDUCard object to the
        reader in which the card resides. Alternatively, propmpt
        the user to select the reader, using SelectReader method
        of APDUCard.</li>
    <li>Connect to the card, using the Connect method of APDUCard
        object. Select type of connection - shared or exclusive
        and protocol ( most often the default card protocol). </li>
    <li>(Optional: start a transaction using Reserve method of
        APDUCard)</li>
    <li>For each command to be performed, fill the buffer Command
        with proper APDU. Call Transmit method. Read the card
        answer from the buffer Answer, and properties SW1,SW2,SW,
        IsResultError.</li>
    <li>(Mandatory if 4. has been used : end the transaction
        using Release method of APDUCard)</li>
    <li>Free the APDUCard object</li>
    <li>Free the Resource Manager object.</li>
</ol>

<h2>2.2 How to do commmunication with a card without using APDU?</h2>

<ol>
    <li>Create a Resource Manager object.</li>
    <li>Select the reader in which the card resides, using Reader
        property of ResourceManager. To determine the reader you
        can use procedure ShowSelectReader.</li>
    <li>(Optional:Wait for the user to insert the card into the
        reader using WaitForCardInsertion method of the
        SmartcardReader object returned by Reader property of
        ResourceManager)</li>
    <li>Connect to the card, using the Connect method. Select
        type of connection - shared or exclusive and protocol (
        most often the default card protocol). </li>
    <li>(Optional: start a transaction using BeginTransaction)</li>
    <li>For each command to be performed, fill SendBuffer with
        data to be sent to the card. Call Transmit method. Read
        the card answer from the buffer ReceiveBuffer. </li>
    <li>(Mandatory if 4. has been used : end the transaction
        using EndTransaction)</li>
    <li>Free the Resource Manager object. This will also free all
        reader objects created during the session.</li>
</ol>

<h2>2.3 How to monitor reader states ?</h2>

<ol>
    <li>Create a Resource Manager object.</li>
    <li>Select the readers you want to be monitored ( you may use
        Selected property, or methods SelectAllReaders,
        SelectExistingReaders, AddGroupToSelection)</li>
    <li>Set OnSelectedReadersStateChange event handler to get
        informed of state changes or call method
        WaitForSelectedReaderStateChange to check if any change
        took place.</li>
    <li>To determine which readers changed, use Changed property.
        To determine states (reader state, card state, ATR) of
        the selected readers use properties SelectedReaderState
        and ChangedReaderState, SelectedReaderATRString,
        ChangedReaderATRString.</li>
    <li>Free the Resource Manager object.</li>
</ol>

<a name="3"><h1>3.Descriptions of sample application APDU2</a></h1>

<p><strong>APDU command test</strong> can be used to send
commands to card and watch the answers. The commands sent to the
card are stored in a file for an easier reuse.</p>

<p>To form a command, enter Class, Instruction code, Parameter 1,
Parameter 2 and specific data into edit fields: CLA, INS, P1, P2,
DATA, respectively.</p>

<p>To send a command, use the <u>S</u>end button. The <u>S</u>end
button is only enabled when a card was inserted into selecter
reader and afer the card responded to reset.</p>

<p>To select reader use the <u>R</u>eader|<u>S</u>elect menu. The
<u>R</u>eader|<u>R</u>eset command can be used to reconnect to
the reader in case disconnection occurred.</p>

<p>The card will be automatically connected to after it has been
inserted into the selected reader and after it has responded to
reset.</p>

<p>Each command sent to the card is stored in repository ( the
upper left pane, see image below). To select a command from
repository, place the caret in the repository memo on the line
with the command to select. The hexadecimal values of bytes
constituting the command will be entered into proper edit fields.
</p>

<p>The repository can also be used to edit the commands. The
commands should be written as hexadecimal bytes. Text after a
semicolon <em>;</em> is treated as a comment, and when a command
is selected in the repository, it will appear in the COMMENT edit
field. If the string entered in the repository pane does not
represent a valid command ( eg. it is not a sequence of
hexadecimal values), it will be marked as red, starting from the first invalid character.</p>

<p><font color="#000000">The pane in the bottom of the form is
used to show the bytes send to the card, followed by the bytes
received from the card, and explanation of the result.</font></p>

<p><img src="HelpFiles/doc1.h10.jpg"
width="842" height="570"></p>

<a name="4"><h1>4. Known problems</a></h1>

<ol>
    <li>When under debugger in Delphi 3 or 4, the smartcard procedures can create
        exception &quot;Internal communication has
        occurred&quot;. Sample stability.dpr shows this problem.
        When running under Delphi debugger it will occasionally
        stop, as if a breakpoint has been reached. </li>
</ol>

<p>See also <A href='#prob'>comments in 1.2</A></p>

<a name="5"><h1>5. Installation of the components</a></h1>

<p>To install the package open Components\pcsc_dx.dpl, where x is your Delphi version (3,4,5 or 6).
   Click 'Install' button. The package is installed. 
   Add the path to the Components folder to the 
   search path of Delphi in /Tools/Environment Options.</p>
<p>
   For example, with Delphi 6, if the zip file was unpacked to the directory c:\pcsc\delphi, 
   then the package file is located at c:\pscs\delphi\Components\pcsc_d6.dpk. Open it with Delphi 6
   and click 'Install' in the dialog representing the package. The components are installed.
   Now open /Tools/Environment Options menu item and in the dialog that opens, 
   in'Library' tab add the path c:\pscs\delphi\Components\ to 'Library path' directories. Done.
</p>

<a name="6"><h1>6. Information on the Author</a></h1>

<p>The author, Vizvary Istvan III, can be contacted by e-mail
under adresses <a href="mailto:vizyp@poczta.onet.pl">vizyp@poczta.onet.pl</a>
.</p>

<p>The latest information on the package can be found on the page
<a href="http://vizyp.republika.pl">http://vizyp.republika.pl</a></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

</body>
</html>

⌨️ 快捷键说明

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