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