org.apache.servicemix.jbi.security.keystore.impl
Class BaseKeystoreManager

java.lang.Object
  extended by org.apache.servicemix.jbi.security.keystore.impl.BaseKeystoreManager
All Implemented Interfaces:
KeystoreManager

public class BaseKeystoreManager
extends Object
implements KeystoreManager


Field Summary
protected  KeystoreInstance[] keystores
           
protected  Log log
           
 
Constructor Summary
BaseKeystoreManager()
           
 
Method Summary
 SSLSocketFactory createSSLFactory(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore)
          Gets a SocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.
 SSLServerSocketFactory createSSLServerFactory(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore)
          Gets a ServerSocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.
 KeystoreInstance getKeystore(String name)
           
 KeystoreInstance[] getKeystores()
           
 void setKeystores(KeystoreInstance[] keystores)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final Log log

keystores

protected KeystoreInstance[] keystores
Constructor Detail

BaseKeystoreManager

public BaseKeystoreManager()
Method Detail

getKeystores

public KeystoreInstance[] getKeystores()
Returns:
the keystores

setKeystores

public void setKeystores(KeystoreInstance[] keystores)
Parameters:
keystores - the keystores to set

createSSLFactory

public SSLSocketFactory createSSLFactory(String provider,
                                         String protocol,
                                         String algorithm,
                                         String keyStore,
                                         String keyAlias,
                                         String trustStore)
                                  throws GeneralSecurityException
Gets a SocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.

Specified by:
createSSLFactory in interface KeystoreManager
Parameters:
provider - The SSL provider to use, or null for the default
protocol - The SSL protocol to use
algorithm - The SSL algorithm to use
keyStore - The key keystore name as provided by listKeystores. The KeystoreInstance for this keystore must be unlocked.
keyAlias - The name of the private key in the keystore. The KeystoreInstance for this keystore must have unlocked this key.
trustStore - The trust keystore name as provided by listKeystores. The KeystoreInstance for this keystore must have unlocked this key.
loader - The class loader used to resolve factory classes.
Returns:
A created SSLSocketFactory item created from the KeystoreManager.
Throws:
GeneralSecurityException
KeystoreIsLocked - Occurs when the requested key keystore cannot be used because it has not been unlocked.
KeyIsLocked - Occurs when the requested private key in the key keystore cannot be used because it has not been unlocked.
NoSuchAlgorithmException
UnrecoverableKeyException
KeyStoreException
KeyManagementException
NoSuchProviderException

createSSLServerFactory

public SSLServerSocketFactory createSSLServerFactory(String provider,
                                                     String protocol,
                                                     String algorithm,
                                                     String keyStore,
                                                     String keyAlias,
                                                     String trustStore)
                                              throws GeneralSecurityException
Gets a ServerSocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.

Specified by:
createSSLServerFactory in interface KeystoreManager
Parameters:
provider - The SSL provider to use, or null for the default
protocol - The SSL protocol to use
algorithm - The SSL algorithm to use
keyStore - The key keystore name as provided by listKeystores. The KeystoreInstance for this keystore must be unlocked.
keyAlias - The name of the private key in the keystore. The KeystoreInstance for this keystore must have unlocked this key.
trustStore - The trust keystore name as provided by listKeystores. The KeystoreInstance for this keystore must have unlocked this key.
loader - The class loader used to resolve factory classes.
Throws:
KeystoreIsLocked - Occurs when the requested key keystore cannot be used because it has not been unlocked.
KeyIsLocked - Occurs when the requested private key in the key keystore cannot be used because it has not been unlocked.
GeneralSecurityException

getKeystore

public KeystoreInstance getKeystore(String name)
Specified by:
getKeystore in interface KeystoreManager


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.