package.html revision 0
2521N/A<!--
2521N/A Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
2521N/A DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2521N/A
2521N/A This code is free software; you can redistribute it and/or modify it
2521N/A under the terms of the GNU General Public License version 2 only, as
2521N/A published by the Free Software Foundation. Sun designates this
2521N/A particular file as subject to the "Classpath" exception as provided
2521N/A by Sun in the LICENSE file that accompanied this code.
2521N/A
2521N/A This code is distributed in the hope that it will be useful, but WITHOUT
2521N/A ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2521N/A FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2521N/A version 2 for more details (a copy is included in the LICENSE file that
2521N/A accompanied this code).
2521N/A
2521N/A You should have received a copy of the GNU General Public License version
2521N/A 2 along with this work; if not, write to the Free Software Foundation,
2521N/A Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2521N/A
2521N/A Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
2521N/A CA 95054 USA or visit www.sun.com if you need additional information or
2521N/A have any questions.
2521N/A-->
2521N/A
2521N/A<html>
2521N/A<body>
2892N/A<h2>Java&#x2122; Smart Card I/O API</h2>
2892N/A
2521N/AThis specification describes the Java Smart Card I/O API defined by
2521N/A<a href="http://jcp.org/en/jsr/detail?id=268">JSR 268</a>.
2521N/A
2892N/AIt defines a Java API for communication with Smart Cards
2521N/Ausing ISO/IEC 7816-4 APDUs. It thereby allows Java applications to interact with
2521N/Aapplications running on the Smart Card, to store and retrieve data
2521N/Aon the card, etc.
2521N/A
2521N/A<p>
2521N/AThe API is defined by classes in the package
2521N/A<code>javax.smartcardio</code>. They can be classified as follows:
2521N/A
2521N/A<dl>
2521N/A<dt>Classes describing the corresponding Smart Card structures
2521N/A<dd>
2521N/A<a href="ATR.html">ATR</a>,
2521N/A<a href="CommandAPDU.html">CommandAPDU</a>,
2521N/A<a href="ResponseAPDU.html">ResponseAPDU</a>
2521N/A
2521N/A<p>
2521N/A<dt>Factory to obtain implementations
2521N/A<dd>
2521N/A<a href="TerminalFactory.html">TerminalFactory</a>
2521N/A
2521N/A<p>
2521N/A<dt>Main classes for card and terminal functions
2521N/A<dd>
2521N/A<a href="CardTerminals.html">CardTerminals</a>,
2521N/A<a href="CardTerminal.html">CardTerminal</a>,
2521N/A<a href="Card.html">Card</a>,
2521N/A<a href="CardChannel.html">CardChannel</a>
2521N/A
2521N/A<p>
2892N/A<dt>Supporting permission and exception classes
2892N/A<dd>
2892N/A<a href="CardPermission.html">CardPermission</a>,
2892N/A<a href="CardException.html">CardException</a>,
2892N/A<a href="CardNotPresentException.html">CardNotPresentException</a>
2892N/A
2892N/A<p>
2521N/A<dt>Service provider interface, not accessed directly by applications
2521N/A<dd>
2521N/A<a href="TerminalFactorySpi.html">TerminalFactorySpi</a>
2521N/A
2521N/A</dl>
2521N/A
2521N/A
2521N/A<h3>API Example</h3>
2521N/A
2521N/AA simple example of using the API is:
2521N/A<pre>
2521N/A // 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>