Package org.apache.bookkeeper.tls
Class TLSContextFactory
- java.lang.Object
-
- org.apache.bookkeeper.tls.TLSContextFactory
-
- All Implemented Interfaces:
SecurityHandlerFactory
public class TLSContextFactory extends java.lang.Object implements SecurityHandlerFactory
A factory to manage TLS contexts.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TLSContextFactory.KeyStoreType
Supported Key File Types.-
Nested classes/interfaces inherited from interface org.apache.bookkeeper.tls.SecurityHandlerFactory
SecurityHandlerFactory.NodeType
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BC
static java.lang.String
BC_FIPS
static java.lang.String
BC_FIPS_PROVIDER_CLASS
static java.lang.String
BC_NON_FIPS_PROVIDER_CLASS
static java.security.Provider
BC_PROVIDER
-
Constructor Summary
Constructors Constructor Description TLSContextFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.security.Provider
getBCProviderFromClassPath()
Get Bouncy Castle provider from classpath, and call Security.addProvider.java.lang.String
getHandlerName()
static java.security.Provider
getProvider()
Get Bouncy Castle provider, and call Security.addProvider(provider) if success.void
init(SecurityHandlerFactory.NodeType type, AbstractConfiguration conf, io.netty.buffer.ByteBufAllocator allocator)
io.netty.handler.ssl.SslHandler
newTLSHandler()
io.netty.handler.ssl.SslHandler
newTLSHandler(java.lang.String peer, int port)
-
-
-
Field Detail
-
BC_PROVIDER
public static final java.security.Provider BC_PROVIDER
-
BC_FIPS_PROVIDER_CLASS
public static final java.lang.String BC_FIPS_PROVIDER_CLASS
- See Also:
- Constant Field Values
-
BC_NON_FIPS_PROVIDER_CLASS
public static final java.lang.String BC_NON_FIPS_PROVIDER_CLASS
- See Also:
- Constant Field Values
-
BC_FIPS
public static final java.lang.String BC_FIPS
- See Also:
- Constant Field Values
-
BC
public static final java.lang.String BC
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProvider
public static java.security.Provider getProvider()
Get Bouncy Castle provider, and call Security.addProvider(provider) if success.
-
getBCProviderFromClassPath
public static java.security.Provider getBCProviderFromClassPath() throws java.lang.Exception
Get Bouncy Castle provider from classpath, and call Security.addProvider. Throw Exception if failed.- Throws:
java.lang.Exception
-
getHandlerName
public java.lang.String getHandlerName()
- Specified by:
getHandlerName
in interfaceSecurityHandlerFactory
-
init
public void init(SecurityHandlerFactory.NodeType type, AbstractConfiguration conf, io.netty.buffer.ByteBufAllocator allocator) throws SecurityException
- Specified by:
init
in interfaceSecurityHandlerFactory
- Throws:
SecurityException
-
newTLSHandler
public io.netty.handler.ssl.SslHandler newTLSHandler()
- Specified by:
newTLSHandler
in interfaceSecurityHandlerFactory
-
newTLSHandler
public io.netty.handler.ssl.SslHandler newTLSHandler(java.lang.String peer, int port)
- Specified by:
newTLSHandler
in interfaceSecurityHandlerFactory
-
-