Package org.jboss.netty.handler.ssl.util
Class SimpleTrustManagerFactory
- java.lang.Object
-
- javax.net.ssl.TrustManagerFactory
-
- org.jboss.netty.handler.ssl.util.SimpleTrustManagerFactory
-
- Direct Known Subclasses:
FingerprintTrustManagerFactory
,InsecureTrustManagerFactory
public abstract class SimpleTrustManagerFactory extends javax.net.ssl.TrustManagerFactory
Helps to implement a customTrustManagerFactory
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
SimpleTrustManagerFactory.SimpleTrustManagerFactorySpi
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.ThreadLocal<SimpleTrustManagerFactory.SimpleTrustManagerFactorySpi>
CURRENT_SPI
SimpleTrustManagerFactory.SimpleTrustManagerFactorySpi
must have a reference toSimpleTrustManagerFactory
to delegate its callbacks back toSimpleTrustManagerFactory
.private static java.security.Provider
PROVIDER
-
Constructor Summary
Constructors Modifier Constructor Description protected
SimpleTrustManagerFactory()
Creates a new instance.protected
SimpleTrustManagerFactory(java.lang.String name)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description protected abstract javax.net.ssl.TrustManager[]
engineGetTrustManagers()
Returns one trust manager for each type of trust material.protected abstract void
engineInit(java.security.KeyStore keyStore)
Initializes this factory with a source of certificate authorities and related trust material.protected abstract void
engineInit(javax.net.ssl.ManagerFactoryParameters managerFactoryParameters)
Initializes this factory with a source of provider-specific key material.
-
-
-
Field Detail
-
PROVIDER
private static final java.security.Provider PROVIDER
-
CURRENT_SPI
private static final java.lang.ThreadLocal<SimpleTrustManagerFactory.SimpleTrustManagerFactorySpi> CURRENT_SPI
SimpleTrustManagerFactory.SimpleTrustManagerFactorySpi
must have a reference toSimpleTrustManagerFactory
to delegate its callbacks back toSimpleTrustManagerFactory
. However, it is impossible to do so, becauseTrustManagerFactory
requiresTrustManagerFactorySpi
at construction time and does not provide a way to access it later. To work around this issue, we use an ugly hack which uses aThreadLocal
.
-
-
Method Detail
-
engineInit
protected abstract void engineInit(java.security.KeyStore keyStore) throws java.lang.Exception
Initializes this factory with a source of certificate authorities and related trust material.- Throws:
java.lang.Exception
- See Also:
TrustManagerFactorySpi.engineInit(KeyStore)
-
engineInit
protected abstract void engineInit(javax.net.ssl.ManagerFactoryParameters managerFactoryParameters) throws java.lang.Exception
Initializes this factory with a source of provider-specific key material.- Throws:
java.lang.Exception
- See Also:
TrustManagerFactorySpi.engineInit(ManagerFactoryParameters)
-
engineGetTrustManagers
protected abstract javax.net.ssl.TrustManager[] engineGetTrustManagers()
Returns one trust manager for each type of trust material.- See Also:
TrustManagerFactorySpi.engineGetTrustManagers()
-
-