org.glite.security.trustmanager
Class ContextWrapper

java.lang.Object
  extended byorg.glite.security.trustmanager.ContextWrapper
All Implemented Interfaces:
SSLContextWrapper

public class ContextWrapper
extends java.lang.Object
implements SSLContextWrapper

DOCUMENT ME!

Version:
$Revision: 1.3.2.1 $
Author:
$author$

Field Summary
static java.lang.String CA_FILES
           
static java.lang.String CA_FILES_DEFAULT
           
static java.lang.String CA_STORE_ALIAS
           
static java.lang.String CA_STORE_FILE
           
static java.lang.String CA_STORE_PASSWD
           
static java.lang.String CA_STORE_TYPE
           
 org.glite.security.util.FileCertReader certReader
           
static java.lang.String CONF_FILE
           
 org.glite.security.util.CaseInsensitiveProperties config
           
static java.lang.String CREDENTIALS_CERT_FILE
           
static java.lang.String CREDENTIALS_KEY_FILE
           
static java.lang.String CREDENTIALS_KEY_PASSWD
           
static java.lang.String CREDENTIALS_PROXY_FILE
           
static java.lang.String CREDENTIALS_STORE_FILE
           
static java.lang.String CREDENTIALS_STORE_PASSWD
           
static java.lang.String CREDENTIALS_STORE_TYPE
           
static java.lang.String CREDENTIALS_UPDATE_INTERVAL
           
static java.lang.String CREDENTIALS_UPDATE_INTERVAL_DEAFULT
           
static java.lang.String CRL_ENABLED
           
static java.lang.String CRL_ENABLED_DEFAULT
           
static java.lang.String CRL_FILES
           
static java.lang.String CRL_REQUIRED
           
static java.lang.String CRL_REQUIRED_DEFAULT
           
static java.lang.String CRL_UPDATE_INTERVAL
           
static java.lang.String CRL_UPDATE_INTERVAL_DEFAULT
           
 java.util.Vector crls
           
 javax.net.ssl.KeyManager[] identityKeyManagers
           
static java.lang.String INT_KEYSTORE_PASSWD
           
static java.lang.String KEYSTORE_TYPE_DEFAULT
           
static java.lang.String LOG_CONF_FILE
           
static java.lang.String LOG_FILE
           
 boolean overrideExpirationCheck
          only for testing! overrides the expiration checking during the cert loading so that expired certs can be loaded to test the certificate rejection at the server end.
static java.lang.String SSL_PROTOCOL
           
static java.lang.String SSL_PROTOCOL_DEFAULT
           
static java.lang.String TIMEOUT
          timeout for connections in milliseconds
static java.lang.String TIMEOUT_DEFAULT
          timeout default 1 minute
 java.util.Vector trustAnchors
           
 CRLFileTrustManager trustManager
           
 
Constructor Summary
ContextWrapper(java.util.Properties inputConfig)
          Creates a new ContextWrapper object.
ContextWrapper(java.util.Properties inputConfig, org.bouncycastle.openssl.PasswordFinder finder)
          Creates a new instance of ContextWrapper
ContextWrapper(java.util.Properties inputConfig, java.security.cert.X509Certificate[] chain, java.security.PrivateKey key)
          Creates a new ContextWrapper object.
 
Method Summary
 javax.net.ssl.SSLContext getContext()
          DOCUMENT ME!
static long getIntervalSecs(java.lang.String intervalBlob)
          DOCUMENT ME!
 javax.net.ssl.X509KeyManager getKeyManager()
          DOCUMENT ME!
 javax.net.ssl.SSLServerSocketFactory getServerSocketFactory()
          DOCUMENT ME!
 javax.net.ssl.SSLSocketFactory getSocketFactory()
          DOCUMENT ME!
 void init(org.bouncycastle.openssl.PasswordFinder finder, java.security.cert.X509Certificate[] chain, java.security.PrivateKey key)
          DOCUMENT ME!
 void initKeyManagers(org.bouncycastle.openssl.PasswordFinder finder)
          DOCUMENT ME!
 void initKeyManagers(java.security.cert.X509Certificate[] chain, java.security.PrivateKey key)
          DOCUMENT ME!
 void loadConfig(java.util.Properties inputConfig)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREDENTIALS_PROXY_FILE

public static final java.lang.String CREDENTIALS_PROXY_FILE
See Also:
Constant Field Values

CREDENTIALS_UPDATE_INTERVAL

