@NoImplement public interface TlsContextFactoryBuilder
TlsContextFactory
. To configure a trust store, at least it's path and password must be provided. To configure
a key store, at least it's path, password and key password must be provided.Modifier and Type | Method and Description |
---|---|
TlsContextFactory |
build()
Returns a
TlsContextFactory based on the configured properties. |
TlsContextFactory |
buildDefault() |
TlsContextFactoryBuilder |
enabledCipherSuites(String cipherSuites)
Defines the enabled TLS cipher suites, which must be a subset of the global enabled ones, otherwise a
CreateException
will occur upon build() . |
TlsContextFactoryBuilder |
enabledProtocols(String protocols)
Defines the enabled TLS protocols, which must be a subset of the global enabled ones, otherwise a
CreateException will
occur upon build() . |
TlsContextFactoryBuilder |
insecureTrustStore(boolean insecure)
Defines whether the trust store should be insecure, meaning no certificate validations should be performed.
|
TlsContextFactoryBuilder |
keyAlias(String alias)
Defines the alias of the key to use when the key store contains many private keys.
|
TlsContextFactoryBuilder |
keyPassword(String password)
Defines the password used to protect the private key.
|
TlsContextFactoryBuilder |
keyStoreAlgorithm(String algorithm)
Defines the key store algorithm.
|
TlsContextFactoryBuilder |
keyStorePassword(String password)
Defines the password to access the key store defined in
keyStorePath(String) . |
TlsContextFactoryBuilder |
keyStorePath(String path)
Defines the location (which will be resolved relative to the current classpath and file system, if possible) where the key
store to use should be looked for.
|
TlsContextFactoryBuilder |
keyStoreType(String type)
Defines the type of the key store (such as jks, jceks or pkcs12).
|
TlsContextFactoryBuilder |
name(String name)
Defines a name for the
TlsContextFactory . |
TlsRevocationCheckBuilder |
revocationCheck()
Defines the certificate revocation checking mechanism.
|
TlsContextFactoryBuilder |
trustStoreAlgorithm(String algorithm)
Defines the trust store algorithm.
|
TlsContextFactoryBuilder |
trustStorePassword(String password)
Defines the password to access the trust store defined in
trustStorePath(String) . |
TlsContextFactoryBuilder |
trustStorePath(String path)
Defines the location (which will be resolved relative to the current classpath and file system, if possible) where the trust
store to use should be looked for, requires
trustStorePassword(String) too. |
TlsContextFactoryBuilder |
trustStoreType(String type)
Defines the type of the trust store (such as jks, jceks or pkcs12).
|
TlsContextFactory buildDefault()
TlsContextFactory
with the jvm default certificates.TlsContextFactoryBuilder name(String name)
TlsContextFactory
. Recommended for troubleshooting purposes.name
- the name of the contextTlsContextFactoryBuilder enabledProtocols(String protocols)
CreateException
will
occur upon build()
. By default, those global ones will be used.protocols
- a comma separated String
with the protocols, for example "TLSv1.1,TLSv1.2"TlsContextFactoryBuilder enabledCipherSuites(String cipherSuites)
CreateException
will occur upon build()
. By default, those global ones will be used.cipherSuites
- a comma separated String
with the cipher suites, for example "TLS_DHE_DSS_WITH_AES_128_CBC_SHA,TLS_DHE_DSS_WITH_AES_256_CBC_SHA".TlsContextFactoryBuilder trustStorePath(String path)
trustStorePassword(String)
too.path
- the file path to the trust storeTlsContextFactoryBuilder trustStorePassword(String password)
trustStorePath(String)
.password
- the passwordTlsContextFactoryBuilder trustStoreType(String type)
KeyStore.getDefaultType()
will be used.type
- TlsContextFactoryBuilder insecureTrustStore(boolean insecure)
false
.insecure
- TlsContextFactoryBuilder trustStoreAlgorithm(String algorithm)
KeyManagerFactory.getDefaultAlgorithm()
will be used.algorithm
- the algorithm to useTlsContextFactoryBuilder keyStorePath(String path)
keyStorePassword(String)
too.path
- the file path to the key storeTlsContextFactoryBuilder keyStorePassword(String password)
keyStorePath(String)
.password
- the password used to protect the key storeTlsContextFactoryBuilder keyAlias(String alias)
alias
- the alias of the keyTlsContextFactoryBuilder keyPassword(String password)
password
- the passwordTlsContextFactoryBuilder keyStoreType(String type)
KeyStore.getDefaultType()
will be used.type
- TlsContextFactoryBuilder keyStoreAlgorithm(String algorithm)
KeyManagerFactory.getDefaultAlgorithm()
will be used.algorithm
- TlsRevocationCheckBuilder revocationCheck()
TlsContextFactory build() throws CreateException
TlsContextFactory
based on the configured properties.TlsContextFactory
.CreateException
- if there's any trouble regarding protocols and cipher validation or store loading (such as the files not being found)Copyright © 2018. All rights reserved.