jdk/src/share/classes/javax/smartcardio/package.html
author never
Mon, 12 Jul 2010 22:27:18 -0700
changeset 5926 a36f90d986b6
parent 5506 202f599c92aa
permissions -rw-r--r--
6968385: malformed xml in sweeper logging Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
<!--
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
-->
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
<html>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
<body>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
<h2>Java&#x2122; Smart Card I/O API</h2>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
This specification describes the Java Smart Card I/O API defined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
<a href="http://jcp.org/en/jsr/detail?id=268">JSR 268</a>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
It defines a Java API for communication with Smart Cards
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
using ISO/IEC 7816-4 APDUs. It thereby allows Java applications to interact with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
applications running on the Smart Card, to store and retrieve data 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
on the card, etc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
The API is defined by classes in the package
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
<code>javax.smartcardio</code>. They can be classified as follows:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
<dl>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
<dt>Classes describing the corresponding Smart Card structures 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
<dd>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
<a href="ATR.html">ATR</a>, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
<a href="CommandAPDU.html">CommandAPDU</a>, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
<a href="ResponseAPDU.html">ResponseAPDU</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
<dt>Factory to obtain implementations
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
<dd>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
<a href="TerminalFactory.html">TerminalFactory</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
<dt>Main classes for card and terminal functions
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
<dd>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
<a href="CardTerminals.html">CardTerminals</a>, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
<a href="CardTerminal.html">CardTerminal</a>, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
<a href="Card.html">Card</a>, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
<a href="CardChannel.html">CardChannel</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
<dt>Supporting permission and exception classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
<dd>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
<a href="CardPermission.html">CardPermission</a>, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
<a href="CardException.html">CardException</a>, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
<a href="CardNotPresentException.html">CardNotPresentException</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
<dt>Service provider interface, not accessed directly by applications 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
<dd>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
<a href="TerminalFactorySpi.html">TerminalFactorySpi</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
</dl>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
<h3>API Example</h3>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
A simple example of using the API is:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
<pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
	// show the list of available terminals
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
	TerminalFactory factory = TerminalFactory.getDefault();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
	List&lt;CardTerminal&gt; terminals = factory.terminals().list();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
	System.out.println("Terminals: " + terminals);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
	// get the first terminal
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
	CardTerminal terminal = terminals.get(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
	// establish a connection with the card
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
	Card card = terminal.connect("T=0");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
	System.out.println("card: " + card);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
	CardChannel channel = card.getBasicChannel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
	ResponseAPDU r = channel.transmit(new CommandAPDU(c1));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
	System.out.println("response: " + toString(r.getBytes()));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
	// disconnect
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
	card.disconnect(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
</pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
@since   1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
@author  Andreas Sterbenz
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
@author  JSR 268 Expert Group
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
</body>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
</html>