public static final java.lang.String CREDENTIALS_UPDATE_INTERVAL
See Also:
Constant Field Values

CREDENTIALS_CERT_FILE

public static final java.lang.String CREDENTIALS_CERT_FILE
See Also:
Constant Field Values

CREDENTIALS_KEY_FILE

public static final java.lang.String CREDENTIALS_KEY_FILE
See Also:
Constant Field Values

CREDENTIALS_KEY_PASSWD

public static final java.lang.String CREDENTIALS_KEY_PASSWD
See Also:
Constant Field Values

CREDENTIALS_STORE_FILE

public static final java.lang.String CREDENTIALS_STORE_FILE
See Also:
Constant Field Values

CREDENTIALS_STORE_TYPE

public static final java.lang.String CREDENTIALS_STORE_TYPE
See Also:
Constant Field Values

CREDENTIALS_STORE_PASSWD

public static final java.lang.String CREDENTIALS_STORE_PASSWD
See Also:
Constant Field Values

CA_FILES

public static final java.lang.String CA_FILES
See Also:
Constant Field Values

CA_STORE_FILE

public static final java.lang.String CA_STORE_FILE
See Also:
Constant Field Values

CA_STORE_TYPE

public static final java.lang.String CA_STORE_TYPE
See Also:
Constant Field Values

CA_STORE_PASSWD

public static final java.lang.String CA_STORE_PASSWD
See Also:
Constant Field Values

CA_STORE_ALIAS

public static final java.lang.String CA_STORE_ALIAS
See Also:
Constant Field Values

CRL_FILES

public static final java.lang.String CRL_FILES
See Also:
Constant Field Values

CRL_ENABLED

public static final java.lang.String CRL_ENABLED
See Also:
Constant Field Values

CRL_REQUIRED

public static final java.lang.String CRL_REQUIRED
See Also:
Constant Field Values

CRL_UPDATE_INTERVAL

public static final java.lang.String CRL_UPDATE_INTERVAL
See Also:
Constant Field Values

LOG_CONF_FILE

public static final java.lang.String LOG_CONF_FILE
See Also:
Constant Field Values

LOG_FILE

public static final java.lang.String LOG_FILE
See Also:
Constant Field Values

SSL_PROTOCOL

public static final java.lang.String SSL_PROTOCOL
See Also:
Constant Field Values

CONF_FILE

public static final java.lang.String CONF_FILE
See Also:
Constant Field Values

TIMEOUT

public static final java.lang.String TIMEOUT
timeout for connections in milliseconds

See Also:
Constant Field Values

KEYSTORE_TYPE_DEFAULT

public static final java.lang.String KEYSTORE_TYPE_DEFAULT
See Also:
Constant Field Values

CRL_UPDATE_INTERVAL_DEFAULT

public static final java.lang.String CRL_UPDATE_INTERVAL_DEFAULT
See Also:
Constant Field Values

CRL_REQUIRED_DEFAULT

public static final java.lang.String CRL_REQUIRED_DEFAULT
See Also:
Constant Field Values

SSL_PROTOCOL_DEFAULT

public static final java.lang.String SSL_PROTOCOL_DEFAULT
See Also:
Constant Field Values

CRL_ENABLED_DEFAULT

public static final java.lang.String CRL_ENABLED_DEFAULT
See Also:
Constant Field Values

CREDENTIALS_UPDATE_INTERVAL_DEAFULT

public static final java.lang.String CREDENTIALS_UPDATE_INTERVAL_DEAFULT
See Also:
Constant Field Values

CA_FILES_DEFAULT

public static final java.lang.String CA_FILES_DEFAULT
See Also:
Constant Field Values

TIMEOUT_DEFAULT

public static final java.lang.String TIMEOUT_DEFAULT
timeout default 1 minute

See Also:
Constant Field Values

INT_KEYSTORE_PASSWD

public static final java.lang.String INT_KEYSTORE_PASSWD
See Also:
Constant Field Values

config

public org.glite.security.util.CaseInsensitiveProperties config

identityKeyManagers

public javax.net.ssl.KeyManager[] identityKeyManagers

trustAnchors

public java.util.Vector trustAnchors

crls

public java.util.Vector crls

certReader

public org.glite.security.util.FileCertReader certReader

trustManager

public CRLFileTrustManager trustManager

overrideExpirationCheck

