Package io.github.stevenjdh.simple.ssl
Class SSLContextBuilderImpl
java.lang.Object
io.github.stevenjdh.simple.ssl.SSLContextBuilderImpl
- All Implemented Interfaces:
SimpleSSLContext.Builder
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) char[]
(package private) Path
(package private) SimpleSSLContext.KeyStoreType
(package private) char[]
(package private) Path
(package private) SimpleSSLContext.KeyStoreType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a newSSLContext
instance built from the current state of this builder.Optionally sets the keystore type with PKCS12 being the default.Optionally sets the truststore type with PKCS12 being the default.withKeyStore
(Path keyMaterialPath, char[] password) Optionally sets the keystore configuration to be used when building anSSLContext
.withTrustStore
(Path trustMaterialPath, char[] password) Optionally sets the truststore configuration to be used when building anSSLContext
.
-
Field Details
-
keyStorePath
Path keyStorePath -
keyStorePassword
char[] keyStorePassword -
trustStorePath
Path trustStorePath -
trustStorePassword
char[] trustStorePassword -
keyStoreType
SimpleSSLContext.KeyStoreType keyStoreType -
trustStoreType
SimpleSSLContext.KeyStoreType trustStoreType
-
-
Constructor Details
-
SSLContextBuilderImpl
SSLContextBuilderImpl()
-
-
Method Details
-
withKeyStore
Description copied from interface:SimpleSSLContext.Builder
Optionally sets the keystore configuration to be used when building anSSLContext
.- Specified by:
withKeyStore
in interfaceSimpleSSLContext.Builder
- Parameters:
keyMaterialPath
- The path to the keystore file containing key material.password
- The password used to unlock the keystore. If this is set to null or an empty char[], it will be assumed that a password is not needed.- Returns:
- This builder.
-
withTrustStore
Description copied from interface:SimpleSSLContext.Builder
Optionally sets the truststore configuration to be used when building anSSLContext
.- Specified by:
withTrustStore
in interfaceSimpleSSLContext.Builder
- Parameters:
trustMaterialPath
- The path to the truststore file containing trust material.password
- The password used to unlock the truststore. If this is set to null or an empty char[], it will be assumed that a password is not needed.- Returns:
- This builder.
-
keyStoreType
Description copied from interface:SimpleSSLContext.Builder
Optionally sets the keystore type with PKCS12 being the default.- Specified by:
keyStoreType
in interfaceSimpleSSLContext.Builder
- Parameters:
type
- The keystore type such as PKCS12 or the legacy JKS.- Returns:
- This builder.
-
trustStoreType
Description copied from interface:SimpleSSLContext.Builder
Optionally sets the truststore type with PKCS12 being the default.- Specified by:
trustStoreType
in interfaceSimpleSSLContext.Builder
- Parameters:
type
- The truststore type such as PKCS12 or the legacy JKS.- Returns:
- This builder.
-
build
Description copied from interface:SimpleSSLContext.Builder
Returns a newSSLContext
instance built from the current state of this builder.- Specified by:
build
in interfaceSimpleSSLContext.Builder
- Returns:
- A new
SSLContext
.
-