Package io.helidon.grpc.server
Class SSLContextBuilder
- java.lang.Object
-
- io.helidon.grpc.server.SSLContextBuilder
-
- All Implemented Interfaces:
Builder<SSLContext>,Supplier<SSLContext>
public final class SSLContextBuilder extends Object implements Builder<SSLContext>
Builder for configuring a new SslContext for creation.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SSLContextbuild()Create new{@link javax.net.ssl.SSLContext}instance with configured settings.static SSLContextBuildercreate(KeyConfig privateKeyConfig)Creates a builder of theSSLContext.static SSLContextcreate(Config sslConfig)CreatesSSLContextfrom the provided configuration.SSLContextBuildersessionCacheSize(long sessionCacheSize)Set the size of the cache used for storing SSL session objects.SSLContextBuildersessionTimeout(long sessionTimeout)Set the timeout for the cached SSL session objects, in seconds.SSLContextBuildertrustConfig(KeyConfig trustConfig)Set the trust key configuration to be used to validate certificates.
-
-
-
Method Detail
-
create
public static SSLContextBuilder create(KeyConfig privateKeyConfig)
Creates a builder of theSSLContext.- Parameters:
privateKeyConfig- the required private key configuration parameter- Returns:
- this builder
-
create
public static SSLContext create(Config sslConfig)
CreatesSSLContextfrom the provided configuration.- Parameters:
sslConfig- the ssl configuration- Returns:
- a built
SSLContext - Throws:
IllegalStateException- in case of a problem; will wrap either an instance ofIOExceptionor aGeneralSecurityException
-
trustConfig
public SSLContextBuilder trustConfig(KeyConfig trustConfig)
Set the trust key configuration to be used to validate certificates.- Parameters:
trustConfig- the trust configuration- Returns:
- an updated builder
-
sessionCacheSize
public SSLContextBuilder sessionCacheSize(long sessionCacheSize)
Set the size of the cache used for storing SSL session objects.0to use the default value.- Parameters:
sessionCacheSize- the session cache size- Returns:
- an updated builder
-
sessionTimeout
public SSLContextBuilder sessionTimeout(long sessionTimeout)
Set the timeout for the cached SSL session objects, in seconds.0to use the default value.- Parameters:
sessionTimeout- the session timeout- Returns:
- an updated builder
-
build
public SSLContext build()
Create new{@link javax.net.ssl.SSLContext}instance with configured settings.- Specified by:
buildin interfaceBuilder<SSLContext>- Returns:
- the SSL Context built instance
- Throws:
IllegalStateException- in case of a problem; will wrap either an instance ofIOExceptionor aGeneralSecurityException
-
-