Interface TlsMaterial

All Superinterfaces:
Prototype.Api
All Known Subinterfaces:
TlsConfig
All Known Implementing Classes:
TlsConfig.BuilderBase.TlsConfigImpl, TlsMaterial.BuilderBase.TlsMaterialImpl

public interface TlsMaterial extends Prototype.Api
TLS key and trust material used to set up or reload manager state.
See Also:
  • Method Details

    • builder

      static TlsMaterial.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static TlsMaterial.Builder builder(TlsMaterial instance)
      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

      static TlsMaterial create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static TlsMaterial create()
      Create a new instance with default values.
      Returns:
      a new instance
    • 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 of certificates that form the trust manager.
      Returns:
      certificates to be trusted
    • secureRandom

      Optional<SecureRandom> secureRandom()
      Explicit secure random to use.
      Returns:
      secure random to use
    • secureRandomProvider

      Optional<String> 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

      Optional<String> secureRandomAlgorithm()
      Algorithm to use when creating a new secure random.
      Returns:
      algorithm to use, by default uses SecureRandom constructor
    • keyManagerFactoryAlgorithm

      Optional<String> keyManagerFactoryAlgorithm()
      Algorithm of the key manager factory used when private key is defined. Defaults to KeyManagerFactory.getDefaultAlgorithm().
      Returns:
      algorithm to use
    • keyManagerFactoryProvider

      Optional<String> keyManagerFactoryProvider()
      Key manager factory provider.
      Returns:
      provider to use
    • trustManagerFactoryAlgorithm

      Optional<String> trustManagerFactoryAlgorithm()
      Trust manager factory algorithm.
      Returns:
      algorithm to use
    • trustManagerFactoryProvider

      Optional<String> trustManagerFactoryProvider()
      Trust manager factory provider to use.
      Returns:
      provider to use
    • 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

      Optional<String> internalKeystoreType()
      Type of the key stores used internally to create a key and trust manager factories.
      Returns:
      keystore type, defaults to KeyStore.getDefaultType()
    • internalKeystoreProvider

      Optional<String> internalKeystoreProvider()
      Provider of the key stores used internally to create a key and trust manager factories.
      Returns:
      keystore provider, if not defined, provider is not specified
    • revocation

      Optional<RevocationConfig> revocation()
      Certificate revocation check configuration.
      Returns:
      certificate revocation configuration