Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.javax.net.ssl.provider
Class Session  view Session download Session.java

java.lang.Object
  extended bygnu.javax.net.ssl.provider.Session
All Implemented Interfaces:
javax.net.ssl.SSLSession

final class Session
extends java.lang.Object
implements javax.net.ssl.SSLSession

A generic SSL session implementation for SSL and TLS.


Nested Class Summary
(package private) static class Session.ID
          A byte array with appropriate equals(), hashCode(), and compareTo() semantics.
 
Field Summary
(package private)  CipherSuite cipherSuite
           
(package private)  SessionContext context
           
private  long creationTime
           
(package private)  Alert currentAlert
           
(package private)  java.util.SortedSet enabledProtocols
           
(package private)  java.util.List enabledSuites
           
private static javax.net.ssl.SSLPermission GET_SESSION_CONTEXT_PERMISSION
           
(package private)  javax.net.ssl.X509KeyManager keyManager
           
private  java.util.Date lastAccessedTime
           
(package private)  java.security.cert.Certificate[] localCerts
           
(package private)  byte[] masterSecret
           
(package private)  SecurityParameters params
           
(package private)  javax.security.cert.X509Certificate[] peerCertChain
           
(package private)  java.security.cert.Certificate[] peerCerts
           
(package private)  java.lang.String peerHost
           
(package private)  boolean peerVerified
           
(package private)  ProtocolVersion protocol
           
(package private)  java.security.SecureRandom random
           
(package private)  Session.ID sessionId
           
(package private)  gnu.javax.net.ssl.SRPTrustManager srpTrustManager
           
(package private)  javax.net.ssl.X509TrustManager trustManager
           
(package private)  boolean valid
           
(package private)  java.util.HashMap values
           
 
Constructor Summary
(package private) Session()
           
(package private) Session(long creationTime)
           
 
Method Summary
(package private)  void access()
           
protected  java.lang.Object clone()
          This method may be called to create a new copy of the Object.
 java.lang.String getCipherSuite()
          Returns this session's cihper suite.
 long getCreationTime()
          Returns the time in milliseconds since midnight GMT, 1 January 1970, that this session was created.
 byte[] getId()
          Returns this session's unique identifier, a arbitrary byte array of up to 32 bytes.
 long getLastAccessedTime()
          Returns the last time this session was accessed.
 java.security.cert.Certificate[] getLocalCertificates()
          Returns the chain of certificates that the local side used in the handshake, or null if none were used.
 javax.security.cert.X509Certificate[] getPeerCertificateChain()
          Returns the chain of certificates that the remote side used in the handshake, or null if none were used.
 java.security.cert.Certificate[] getPeerCertificates()
          Returns the chain of certificates that the remote side used in the handshake, or null if none were used.
 java.lang.String getPeerHost()
          Returns the remote host's name.
 java.lang.String getProtocol()
          Returns the protocol this session uses.
 javax.net.ssl.SSLSessionContext getSessionContext()
          Returns this session's session context object.
 java.lang.Object getValue(java.lang.String name)
          Returns the object bound to the given name.
 java.lang.String[] getValueNames()
          Returns the names of all values bound to this session.
 void invalidate()
          Invalidates this session, ensuring that it will not be continued by another socket.
 void putValue(java.lang.String name, java.lang.Object value)
          Binds a value to this session, with the given name.
 void removeValue(java.lang.String name)
          Un-binds a value.
(package private)  void setLastAccessedTime(long lastAccessedTime)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GET_SESSION_CONTEXT_PERMISSION

private static final javax.net.ssl.SSLPermission GET_SESSION_CONTEXT_PERMISSION

creationTime

private final long creationTime

lastAccessedTime

private java.util.Date lastAccessedTime

sessionId

Session.ID sessionId

localCerts

java.security.cert.Certificate[] localCerts

peerCerts

java.security.cert.Certificate[] peerCerts

peerCertChain

javax.security.cert.X509Certificate[] peerCertChain

peerHost

java.lang.String peerHost

peerVerified

boolean peerVerified

context

SessionContext context

values

java.util.HashMap values

valid

boolean valid

enabledSuites

java.util.List enabledSuites

cipherSuite

CipherSuite cipherSuite

enabledProtocols

java.util.SortedSet enabledProtocols

protocol

ProtocolVersion protocol

masterSecret

byte[] masterSecret

srpTrustManager

gnu.javax.net.ssl.SRPTrustManager srpTrustManager

trustManager

javax.net.ssl.X509TrustManager trustManager

keyManager

javax.net.ssl.X509KeyManager keyManager

random

java.security.SecureRandom random

params

SecurityParameters params

currentAlert

Alert currentAlert
Constructor Detail

Session

Session()

Session

Session(long creationTime)
Method Detail

clone

