Package org.ldaptive.ssl
Class AbstractSSLContextInitializer
java.lang.Object
org.ldaptive.ssl.AbstractSSLContextInitializer
- All Implemented Interfaces:
SSLContextInitializer
- Direct Known Subclasses:
DefaultSSLContextInitializer,KeyStoreSSLContextInitializer,X509SSLContextInitializer
Provides common implementation for SSL context initializer.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final LoggerLogger for this class.protected TrustManager[]Trust managers. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TrustManager[]aggregateTrustManagers(TrustManager... managers) Creates anAggregateTrustManagercontaining the supplied trust managers.protected abstract TrustManager[]Creates any trust managers specific to this context initializer.Returns the trust managers used when creating SSL contexts.initSSLContext(String protocol) Creates an initialized SSLContext for the supplied protocol.voidsetTrustManagers(TrustManager... managers) Sets the trust managers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ldaptive.ssl.SSLContextInitializer
getKeyManagers
-
Field Details
-
logger
Logger for this class. -
trustManagers
Trust managers.
-
-
Constructor Details
-
AbstractSSLContextInitializer
public AbstractSSLContextInitializer()
-
-
Method Details
-
getTrustManagers
Description copied from interface:SSLContextInitializerReturns the trust managers used when creating SSL contexts.- Specified by:
getTrustManagersin interfaceSSLContextInitializer- Returns:
- trust managers
- Throws:
GeneralSecurityException- if an errors occurs while loading the TrustManagers
-
setTrustManagers
Description copied from interface:SSLContextInitializerSets the trust managers. May be in isolation or in conjunction with other trust material.- Specified by:
setTrustManagersin interfaceSSLContextInitializer- Parameters:
managers- trust managers
-
createTrustManagers
Creates any trust managers specific to this context initializer.- Returns:
- trust managers
- Throws:
GeneralSecurityException- if an errors occurs while loading the TrustManagers
-
initSSLContext
Description copied from interface:SSLContextInitializerCreates an initialized SSLContext for the supplied protocol.- Specified by:
initSSLContextin interfaceSSLContextInitializer- Parameters:
protocol- type to use for SSL- Returns:
- SSL context
- Throws:
GeneralSecurityException- if the SSLContext cannot be created
-
aggregateTrustManagers
Creates anAggregateTrustManagercontaining the supplied trust managers.- Parameters:
managers- to aggregate- Returns:
- array containing a single aggregate trust manager
-