Class TlsMaterial.BuilderBase<BUILDER extends TlsMaterial.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends TlsMaterial>
java.lang.Object
io.helidon.common.tls.TlsMaterial.BuilderBase<BUILDER, PROTOTYPE>
- Type Parameters:
BUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER, PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER, PROTOTYPE>
- Direct Known Subclasses:
TlsConfig.BuilderBase, TlsMaterial.Builder
- Enclosing interface:
TlsMaterial
public abstract static class TlsMaterial.BuilderBase<BUILDER extends TlsMaterial.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends TlsMaterial>
extends Object
implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER, PROTOTYPE>
Fluent API builder base for
TlsMaterial.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPrivateKeyCertChain(X509Certificate privateKeyCertChain) Certificate chain of the private key.addPrivateKeyCertChain(List<? extends X509Certificate> privateKeyCertChain) Certificate chain of the private key.addTrust(X509Certificate trust) List of certificates that form the trust manager.addTrust(List<? extends X509Certificate> trust) List of certificates that form the trust manager.Clear existing value of internalKeystoreProvider.Clear existing value of internalKeystoreType.Clear existing value of keyManagerFactoryAlgorithm.Clear existing value of keyManagerFactoryProvider.Clear existing value of privateKey.Clear all privateKeyCertChain.Clear existing value of revocation.Clear existing value of secureRandom.Clear existing value of secureRandomAlgorithm.Clear existing value of secureRandomProvider.Clear all trust.Clear existing value of trustManagerFactoryAlgorithm.Clear existing value of trustManagerFactoryProvider.config()Configuration used to configure this instance.Update builder from configuration (node of this type).from(TlsMaterial prototype) Update this builder from an existing prototype instance.from(TlsMaterial.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.Provider of the key stores used internally to create a key and trust manager factories.internalKeystoreProvider(String internalKeystoreProvider) 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.internalKeystoreType(String internalKeystoreType) 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.keyManagerFactoryAlgorithm(String keyManagerFactoryAlgorithm) Algorithm of the key manager factory used when private key is defined.Key manager factory provider.keyManagerFactoryProvider(String keyManagerFactoryProvider) Key manager factory provider.protected voidHandles providers and decorators.Private key to use.privateKey(Keys privateKey) Private key to use.privateKey(PrivateKey privateKey) Private key to use.privateKey(Consumer<Keys.Builder> consumer) Private key to use.Certificate chain of the private key.privateKeyCertChain(Keys privateKeyCertChain) Certificate chain of the private key.privateKeyCertChain(Consumer<Keys.Builder> consumer) Certificate chain of the private key.privateKeyCertChain(List<? extends X509Certificate> privateKeyCertChain) Certificate chain of the private key.Certificate revocation check configuration.revocation(RevocationConfig revocation) Certificate revocation check configuration.revocation(Consumer<RevocationConfig.Builder> consumer) Certificate revocation check configuration.revocation(Supplier<? extends RevocationConfig> supplier) Certificate revocation check configuration.Explicit secure random to use.secureRandom(SecureRandom secureRandom) Explicit secure random to use.Algorithm to use when creating a new secure random.secureRandomAlgorithm(String secureRandomAlgorithm) Algorithm to use when creating a new secure random.Provider to use when creating a new secure random.secureRandomProvider(String secureRandomProvider) Provider to use when creating a new secure random.toString()trust()List of certificates that form the trust manager.List of certificates that form the trust manager.trust(Consumer<Keys.Builder> consumer) List of certificates that form the trust manager.trust(List<? extends X509Certificate> trust) List of certificates that form the trust manager.booleantrustAll()Trust any certificate provided by the other side of communication.trustAll(boolean trustAll) Trust any certificate provided by the other side of communication.Trust manager factory algorithm.trustManagerFactoryAlgorithm(String trustManagerFactoryAlgorithm) Trust manager factory algorithm.Trust manager factory provider to use.trustManagerFactoryProvider(String trustManagerFactoryProvider) Trust manager factory provider to use.protected voidValidates required properties.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends TlsMaterial.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends TlsMaterial>- Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
clearPrivateKey
Clear existing value of privateKey.- Returns:
- updated builder instance
- See Also:
-
privateKey
Private key to use. This is required when reloading key material and can be omitted when reloading only trust material.- Parameters:
privateKey- private key to use- Returns:
- updated builder instance
- See Also:
-
privateKey
-
privateKey
Private key to use. This is required when reloading key material and can be omitted when reloading only trust material.- Parameters:
consumer- consumer of builder of private key to use- Returns:
- updated builder instance
- See Also:
-
clearPrivateKeyCertChain
Clear all privateKeyCertChain.- Returns:
- updated builder instance
- See Also:
-
privateKeyCertChain
Certificate chain of the private key.- Parameters:
privateKeyCertChain- private key certificate chain, only used when private key is configured- Returns:
- updated builder instance
- See Also:
-
privateKeyCertChain
-
privateKeyCertChain
Certificate chain of the private key.- Parameters:
consumer- consumer of builder of private key certificate chain, only used when private key is configured- Returns:
- updated builder instance
- See Also:
-
addPrivateKeyCertChain
Certificate chain of the private key.- Parameters:
privateKeyCertChain- private key certificate chain, only used when private key is configured- Returns:
- updated builder instance
- See Also:
-
addPrivateKeyCertChain
Certificate chain of the private key.- Parameters:
privateKeyCertChain- add single private key certificate chain, only used when private key is configured- Returns:
- updated builder instance
- See Also:
-
clearTrust
-
trust
List of certificates that form the trust manager.- Parameters:
trust- certificates to be trusted- Returns:
- updated builder instance
- See Also:
-
trust
-
trust
List of certificates that form the trust manager.- Parameters:
consumer- consumer of builder of certificates to be trusted- Returns:
- updated builder instance
- See Also:
-
addTrust
List of certificates that form the trust manager.- Parameters:
trust- certificates to be trusted- Returns:
- updated builder instance
- See Also:
-
addTrust
List of certificates that form the trust manager.- Parameters:
trust- add single certificates to be trusted- Returns:
- updated builder instance
- See Also:
-
clearSecureRandom
Clear existing value of secureRandom.- Returns:
- updated builder instance
- See Also:
-
secureRandom
Explicit secure random to use.- Parameters:
secureRandom- secure random to use- Returns:
- updated builder instance
- See Also:
-
clearSecureRandomProvider
Clear existing value of secureRandomProvider.- Returns:
- updated builder instance
- See Also:
-
secureRandomProvider
Provider to use when creating a new secure random. When defined,secureRandomAlgorithm()must be defined as well.- Parameters:
secureRandomProvider- provider to use, by default no provider is specified- Returns:
- updated builder instance
- See Also:
-
clearSecureRandomAlgorithm
Clear existing value of secureRandomAlgorithm.- Returns:
- updated builder instance
- See Also:
-
secureRandomAlgorithm
Algorithm to use when creating a new secure random.- Parameters:
secureRandomAlgorithm- algorithm to use, by default usesSecureRandomconstructor- Returns:
- updated builder instance
- See Also:
-
clearKeyManagerFactoryAlgorithm
Clear existing value of keyManagerFactoryAlgorithm.- Returns:
- updated builder instance
- See Also:
-
keyManagerFactoryAlgorithm
Algorithm of the key manager factory used when private key is defined. Defaults toKeyManagerFactory.getDefaultAlgorithm().- Parameters:
keyManagerFactoryAlgorithm- algorithm to use- Returns:
- updated builder instance
- See Also:
-
clearKeyManagerFactoryProvider
Clear existing value of keyManagerFactoryProvider.- Returns:
- updated builder instance
- See Also:
-
keyManagerFactoryProvider
-
clearTrustManagerFactoryAlgorithm
Clear existing value of trustManagerFactoryAlgorithm.- Returns:
- updated builder instance
- See Also:
-
trustManagerFactoryAlgorithm
-
clearTrustManagerFactoryProvider
Clear existing value of trustManagerFactoryProvider.- Returns:
- updated builder instance
- See Also:
-
trustManagerFactoryProvider
-
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.- Parameters:
trustAll- whether to trust all certificates, do not use in production- Returns:
- updated builder instance
- See Also:
-
clearInternalKeystoreType
Clear existing value of internalKeystoreType.- Returns:
- updated builder instance
- See Also:
-
internalKeystoreType
Type of the key stores used internally to create a key and trust manager factories.- Parameters:
internalKeystoreType- keystore type, defaults toKeyStore.getDefaultType()- Returns:
- updated builder instance
- See Also:
-
clearInternalKeystoreProvider
Clear existing value of internalKeystoreProvider.- Returns:
- updated builder instance
- See Also:
-
internalKeystoreProvider
Provider of the key stores used internally to create a key and trust manager factories.- Parameters:
internalKeystoreProvider- keystore provider, if not defined, provider is not specified- Returns:
- updated builder instance
- See Also:
-
clearRevocation
Clear existing value of revocation.- Returns:
- updated builder instance
- See Also:
-
revocation
Certificate revocation check configuration.- Parameters:
revocation- certificate revocation configuration- Returns:
- updated builder instance
- See Also:
-
revocation
Certificate revocation check configuration.- Parameters:
consumer- consumer of builder of certificate revocation configuration- Returns:
- updated builder instance
- See Also:
-
revocation
Certificate revocation check configuration.- Parameters:
supplier- supplier of certificate revocation configuration- Returns:
- updated builder instance
- See Also:
-
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
Certificate chain of the private key.- Returns:
- private key certificate chain, only used when private key is configured
-
trust
List of certificates that form the trust manager.- Returns:
- certificates to be trusted
-
secureRandom
Explicit secure random to use.- Returns:
- secure random to use
-
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
public 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
Certificate revocation check configuration.- Returns:
- certificate revocation configuration
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties. -
config
-