Class OsgiKeystoreManager
- java.lang.Object
-
- org.apache.karaf.jaas.config.impl.OsgiKeystoreManager
-
- All Implemented Interfaces:
KeystoreManager
public class OsgiKeystoreManager extends Object implements KeystoreManager
Implementation of KeystoreManager
-
-
Constructor Summary
Constructors Constructor Description OsgiKeystoreManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SSLContextcreateSSLContext(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore)Get a SSLContext using one Keystore to access the private key and another to provide the list of trusted certificate authorities.SSLContextcreateSSLContext(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore, long timeout)Get a SSLContext using one Keystore to access the private key and another to provide the list of trusted certificate authorities.SSLSocketFactorycreateSSLFactory(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore)Get a SocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.SSLSocketFactorycreateSSLFactory(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore, long timeout)Get a SocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.SSLServerSocketFactorycreateSSLServerFactory(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore)Get a ServerSocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.SSLServerSocketFactorycreateSSLServerFactory(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore, long timeout)Get a ServerSocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.KeystoreInstancegetKeystore(String name)voidregister(KeystoreInstance keystore, Map<String,?> properties)voidunregister(KeystoreInstance keystore, Map<String,?> properties)
-
-
-
Method Detail
-
register
public void register(KeystoreInstance keystore, Map<String,?> properties)
-
unregister
public void unregister(KeystoreInstance keystore, Map<String,?> properties)
-
getKeystore
public KeystoreInstance getKeystore(String name)
- Specified by:
getKeystorein interfaceKeystoreManager
-
createSSLContext
public SSLContext createSSLContext(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore) throws GeneralSecurityException
Description copied from interface:KeystoreManagerGet a SSLContext using one Keystore to access the private key and another to provide the list of trusted certificate authorities.- Specified by:
createSSLContextin interfaceKeystoreManager- Parameters:
provider- the SSL provider to use.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.- Returns:
- the SSLContext.
- 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
-
createSSLContext
public SSLContext createSSLContext(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore, long timeout) throws GeneralSecurityException
Description copied from interface:KeystoreManagerGet a SSLContext using one Keystore to access the private key and another to provide the list of trusted certificate authorities.- Specified by:
createSSLContextin interfaceKeystoreManager- Parameters:
provider- the SSL provider to use.protocol- The SSL protocol to usealgorithm- The SSL algorithm to usekeyStore- 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.timeout- Amount of time waiting for the keyStore and keyAlias to be available.- Returns:
- the SSLContext.
- Throws:
GeneralSecurityException- General security failure.
-
createSSLServerFactory
public SSLServerSocketFactory createSSLServerFactory(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore) throws GeneralSecurityException
Description copied from interface:KeystoreManagerGet a ServerSocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.- Specified by:
createSSLServerFactoryin interfaceKeystoreManager- Parameters:
provider- the SSL provider to use.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.- Returns:
- the SSLServerSocketFactory.
- Throws:
GeneralSecurityException- General security failure.
-
createSSLServerFactory
public SSLServerSocketFactory createSSLServerFactory(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore, long timeout) throws GeneralSecurityException
Description copied from interface:KeystoreManagerGet a ServerSocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.- Specified by:
createSSLServerFactoryin interfaceKeystoreManager- Parameters:
provider- the SSL provider to use.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.timeout- Amount of time to wait for keyStore and keyAlias to be available.- Returns:
- the SSLServerSocketFactory.
- Throws:
GeneralSecurityException- General security failure.
-
createSSLFactory
public SSLSocketFactory createSSLFactory(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore) throws GeneralSecurityException
Description copied from interface:KeystoreManagerGet a SocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.- Specified by:
createSSLFactoryin interfaceKeystoreManager- 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.- Returns:
- the SSLSocketFactory.
- 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- General security failure.
-
createSSLFactory
public SSLSocketFactory createSSLFactory(String provider, String protocol, String algorithm, String keyStore, String keyAlias, String trustStore, long timeout) throws GeneralSecurityException
Description copied from interface:KeystoreManagerGet a SocketFactory using one Keystore to access the private key and another to provide the list of trusted certificate authorities.- Specified by:
createSSLFactoryin interfaceKeystoreManager- Parameters:
provider- The SSL provider to use, or null for the defaultprotocol- The SSL protocol to usealgorithm- The SSL algorithm to usekeyStore- 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.timeout- Amount of time to wait for keyStore and keyAlias to be available.- Returns:
- the SSLSocketFactory.
- 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- General security failure.
-
-