Path: blob/master/src/java.smartcardio/share/classes/javax/smartcardio/package-info.java
41153 views
/*1* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425/**26* Java™ Smart Card I/O API.27*28* This specification describes the Java Smart Card I/O API defined by29* <a href="http://jcp.org/en/jsr/detail?id=268">JSR 268</a>.30*31* It defines a Java API for communication with Smart Cards32* using ISO/IEC 7816-4 APDUs. It thereby allows Java applications to interact with33* applications running on the Smart Card, to store and retrieve data34* on the card, etc.35*36* <p>37* The API is defined by classes in the package38* {@code javax.smartcardio}. They can be classified as follows:39*40* <dl>41* <dt>Classes describing the corresponding Smart Card structures42* <dd>43* <a href="ATR.html">ATR</a>,44* <a href="CommandAPDU.html">CommandAPDU</a>,45* <a href="ResponseAPDU.html">ResponseAPDU</a>46*47* <dt>Factory to obtain implementations48* <dd>49* <a href="TerminalFactory.html">TerminalFactory</a>50*51* <dt>Main classes for card and terminal functions52* <dd>53* <a href="CardTerminals.html">CardTerminals</a>,54* <a href="CardTerminal.html">CardTerminal</a>,55* <a href="Card.html">Card</a>,56* <a href="CardChannel.html">CardChannel</a>57*58* <dt>Supporting permission and exception classes59* <dd>60* <a href="CardPermission.html">CardPermission</a>,61* <a href="CardException.html">CardException</a>,62* <a href="CardNotPresentException.html">CardNotPresentException</a>63*64* <dt>Service provider interface, not accessed directly by applications65* <dd>66* <a href="TerminalFactorySpi.html">TerminalFactorySpi</a>67*68* </dl>69*70*71* <h2>API Example</h2>72*73* A simple example of using the API is:74* <pre>75* // show the list of available terminals76* TerminalFactory factory = TerminalFactory.getDefault();77* List<CardTerminal> terminals = factory.terminals().list();78* System.out.println("Terminals: " + terminals);79* // get the first terminal80* CardTerminal terminal = terminals.get(0);81* // establish a connection with the card82* Card card = terminal.connect("T=0");83* System.out.println("card: " + card);84* CardChannel channel = card.getBasicChannel();85* ResponseAPDU r = channel.transmit(new CommandAPDU(c1));86* System.out.println("response: " + toString(r.getBytes()));87* // disconnect88* card.disconnect(false);89* </pre>90*91* @since 1.692* @author Andreas Sterbenz93* @author JSR 268 Expert Group94*/95package javax.smartcardio;969798