org.xlattice.crypto.tls
Class TlsContext

java.lang.Object
  extended by org.xlattice.crypto.tls.TlsContext
All Implemented Interfaces:
TlsConst

public class TlsContext
extends java.lang.Object
implements TlsConst

There will normally be one and only one TlsContext associated with an XLattice program invocation. Usually it contains information used by all SSL/TLS connections and normally there will be many such connections. The TlsContext holds a String specifying the TLS/SSL protocol; a SecureRandom instance; one or more private keys (zero or more of which may be used by any session); and a KeyManagerFactory. The TlsContext will also have at least one authentication level, the interpretation of which is still not settled. At least initially this will be a 32-bit integer interpreted as a bit field. Note that we need to be able to specify an authorization level or client connections and another for server connections. The TlsSession holds zero or more peer public keys; a TrustManagerFactory; an ephemeral JSSE SSLContext; and a JSSE SSLSession, which allows us to resume the TlsSession. It also has an authentication level member characterizing the connection. An XLattice Node will have a single TlsContext and typically many TlsSessions.

Author:
Jim Dixon

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.xlattice.crypto.tls.TlsConst
TlsConst.EngineStates
 
Field Summary
(package private)  java.lang.String hostHint
          host name used for this end of the connection
(package private)  javax.net.ssl.KeyManager[] keyManagers
          decides how to respond to authentication requests
(package private)  int level
          authentication level
(package private)  java.security.KeyStore myKeyStore
           
(package private)  java.lang.String myKSName
          private key store
(package private)  char[] myPassphrase
           
(package private)  int portHint
           
(package private)  java.lang.String proto
          SSL, TLS, etc
(package private)  java.security.SecureRandom rng
           
 
Fields inherited from interface org.xlattice.crypto.tls.TlsConst
ANONYMOUS_TLS, ANY_CERT, ANY_CLIENT_CERT, ANY_SERVER_CERT, CA_SIGNED_CERT, CA_SIGNED_CLIENT_CERT, CA_SIGNED_SERVER_CERT, CLIENT_MASK, CLIENT_SHIFT, KNOWN_CERT, KNOWN_CLIENT_CERT, KNOWN_SERVER_CERT, LEARN_CERT, LEARN_CLIENT_CERT, LEARN_SERVER_CERT, SERVER_MASK, SERVER_SHIFT, TLS_ANONYMOUS_CIPHERS, TRUST_ANYONE
 
Constructor Summary
TlsContext(java.lang.String proto, int level, java.lang.String myKSName, char[] myPassphrase, java.security.SecureRandom rng, java.lang.String hostHint, int portHint)
          Parameter checking is done by the TlsEngine.
 
Method Summary
 java.lang.String getHostHint()
          host name used for this end of the connection
 javax.net.ssl.KeyManager[] getKeyManagers()
           
 java.security.KeyStore getKeyStore()
          private key store
 int getLevel()
          authentication level
 int getPortHint()
           
 java.lang.String getProtocol()
          SSL, TLS, etc
 java.security.SecureRandom getRNG()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

proto

final java.lang.String proto
SSL, TLS, etc


level

final int level
authentication level


myKSName

final java.lang.String myKSName
private key store


myKeyStore

final java.security.KeyStore myKeyStore

myPassphrase

final char[] myPassphrase

rng

final java.security.SecureRandom rng

hostHint

final java.lang.String hostHint
host name used for this end of the connection


portHint

final int portHint

keyManagers

final javax.net.ssl.KeyManager[] keyManagers
decides how to respond to authentication requests

Constructor Detail

TlsContext

public TlsContext(java.lang.String proto,
                  int level,
                  java.lang.String myKSName,
                  char[] myPassphrase,
                  java.security.SecureRandom rng,
                  java.lang.String hostHint,
                  int portHint)
           throws java.io.IOException,
                  java.security.GeneralSecurityException
Parameter checking is done by the TlsEngine.

Throws:
java.io.IOException
java.security.GeneralSecurityException
Method Detail

getKeyManagers

public javax.net.ssl.KeyManager[] getKeyManagers()

getLevel

public int getLevel()
authentication level


getProtocol

public java.lang.String getProtocol()
SSL, TLS, etc


getKeyStore

public java.security.KeyStore getKeyStore()
private key store


getRNG

public java.security.SecureRandom getRNG()

getHostHint

public java.lang.String getHostHint()
host name used for this end of the connection


getPortHint

public int getPortHint()