protected java.lang.Object clone()
Description copied from class: java.lang.Object
This method may be called to create a new copy of the Object. The typical behavior is as follows:
  • o == o.clone() is false
  • o.getClass() == o.clone().getClass() is true
  • o.equals(o) is true

However, these are not strict requirements, and may be violated if necessary. Of the three requirements, the last is the most commonly violated, particularly if the subclass does not override Object.equals(Object)>Object.equals(Object) 55 .

If the Object you call clone() on does not implement java.lang.Cloneable (which is a placeholder interface), then a CloneNotSupportedException is thrown. Notice that Object does not implement Cloneable; this method exists as a convenience for subclasses that do.

Object's implementation of clone allocates space for the new Object using the correct class, without calling any constructors, and then fills in all of the new field values with the old field values. Thus, it is a shallow copy. However, subclasses are permitted to make a deep copy.

All array types implement Cloneable, and override this method as follows (it should never fail):

 public Object clone()
 {
   try
     {
       super.clone();
     }
   catch (CloneNotSupportedException e)
     {
       throw new InternalError(e.getMessage());
     }
 }
 


getCipherSuite

public java.lang.String getCipherSuite()
Description copied from interface: javax.net.ssl.SSLSession
Returns this session's cihper suite.

Specified by:
getCipherSuite in interface javax.net.ssl.SSLSession

getCreationTime

public long getCreationTime()
Description copied from interface: javax.net.ssl.SSLSession
Returns the time in milliseconds since midnight GMT, 1 January 1970, that this session was created.

Specified by:
getCreationTime in interface javax.net.ssl.SSLSession

getId

public byte[] getId()
Description copied from interface: javax.net.ssl.SSLSession
Returns this session's unique identifier, a arbitrary byte array of up to 32 bytes.

Specified by:
getId in interface javax.net.ssl.SSLSession

getLastAccessedTime

public long getLastAccessedTime()
Description copied from interface: javax.net.ssl.SSLSession
Returns the last time this session was accessed.

Specified by:
getLastAccessedTime in interface javax.net.ssl.SSLSession

getLocalCertificates

public java.security.cert.Certificate[] getLocalCertificates()
Description copied from interface: javax.net.ssl.SSLSession
Returns the chain of certificates that the local side used in the handshake, or null if none were used.

Specified by:
getLocalCertificates in interface javax.net.ssl.SSLSession

getPeerCertificates

public java.security.cert.Certificate[] getPeerCertificates()
                                                     throws javax.net.ssl.SSLPeerUnverifiedException
Description copied from interface: javax.net.ssl.SSLSession
Returns the chain of certificates that the remote side used in the handshake, or null if none were used.

Specified by:
getPeerCertificates in interface javax.net.ssl.SSLSession

getPeerCertificateChain

public javax.security.cert.X509Certificate[] getPeerCertificateChain()
                                                              throws javax.net.ssl.SSLPeerUnverifiedException
Description copied from interface: javax.net.ssl.SSLSession
Returns the chain of certificates that the remote side used in the handshake, or null if none were used.

Specified by:
getPeerCertificateChain in interface javax.net.ssl.SSLSession

getPeerHost

public java.lang.String getPeerHost()
Description copied from interface: javax.net.ssl.SSLSession
Returns the remote host's name.

Specified by:
getPeerHost in interface javax.net.ssl.SSLSession

getProtocol

public java.lang.String getProtocol()
Description copied from interface: javax.net.ssl.SSLSession
Returns the protocol this session uses.

Specified by:
getProtocol in interface javax.net.ssl.SSLSession

getSessionContext

public javax.net.ssl.SSLSessionContext getSessionContext()
Description copied from interface: javax.net.ssl.SSLSession
Returns this session's session context object.

Specified by:
getSessionContext in interface javax.net.ssl.SSLSession

getValueNames

public java.lang.String[] getValueNames()
Description copied from interface: javax.net.ssl.SSLSession
Returns the names of all values bound to this session.

Specified by:
getValueNames in interface javax.net.ssl.SSLSession

getValue

public java.lang.Object getValue(java.lang.String name)
Description copied from interface: javax.net.ssl.SSLSession
Returns the object bound to the given name.

Specified by:
getValue in interface javax.net.ssl.SSLSession

putValue

public void putValue(java.lang.String name,
                     java.lang.Object value)
Description copied from interface: javax.net.ssl.SSLSession
Binds a value to this session, with the given name.

Specified by:
putValue in interface javax.net.ssl.SSLSession

removeValue

public void removeValue(java.lang.String name)
Description copied from interface: javax.net.ssl.SSLSession
Un-binds a value.

Specified by:
removeValue in interface javax.net.ssl.SSLSession

invalidate

public void invalidate()
Description copied from interface: javax.net.ssl.SSLSession
Invalidates this session, ensuring that it will not be continued by another socket.

Specified by:
invalidate in interface javax.net.ssl.SSLSession

access

void access()

setLastAccessedTime

void setLastAccessedTime(long lastAccessedTime)