1 /* SSLSession.java -- an SSL session.
2 Copyright (C) 2004 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package javax
.net
.ssl
;
41 import java
.security
.cert
.Certificate
;
43 import javax
.security
.cert
.X509Certificate
;
46 * An SSL session is a mechanism through which connections can be established
47 * by re-using previously negotiated handshakes.
49 public interface SSLSession
52 * Returns this session's cihper suite.
54 * @return The cipher suite.
56 String
getCipherSuite();
59 * Returns the time in milliseconds since midnight GMT, 1 January 1970, that
60 * this session was created.
62 * @return The creation time.
64 long getCreationTime();
67 * Returns this session's unique identifier, a arbitrary byte array of up
70 * @return The session identifier.
75 * Returns the last time this session was accessed.
77 * @return The lest time this session was accessed.
79 long getLastAccessedTime();
82 * Returns the chain of certificates that the local side used in the
83 * handshake, or null if none were used.
85 * @return The local certificate chain.
87 Certificate
[] getLocalCertificates();
90 * Returns the chain of certificates that the remote side used in
91 * the handshake, or null if none were used.
93 * @return The peer's certificate chain.
94 * @throws SSLPeerUnverifiedException If the identity of the peer has
97 Certificate
[] getPeerCertificates() throws SSLPeerUnverifiedException
;
100 * Returns the chain of certificates that the remote side used in
101 * the handshake, or null if none were used.
103 * @return The peer's certificate chain.
104 * @throws SSLPeerUnverifiedException If the identity of the peer has
107 X509Certificate
[] getPeerCertificateChain()
108 throws SSLPeerUnverifiedException
;
111 * Returns the remote host's name.
113 * @return The name of the remote host.
115 String
getPeerHost();
118 * Returns the protocol this session uses.
120 * @return The protocol.
122 String
getProtocol();
125 * Returns this session's session context object.
127 * @return The session context.
128 * @throws SecurityException If the caller does not have the
129 * {@link SSLPermission} "getSessionContext".
131 SSLSessionContext
getSessionContext();
134 * Returns the names of all values bound to this session.
136 * @return The list of bound names.
138 String
[] getValueNames();
141 * Returns the object bound to the given name.
143 * @param name The name of the value to get.
144 * @return The object bound by that name, or null.
146 Object
getValue(String name
);
149 * Invalidates this session, ensuring that it will not be continued by
155 * Binds a value to this session, with the given name.
157 * @param name The name to bind the object with.
158 * @param value The value to bind.
160 void putValue(String name
, Object value
);
165 * @param name The name of the value to un-bind.
167 void removeValue(String name
);