Interface TlsMaterial
- All Superinterfaces:
Prototype.Api
- All Known Subinterfaces:
TlsConfig
- All Known Implementing Classes:
TlsConfig.BuilderBase.TlsConfigImpl, TlsMaterial.BuilderBase.TlsMaterialImpl
TLS key and trust material used to set up or reload manager state.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFluent API builder forTlsMaterial.static classTlsMaterial.BuilderBase<BUILDER extends TlsMaterial.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends TlsMaterial>Fluent API builder base forTlsMaterial. -
Method Summary
Modifier and TypeMethodDescriptionstatic TlsMaterial.Builderbuilder()Create a new fluent API builder to customize configuration.static TlsMaterial.Builderbuilder(TlsMaterial instance) Create a new fluent API builder from an existing instance.static TlsMaterialcreate()Create a new instance with default values.static TlsMaterialCreate a new instance from configuration.Provider of the key stores used internally to create a key and trust manager factories.Type of the key stores used internally to create a key and trust manager factories.Algorithm of the key manager factory used when private key is defined.Key manager factory provider.Private key to use.Certificate chain of the private key.Certificate revocation check configuration.Explicit secure random to use.Algorithm to use when creating a new secure random.Provider to use when creating a new secure random.trust()List of certificates that form the trust manager.booleantrustAll()Trust any certificate provided by the other side of communication.Trust manager factory algorithm.Trust manager factory provider to use.
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance from configuration.- Parameters:
config- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
-
privateKey
Optional<PrivateKey> privateKey()Private key to use. This is required when reloading key material and can be omitted when reloading only trust material.- Returns:
- private key to use
-
privateKeyCertChain
List<X509Certificate> privateKeyCertChain()Certificate chain of the private key.- Returns:
- private key certificate chain, only used when private key is configured
-
trust
List<X509Certificate> trust()List of certificates that form the trust manager.- Returns:
- certificates to be trusted
-
secureRandom
-
secureRandomProvider
Provider to use when creating a new secure random. When defined,secureRandomAlgorithm()must be defined as well.- Returns:
- provider to use, by default no provider is specified
-
secureRandomAlgorithm
Algorithm to use when creating a new secure random.- Returns:
- algorithm to use, by default uses
SecureRandomconstructor
-
keyManagerFactoryAlgorithm
Algorithm of the key manager factory used when private key is defined. Defaults toKeyManagerFactory.getDefaultAlgorithm().- Returns:
- algorithm to use
-
keyManagerFactoryProvider
-
trustManagerFactoryAlgorithm
-
trustManagerFactoryProvider
-
trustAll
boolean trustAll()Trust any certificate provided by the other side of communication.This is a dangerous setting: if set to
true, any certificate will be accepted, throwing away most of the security advantages of TLS. NEVER do this in production.- Returns:
- whether to trust all certificates, do not use in production
-
internalKeystoreType
Type of the key stores used internally to create a key and trust manager factories.- Returns:
- keystore type, defaults to
KeyStore.getDefaultType()
-
internalKeystoreProvider
-
revocation
Optional<RevocationConfig> revocation()Certificate revocation check configuration.- Returns:
- certificate revocation configuration
-