Interface Keys

All Superinterfaces:
Prototype.Api
All Known Implementing Classes:
Keys.BuilderBase.KeysImpl

public interface Keys extends Prototype.Api
Configuration of keys. If a key is defined in multiple places (keystore, pem, or explicit), the order of preference is:
  • Explicit instance will be used
  • Keystore will be used
  • PEM will be used
So if a Private key is defined both explicitly and through PEM, the explicitly defined key would be used.
See Also:
  • Method Details

    • builder

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

      static Keys.Builder builder(Keys 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 Keys 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 Keys create()
      Create a new instance with default values.
      Returns:
      a new instance
    • keystore

      Optional<KeystoreKeys> keystore()
      Configure keys from a keystore. Once the config object is built, this option will ALWAYS be empty. All keys from the keystore will be populated to privateKey(), publicKey(), publicCert() etc.
      Returns:
      keystore configuration
    • pem

      Configure keys from pem file(s). Once the config object is built, this option will ALWAYS be empty. All keys from the keystore will be populated to privateKey(), publicKey(), publicCert() etc.
      Returns:
      pem based definition
    • publicKey

      Optional<PublicKey> publicKey()
      The public key of this config if configured.
      Returns:
      the public key of this config or empty if not configured
    • privateKey

      Optional<PrivateKey> privateKey()
      The private key of this config if configured.
      Returns:
      the private key of this config or empty if not configured
    • publicCert

      Optional<X509Certificate> publicCert()
      The public X.509 Certificate if configured.
      Returns:
      the public certificate of this config or empty if not configured
    • certChain

      List<X509Certificate> certChain()
      The X.509 Certificate Chain.
      Returns:
      the certificate chain or empty list if not configured
    • certs

      The X.509 Certificates.
      Returns:
      the certificates configured or empty list if none configured