Class PemKeys.BuilderBase<BUILDER extends PemKeys.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends PemKeys>

java.lang.Object
io.helidon.common.pki.PemKeys.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>, Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
PemKeys.Builder
Enclosing interface:
PemKeys

public abstract static class PemKeys.BuilderBase<BUILDER extends PemKeys.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends PemKeys> extends Object implements Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for PemKeys.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(PemKeys prototype)
      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

      public BUILDER from(PemKeys.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • config

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface Prototype.ConfiguredBuilder<BUILDER extends PemKeys.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends PemKeys>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • clearKey

      public BUILDER clearKey()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • key

      public BUILDER key(Resource key)
      Read a private key from PEM format from a resource definition.
      Parameters:
      key - key resource (file, classpath, URL etc.)
      Returns:
      updated builder instance
      See Also:
    • key

      public BUILDER key(ResourceConfig keyConfig)
      Read a private key from PEM format from a resource definition.
      Parameters:
      keyConfig - key resource (file, classpath, URL etc.)
      Returns:
      updated builder instance
      See Also:
    • key

      public BUILDER key(Consumer<ResourceConfig.Builder> consumer)
      Read a private key from PEM format from a resource definition.
      Parameters:
      consumer - key resource (file, classpath, URL etc.)
      Returns:
      updated builder instance
      See Also:
    • clearKeyPassphrase

      public BUILDER clearKeyPassphrase()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • keyPassphrase

      public BUILDER keyPassphrase(char[] keyPassphrase)
      Passphrase for private key. If the key is encrypted (and in PEM PKCS#8 format), this passphrase will be used to decrypt it.
      Parameters:
      keyPassphrase - passphrase used to encrypt the private key
      Returns:
      updated builder instance
      See Also:
    • keyPassphrase

      public BUILDER keyPassphrase(String keyPassphrase)
      Passphrase for private key. If the key is encrypted (and in PEM PKCS#8 format), this passphrase will be used to decrypt it.
      Parameters:
      keyPassphrase - passphrase used to encrypt the private key
      Returns:
      updated builder instance
      See Also:
    • clearPublicKey

      public BUILDER clearPublicKey()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • publicKey

      public BUILDER publicKey(Resource publicKey)
      Read a public key from PEM format from a resource definition.
      Parameters:
      publicKey - public key resource (file, classpath, URL etc.)
      Returns:
      updated builder instance
      See Also:
    • publicKey

      public BUILDER publicKey(ResourceConfig publicKeyConfig)
      Read a public key from PEM format from a resource definition.
      Parameters:
      publicKeyConfig - public key resource (file, classpath, URL etc.)
      Returns:
      updated builder instance
      See Also:
    • publicKey

      public BUILDER publicKey(Consumer<ResourceConfig.Builder> consumer)
      Read a public key from PEM format from a resource definition.
      Parameters:
      consumer - public key resource (file, classpath, URL etc.)
      Returns:
      updated builder instance
      See Also:
    • clearCertChain

      public BUILDER clearCertChain()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • certChain

      public BUILDER certChain(Resource certChain)
      Load certificate chain from PEM resource.
      Parameters:
      certChain - resource (e.g. classpath, file path, URL etc.)
      Returns:
      updated builder instance
      See Also:
    • certChain

      public BUILDER certChain(ResourceConfig certChainConfig)
      Load certificate chain from PEM resource.
      Parameters:
      certChainConfig - resource (e.g. classpath, file path, URL etc.)
      Returns:
      updated builder instance
      See Also:
    • certChain

      public BUILDER certChain(Consumer<ResourceConfig.Builder> consumer)
      Load certificate chain from PEM resource.
      Parameters:
      consumer - resource (e.g. classpath, file path, URL etc.)
      Returns:
      updated builder instance
      See Also:
    • clearCertificates

      public BUILDER clearCertificates()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • certificates

      public BUILDER certificates(Resource certificates)
      Read one or more certificates in PEM format from a resource definition. Used eg: in a trust store.
      Parameters:
      certificates - key resource (file, classpath, URL etc.)
      Returns:
      updated builder instance
      See Also:
    • certificates

      public BUILDER certificates(ResourceConfig certificatesConfig)
      Read one or more certificates in PEM format from a resource definition. Used eg: in a trust store.
      Parameters:
      certificatesConfig - key resource (file, classpath, URL etc.)
      Returns:
      updated builder instance
      See Also:
    • certificates

      public BUILDER certificates(Consumer<ResourceConfig.Builder> consumer)
      Read one or more certificates in PEM format from a resource definition. Used eg: in a trust store.
      Parameters:
      consumer - key resource (file, classpath, URL etc.)
      Returns:
      updated builder instance
      See Also:
    • key

      public Optional<Resource> key()
      Read a private key from PEM format from a resource definition.
      Returns:
      the key
    • keyPassphrase

      public Optional<char[]> keyPassphrase()
      Passphrase for private key. If the key is encrypted (and in PEM PKCS#8 format), this passphrase will be used to decrypt it.
      Returns:
      the key passphrase
    • publicKey

      public Optional<Resource> publicKey()
      Read a public key from PEM format from a resource definition.
      Returns:
      the public key
    • certChain

      public Optional<Resource> certChain()
      Load certificate chain from PEM resource.
      Returns:
      the cert chain
    • certificates

      public Optional<Resource> certificates()
      Read one or more certificates in PEM format from a resource definition. Used eg: in a trust store.
      Returns:
      the certificates
    • config

      public Optional<Config> config()
      If this instance was configured, this would be the config instance used.
      Returns:
      config node used to configure this builder, or empty if not configured
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.