6033N/A<!--
6033N/A Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
6033N/A DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6033N/A
6033N/A This code is free software; you can redistribute it and/or modify it
6033N/A under the terms of the GNU General Public License version 2 only, as
6033N/A published by the Free Software Foundation. Oracle designates this
6033N/A particular file as subject to the "Classpath" exception as provided
6033N/A by Oracle in the LICENSE file that accompanied this code.
6033N/A
6033N/A This code is distributed in the hope that it will be useful, but WITHOUT
6033N/A ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6033N/A FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6033N/A version 2 for more details (a copy is included in the LICENSE file that
6033N/A accompanied this code).
6033N/A
6033N/A You should have received a copy of the GNU General Public License version
6033N/A 2 along with this work; if not, write to the Free Software Foundation,
6033N/A Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6033N/A
6033N/A Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6033N/A or visit www.oracle.com if you need additional information or have any
6033N/A questions.
6033N/A-->
6033N/A
6033N/A<html>
6033N/A<body>
6033N/A<h2>Java&#x2122; Smart Card I/O API</h2>
6033N/A
6033N/AThis specification describes the Java Smart Card I/O API defined by
6033N/A<a href="http://jcp.org/en/jsr/detail?id=268">JSR 268</a>.
6033N/A
6033N/AIt defines a Java API for communication with Smart Cards
6033N/Ausing ISO/IEC 7816-4 APDUs. It thereby allows Java applications to interact with
6033N/Aapplications running on the Smart Card, to store and retrieve data
6033N/Aon the card, etc.
6033N/A
6033N/A<p>
6033N/AThe API is defined by classes in the package
6033N/A<code>javax.smartcardio</code>. They can be classified as follows:
6033N/A
6033N/A<dl>
6033N/A<dt>Classes describing the corresponding Smart Card structures
6033N/A<dd>
6033N/A<a href="ATR.html">ATR</a>,
6033N/A<a href="CommandAPDU.html">CommandAPDU</a>,
6033N/A<a href="ResponseAPDU.html">ResponseAPDU</a>
6033N/A
6033N/A<p>
6033N/A<dt>Factory to obtain implementations
6033N/A<dd>
6033N/A<a href="TerminalFactory.html">TerminalFactory</a>
6033N/A
<p>
<dt>Main classes for card and terminal functions
<dd>
<a href="CardTerminals.html">CardTerminals</a>,
<a href="CardTerminal.html">CardTerminal</a>,
<a href="Card.html">Card</a>,
<a href="CardChannel.html">CardChannel</a>
<p>
<dt>Supporting permission and exception classes
<dd>
<a href="CardPermission.html">CardPermission</a>,
<a href="CardException.html">CardException</a>,
<a href="CardNotPresentException.html">CardNotPresentException</a>
<p>
<dt>Service provider interface, not accessed directly by applications
<dd>
<a href="TerminalFactorySpi.html">TerminalFactorySpi</a>
</dl>
<h3>API Example</h3>
A simple example of using the API is:
<pre>
// show the list of available terminals
TerminalFactory factory = TerminalFactory.getDefault();
List&lt;CardTerminal&gt; terminals = factory.terminals().list();
System.out.println("Terminals: " + terminals);
// get the first terminal
CardTerminal terminal = terminals.get(0);
// establish a connection with the card
Card card = terminal.connect("T=0");
System.out.println("card: " + card);
CardChannel channel = card.getBasicChannel();
ResponseAPDU r = channel.transmit(new CommandAPDU(c1));
System.out.println("response: " + toString(r.getBytes()));
// disconnect
card.disconnect(false);
</pre>
<P>
@since 1.6
@author Andreas Sterbenz
@author JSR 268 Expert Group
</body>
</html>