package.html revision 2362
0N/A<!--
1472N/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
0N/A published by the Free Software Foundation. Oracle designates this
0N/A particular file as subject to the "Classpath" exception as provided
0N/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,
1472N/A Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1472N/A
1472N/A Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0N/A or visit www.oracle.com if you need additional information or have any
0N/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>
<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>