org.apache.geronimo.management.geronimo
Interface KeystoreManager


public interface KeystoreManager

Management interface for working with keystores. Mostly this is used to identify KeystoreInstances to work with individual keystores.

Version:
$Rev: 409817 $ $Date: 2006-05-27 09:56:38 +0200 (Sat, 27 May 2006) $
See Also:
KeystoreInstance

Method Summary
 KeystoreInstance createKeystore(String name, char[] password)
          Creates a new, empty keystore.
 SSLSocketFactory createSSLFactory(String provider, String protocol, String algorithm, String trustStore, ClassLoader loader)
          Gets a SocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.
 SSLSocketFactory createSSLFactory(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore, ClassLoader loader)
          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, ClassLoader loader)
          Gets a ServerSocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.
 KeystoreInstance[] getKeystores()
          Gets the names of the keystores available in the server.
 KeystoreInstance[] getUnlockedKeyStores()
          Gets the aliases for any keystores that are available to be used as private key keystores for an SSL factory.
 KeystoreInstance[] getUnlockedTrustStores()
          Gets the aliases for any keystores that are available to be used as trusted certificate keystores for an SSL factory.
 

Method Detail

getKeystores

public KeystoreInstance[] getKeystores()
Gets the names of the keystores available in the server.


createSSLServerFactory

public SSLServerSocketFactory createSSLServerFactory(String provider,
                                                     String protocol,
                                                     String algorithm,
                                                     String keyStore,
                                                     String keyAlias,
                                                     String trustStore,
                                                     ClassLoader loader)
                                              throws KeystoreIsLocked,
                                                     KeyIsLocked,
                                                     NoSuchAlgorithmException,
                                                     UnrecoverableKeyException,
                                                     KeyStoreException,
                                                     KeyManagementException,
                                                     NoSuchProviderException
Gets a ServerSocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.

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.
NoSuchAlgorithmException
UnrecoverableKeyException
KeyStoreException
KeyManagementException
NoSuchProviderException

createSSLFactory

public SSLSocketFactory createSSLFactory(String provider,
                                         String protocol,
                                         String algorithm,
                                         String keyStore,
                                         String keyAlias,
                                         String trustStore,
                                         ClassLoader loader)
                                  throws KeystoreIsLocked,
                                         KeyIsLocked,
                                         NoSuchAlgorithmException,
                                         UnrecoverableKeyException,
                                         KeyStoreException,
                                         KeyManagementException,
                                         NoSuchProviderException
Gets a SocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.

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.
NoSuchAlgorithmException
UnrecoverableKeyException
KeyStoreException
KeyManagementException
NoSuchProviderException

createSSLFactory

public SSLSocketFactory createSSLFactory(String provider,
                                         String protocol,
                                         String algorithm,
                                         String trustStore,
                                         ClassLoader loader)
                                  throws KeystoreIsLocked,
                                         KeyIsLocked,
                                         NoSuchAlgorithmException,
                                         UnrecoverableKeyException,
                                         KeyStoreException,
                                         KeyManagementException,
                                         NoSuchProviderException
Gets a SocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.

Parameters:
provider - The SSL provider to use, or null for the default
protocol - The SSL protocol to use
algorithm - The SSL algorithm to use
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.
NoSuchAlgorithmException
UnrecoverableKeyException
KeyStoreException
KeyManagementException
NoSuchProviderException

createKeystore

public KeystoreInstance createKeystore(String name,
                                       char[] password)
Creates a new, empty keystore. The name should be a valid file name with no path separator characters.

Parameters:
name - The name of the keystore to create
password - The password to use to protect the new keystore

getUnlockedKeyStores

public KeystoreInstance[] getUnlockedKeyStores()
Gets the aliases for any keystores that are available to be used as private key keystores for an SSL factory. This means the keystore is unlocked and contains at least one private key that's unlocked.


getUnlockedTrustStores

public KeystoreInstance[] getUnlockedTrustStores()
Gets the aliases for any keystores that are available to be used as trusted certificate keystores for an SSL factory. This means the keystore is unlocked and contains at least one trust certificate.



Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.