diff options
Diffstat (limited to 'javax/net/ssl/SSLSession.java')
-rw-r--r-- | javax/net/ssl/SSLSession.java | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/javax/net/ssl/SSLSession.java b/javax/net/ssl/SSLSession.java index 9400a1a51..c8a4785f9 100644 --- a/javax/net/ssl/SSLSession.java +++ b/javax/net/ssl/SSLSession.java @@ -38,6 +38,7 @@ exception statement from your version. */ package javax.net.ssl; +import java.security.Principal; import java.security.cert.Certificate; import javax.security.cert.X509Certificate; @@ -48,6 +49,20 @@ import javax.security.cert.X509Certificate; */ public interface SSLSession { + + /** + * Returns the size of the largest application data buffer that can + * occur in this session. + * + * <p>Buffers passed to handle the incoming data for the + * <code>unwrap</code> method of SSLEngine must be at least this + * large. + * + * @return The size of application buffers. + * @since 1.5 + */ + int getApplicationBufferSize (); + /** * Returns this session's cihper suite. * @@ -87,6 +102,28 @@ public interface SSLSession Certificate[] getLocalCertificates(); /** + * Returns the {@link Principal} representing the local identity + * used in this session, or <code>null</code> if there is no local + * identity. + * + * @return The local principal. + */ + Principal getLocalPrincipal (); + + /** + * Returns the size of the largest SSL message that will be + * generated by this session. + * + * <p>Callers of <code>wrap</code> and <code>unwrap</code> should + * use this value to determine the size of buffers for data coming + * into, or going out over, the network. + * + * @returns The maximum network packet size. + * @since 1.5 + */ + int getPacketBufferSize (); + + /** * Returns the chain of certificates that the remote side used in * the handshake, or null if none were used. * @@ -115,6 +152,27 @@ public interface SSLSession String getPeerHost(); /** + * Returns the port number the remote peer is using for this + * session. + * + * @return The peer's port number. + * @since 1.5 + */ + int getPeerPort (); + + /** + * Returns the {@link Principal} representing the identity of the + * remote peer, or <code>null</code> if the remote peer has no known + * identity. + * + * @return The remote peer's principal. + * @throws SSLPeerUnverifiedException If the remote peer's identity + * could not be verified. + * @since 1.5 + */ + Principal getPeerPrincipal () throws SSLPeerUnverifiedException; + + /** * Returns the protocol this session uses. * * @return The protocol. @@ -152,6 +210,15 @@ public interface SSLSession void invalidate(); /** + * Tells if this session is currently valid, and may be resumed. + * + * @return True if this session is valid. + * @since 1.5 + * @see #invalidate() + */ + boolean isValid (); + + /** * Binds a value to this session, with the given name. * * @param name The name to bind the object with. |