public boolean overrideExpirationCheck
only for testing! overrides the expiration checking during the cert loading so that expired certs can be loaded to test the certificate rejection at the server end.

Constructor Detail

ContextWrapper

public ContextWrapper(java.util.Properties inputConfig)
               throws java.io.FileNotFoundException,
                      java.io.IOException,
                      java.security.cert.CertificateException,
                      java.security.NoSuchAlgorithmException,
                      java.security.NoSuchProviderException,
                      java.lang.Exception
Creates a new ContextWrapper object.

Parameters:
inputConfig - DOCUMENT ME!
Throws:
java.io.FileNotFoundException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
java.security.cert.CertificateException - DOCUMENT ME!
java.security.NoSuchAlgorithmException - DOCUMENT ME!
java.security.NoSuchProviderException - DOCUMENT ME!
java.lang.Exception - DOCUMENT ME!

ContextWrapper

public ContextWrapper(java.util.Properties inputConfig,
                      java.security.cert.X509Certificate[] chain,
                      java.security.PrivateKey key)
               throws java.lang.Exception
Creates a new ContextWrapper object.

Parameters:
inputConfig - DOCUMENT ME!
chain - DOCUMENT ME!
key - DOCUMENT ME!
Throws:
java.lang.Exception - DOCUMENT ME!

ContextWrapper

public ContextWrapper(java.util.Properties inputConfig,
                      org.bouncycastle.openssl.PasswordFinder finder)
               throws java.lang.Exception
Creates a new instance of ContextWrapper

Method Detail

loadConfig

public void loadConfig(java.util.Properties inputConfig)
                throws java.io.FileNotFoundException,
                       java.io.IOException
DOCUMENT ME!

Parameters:
inputConfig - DOCUMENT ME!
Throws:
java.io.FileNotFoundException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!

getContext

public javax.net.ssl.SSLContext getContext()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getServerSocketFactory

public javax.net.ssl.SSLServerSocketFactory getServerSocketFactory()
                                                            throws javax.net.ssl.SSLException
Description copied from interface: SSLContextWrapper
DOCUMENT ME!

Specified by:
getServerSocketFactory in interface SSLContextWrapper
Returns:
DOCUMENT ME!
Throws:
javax.net.ssl.SSLException - DOCUMENT ME!

getSocketFactory

public javax.net.ssl.SSLSocketFactory getSocketFactory()
                                                throws javax.net.ssl.SSLException
DOCUMENT ME!

Specified by:
getSocketFactory in interface SSLContextWrapper
Returns:
DOCUMENT ME!
Throws:
javax.net.ssl.SSLException - DOCUMENT ME!

init

public void init(org.bouncycastle.openssl.PasswordFinder finder,
                 java.security.cert.X509Certificate[] chain,
                 java.security.PrivateKey key)
          throws java.security.cert.CertificateException,
                 java.security.NoSuchAlgorithmException,
                 java.security.NoSuchProviderException,
                 java.lang.Exception
DOCUMENT ME!

Parameters:
finder - DOCUMENT ME!
chain - DOCUMENT ME!
key - DOCUMENT ME!
Throws:
java.security.cert.CertificateException - DOCUMENT ME!
java.security.NoSuchAlgorithmException - DOCUMENT ME!
java.security.NoSuchProviderException - DOCUMENT ME!
java.lang.Exception - DOCUMENT ME!

initKeyManagers

public void initKeyManagers(org.bouncycastle.openssl.PasswordFinder finder)
                     throws java.security.cert.CertificateException,
                            java.security.NoSuchAlgorithmException
DOCUMENT ME!

Parameters:
finder - DOCUMENT ME!
Throws:
java.security.cert.CertificateException - DOCUMENT ME!
java.security.NoSuchAlgorithmException - DOCUMENT ME!

initKeyManagers

public void initKeyManagers(java.security.cert.X509Certificate[] chain,
                            java.security.PrivateKey key)
                     throws java.lang.Exception
DOCUMENT ME!

Parameters:
chain - DOCUMENT ME!
key - DOCUMENT ME!
Throws:
java.lang.Exception - DOCUMENT ME!

getIntervalSecs

public static long getIntervalSecs(java.lang.String intervalBlob)
DOCUMENT ME!

Parameters:
intervalBlob - DOCUMENT ME!
Returns:
DOCUMENT ME!

getKeyManager

public javax.net.ssl.X509KeyManager getKeyManager()
DOCUMENT ME!

Returns:
DOCUMENT ME!