Package org.ldaptive.ssl
Class DefaultSSLContextInitializer
- java.lang.Object
-
- org.ldaptive.ssl.AbstractSSLContextInitializer
-
- org.ldaptive.ssl.DefaultSSLContextInitializer
-
- All Implemented Interfaces:
SSLContextInitializer
public class DefaultSSLContextInitializer extends AbstractSSLContextInitializer
Provides a default implementation of SSL context initializer which allows the setting of trust and key managers in order to create an SSL context.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
createDefaultTrustManagers
Whether default trust managers should be created.private KeyManager[]
keyManagers
Key managers.-
Fields inherited from class org.ldaptive.ssl.AbstractSSLContextInitializer
logger, trustManagers
-
-
Constructor Summary
Constructors Constructor Description DefaultSSLContextInitializer()
Creates a new default ssl context initializer.DefaultSSLContextInitializer(boolean defaultTrustManagers)
Creates a new default ssl context initializer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TrustManager[]
createTrustManagers()
Creates any trust managers specific to this context initializer.KeyManager[]
getKeyManagers()
Returns the key managers used when creating SSL contexts.void
setKeyManagers(KeyManager... managers)
Sets the key managers.String
toString()
-
Methods inherited from class org.ldaptive.ssl.AbstractSSLContextInitializer
aggregateTrustManagers, getTrustManagers, initSSLContext, setTrustManagers
-
-
-
-
Field Detail
-
keyManagers
private KeyManager[] keyManagers
Key managers.
-
createDefaultTrustManagers
private final boolean createDefaultTrustManagers
Whether default trust managers should be created.
-
-
Constructor Detail
-
DefaultSSLContextInitializer
public DefaultSSLContextInitializer()
Creates a new default ssl context initializer. Default trust managers will be produced.
-
DefaultSSLContextInitializer
public DefaultSSLContextInitializer(boolean defaultTrustManagers)
Creates a new default ssl context initializer.- Parameters:
defaultTrustManagers
- whether default trust managers should be created
-
-
Method Detail
-
createTrustManagers
protected TrustManager[] createTrustManagers() throws GeneralSecurityException
Description copied from class:AbstractSSLContextInitializer
Creates any trust managers specific to this context initializer.- Specified by:
createTrustManagers
in classAbstractSSLContextInitializer
- Returns:
- trust managers
- Throws:
GeneralSecurityException
- if an errors occurs while loading the TrustManagers
-
getKeyManagers
public KeyManager[] getKeyManagers() throws GeneralSecurityException
Description copied from interface:SSLContextInitializer
Returns the key managers used when creating SSL contexts.- Returns:
- key managers
- Throws:
GeneralSecurityException
- if an errors occurs while loading the KeyManagers
-
setKeyManagers
public void setKeyManagers(KeyManager... managers)
Sets the key managers.- Parameters:
managers
- key managers
-
-