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

java.lang.Object
io.helidon.common.pki.KeystoreKeys.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:
KeystoreKeys.Builder
Enclosing interface:
KeystoreKeys

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

    • BuilderBase

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

    • from

      public BUILDER from(KeystoreKeys 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(KeystoreKeys.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
    • keystorePassphrase

      public BUILDER keystorePassphrase(String passphrase)
      Deprecated.
      use passphrase(String) instead
      Keystore passphrase.
      Parameters:
      passphrase - new keystore passphrase
      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 KeystoreKeys.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends KeystoreKeys>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • keystore

      public BUILDER keystore(Resource keystore)
      Keystore resource definition.
      Parameters:
      keystore - keystore resource, from file path, classpath, URL etc.
      Returns:
      updated builder instance
      See Also:
    • keystore

      public BUILDER keystore(ResourceConfig keystoreConfig)
      Keystore resource definition.
      Parameters:
      keystoreConfig - keystore resource, from file path, classpath, URL etc.
      Returns:
      updated builder instance
      See Also:
    • keystore

      public BUILDER keystore(Consumer<ResourceConfig.Builder> consumer)
      Keystore resource definition.
      Parameters:
      consumer - consumer of builder for keystore resource, from file path, classpath, URL etc.
      Returns:
      updated builder instance
      See Also:
    • keystore

      public BUILDER keystore(Supplier<? extends Resource> supplier)
      Keystore resource definition.
      Parameters:
      supplier - supplier of keystore resource, from file path, classpath, URL etc.
      Returns:
      updated builder instance
      See Also:
    • type

      public BUILDER type(String type)
      Set type of keystore. Defaults to "PKCS12", expected are other keystore types supported by java then can store keys under aliases.
      Parameters:
      type - keystore type to load the key
      Returns:
      updated builder instance
      See Also:
    • clearPassphrase

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

      public BUILDER passphrase(char[] passphrase)
      Pass-phrase of the keystore (supported with JKS and PKCS12 keystores).
      Parameters:
      passphrase - keystore password to use
      Returns:
      updated builder instance
      See Also:
    • passphrase

      public BUILDER passphrase(String passphrase)
      Pass-phrase of the keystore (supported with JKS and PKCS12 keystores).
      Parameters:
      passphrase - keystore password to use
      Returns:
      updated builder instance
      See Also:
    • clearKeyAlias

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

      public BUILDER keyAlias(String keyAlias)
      Alias of the private key in the keystore.
      Parameters:
      keyAlias - alias of the key in the keystore
      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)
      Pass-phrase of the key in the keystore (used for private keys). This is (by default) the same as keystore passphrase - only configure if it differs from keystore passphrase.
      Parameters:
      keyPassphrase - pass-phrase of the key
      Returns:
      updated builder instance
      See Also:
    • keyPassphrase

      public BUILDER keyPassphrase(String keyPassphrase)
      Pass-phrase of the key in the keystore (used for private keys). This is (by default) the same as keystore passphrase - only configure if it differs from keystore passphrase.
      Parameters:
      keyPassphrase - pass-phrase of the key
      Returns:
      updated builder instance
      See Also:
    • clearCertAlias

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

      public BUILDER certAlias(String certAlias)
      Alias of X.509 certificate of public key. Used to load both the certificate and public key.
      Parameters:
      certAlias - alias under which the certificate is stored in the keystore
      Returns:
      updated builder instance
      See Also:
    • clearCertChainAlias

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

      public BUILDER certChainAlias(String certChainAlias)
      Alias of an X.509 chain.
      Parameters:
      certChainAlias - alias of certificate chain in the keystore
      Returns:
      updated builder instance
      See Also:
    • certAliases

      public BUILDER certAliases(List<? extends String> certAliases)
      List of aliases used to generate a trusted set of certificates.
      Parameters:
      certAliases - aliases of certificates
      Returns:
      updated builder instance
      See Also:
    • addCertAliases

      public BUILDER addCertAliases(List<? extends String> certAliases)
      List of aliases used to generate a trusted set of certificates.
      Parameters:
      certAliases - aliases of certificates
      Returns:
      updated builder instance
      See Also:
    • addCertAlias

      public BUILDER addCertAlias(String certAlias)
      List of aliases used to generate a trusted set of certificates.
      Parameters:
      certAlias - aliases of certificates
      Returns:
      updated builder instance
      See Also:
    • trustStore

      public BUILDER trustStore(boolean trustStore)
      If you want to build a trust store, call this method to add all certificates present in the keystore to certificate list.
      Parameters:
      trustStore - whether this is a trust store
      Returns:
      updated builder instance
      See Also:
    • keystore

      public Optional<Resource> keystore()
      Keystore resource definition.
      Returns:
      the keystore
    • type

      public String type()
      Set type of keystore. Defaults to "PKCS12", expected are other keystore types supported by java then can store keys under aliases.
      Returns:
      the type
    • passphrase

      public Optional<char[]> passphrase()
      Pass-phrase of the keystore (supported with JKS and PKCS12 keystores).
      Returns:
      the passphrase
    • keyAlias

      public Optional<String> keyAlias()
      Alias of the private key in the keystore.
      Returns:
      the key alias
    • keyPassphrase

      public Optional<char[]> keyPassphrase()
      Pass-phrase of the key in the keystore (used for private keys). This is (by default) the same as keystore passphrase - only configure if it differs from keystore passphrase.
      Returns:
      the key passphrase
    • certAlias

      public Optional<String> certAlias()
      Alias of X.509 certificate of public key. Used to load both the certificate and public key.
      Returns:
      the cert alias
    • certChainAlias

      public Optional<String> certChainAlias()
      Alias of an X.509 chain.
      Returns:
      the cert chain alias
    • certAliases

      public List<String> certAliases()
      List of aliases used to generate a trusted set of certificates.
      Returns:
      the cert aliases
    • trustStore

      public boolean trustStore()
      If you want to build a trust store, call this method to add all certificates present in the keystore to certificate list.
      Returns:
      the trust store
    • 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.