Class SecurityManagerProviderImpl
- java.lang.Object
-
- com.github.toolarium.security.keystore.impl.SecurityManagerProviderImpl
-
- All Implemented Interfaces:
ISecurityManagerProvider
public class SecurityManagerProviderImpl extends java.lang.Object implements ISecurityManagerProvider
ImplementsISecurityManagerProvider.
-
-
Constructor Summary
Constructors Constructor Description SecurityManagerProviderImpl(java.security.KeyStore trustManagerStore, java.security.KeyStore keyManagerStore, com.github.toolarium.common.security.ISecuredValue<java.lang.String> keyManagerStorePassword)Constructor for SecurityManagerImpl
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.net.ssl.KeyManager[]createKeyManager(java.security.KeyStore keyStore, com.github.toolarium.common.security.ISecuredValue<java.lang.String> storePassword)Create aKeyManagerfor the given key storeprotected javax.net.ssl.TrustManager[]createTrustManagers(java.security.KeyStore keyStore)Create aTrustManagerfor the given key store.javax.net.ssl.KeyManager[]getKeyManagers()Returns the key manager.javax.net.ssl.TrustManager[]getTrustManagers()Returns the trust manager.
-
-
-
Constructor Detail
-
SecurityManagerProviderImpl
public SecurityManagerProviderImpl(java.security.KeyStore trustManagerStore, java.security.KeyStore keyManagerStore, com.github.toolarium.common.security.ISecuredValue<java.lang.String> keyManagerStorePassword)Constructor for SecurityManagerImpl- Parameters:
trustManagerStore- the trust manager storekeyManagerStore- the key manager storekeyManagerStorePassword- the key manager store password- Throws:
java.lang.IllegalArgumentException- In case of an invalid key manager store or password
-
-
Method Detail
-
getTrustManagers
public javax.net.ssl.TrustManager[] getTrustManagers() throws java.security.GeneralSecurityExceptionDescription copied from interface:ISecurityManagerProviderReturns the trust manager.- Specified by:
getTrustManagersin interfaceISecurityManagerProvider- Returns:
- the trust managers
- Throws:
java.security.GeneralSecurityException- if it can not be initialised.- See Also:
ISecurityManagerProvider.getTrustManagers()
-
getKeyManagers
public javax.net.ssl.KeyManager[] getKeyManagers() throws java.security.GeneralSecurityExceptionDescription copied from interface:ISecurityManagerProviderReturns the key manager.- Specified by:
getKeyManagersin interfaceISecurityManagerProvider- Returns:
- the key managers
- Throws:
java.security.GeneralSecurityException- if it can not be initialised.- See Also:
ISecurityManagerProvider.getKeyManagers()
-
createKeyManager
protected javax.net.ssl.KeyManager[] createKeyManager(java.security.KeyStore keyStore, com.github.toolarium.common.security.ISecuredValue<java.lang.String> storePassword) throws java.security.GeneralSecurityExceptionCreate aKeyManagerfor the given key store- Parameters:
keyStore- The key storestorePassword- the store password- Returns:
- The key managers in the given key store
- Throws:
java.security.GeneralSecurityException- if the key store could not be loaded
-
createTrustManagers
protected javax.net.ssl.TrustManager[] createTrustManagers(java.security.KeyStore keyStore) throws java.security.GeneralSecurityExceptionCreate aTrustManagerfor the given key store.- Parameters:
keyStore- The key store- Returns:
- The trust manager
- Throws:
java.security.GeneralSecurityException- if the creation failed
-
-