Interface TlsConfiguration


public interface TlsConfiguration
This interface serves as an immutable domain object (acting as an internal DTO) for the various keystore and truststore configuration settings necessary for building SSLContexts.
  • Method Details

    • isEmpty

      static boolean isEmpty(TlsConfiguration tlsConfiguration)
      Returns true if the provided TlsConfiguration is null or empty (i.e. neither any of the keystore nor truststore properties are populated).
      Parameters:
      tlsConfiguration - the container object to check
      Returns:
      true if this container is empty or null
    • getKeystorePath

      String getKeystorePath()
    • getKeystorePassword

      String getKeystorePassword()
    • getKeystorePasswordForLogging

      String getKeystorePasswordForLogging()
      Returns "********" if the keystore password is populated, "null" if not.
      Returns:
      a loggable String representation of the keystore password
    • getKeyPassword

      String getKeyPassword()
    • getKeyPasswordForLogging

      String getKeyPasswordForLogging()
      Returns "********" if the key password is populated, "null" if not.
      Returns:
      a loggable String representation of the key password
    • getFunctionalKeyPassword

      String getFunctionalKeyPassword()
      Returns the "working" key password -- if the key password is populated, it is returned; otherwise the getKeystorePassword() is returned.
      Returns:
      the key or keystore password actually populated
    • getFunctionalKeyPasswordForLogging

      String getFunctionalKeyPasswordForLogging()
      Returns "********" if the functional key password is populated, "null" if not.
      Returns:
      a loggable String representation of the functional key password
    • getKeystoreType

      KeystoreType getKeystoreType()
    • getTruststorePath

      String getTruststorePath()
    • getTruststorePassword

      String getTruststorePassword()
    • getTruststorePasswordForLogging

      String getTruststorePasswordForLogging()
      Returns "********" if the truststore password is populated, "null" if not.
      Returns:
      a loggable String representation of the truststore password
    • getTruststoreType

      KeystoreType getTruststoreType()
    • getProtocol

      String getProtocol()
    • isKeystorePopulated

      boolean isKeystorePopulated()
      Returns true if the necessary properties are populated to instantiate a keystore. This does not validate the values (see isKeystoreValid()).
      Returns:
      true if the path, password, and type are present
    • isAnyKeystorePopulated

      boolean isAnyKeystorePopulated()
      Returns true if any of the keystore properties is populated, indicating that the caller expects a valid keystore to be generated.
      Returns:
      true if any keystore properties are present
    • isKeystoreValid

      boolean isKeystoreValid()
      Returns true if the necessary properties are populated and the keystore can be successfully instantiated (i.e. the path is valid and the password(s) are correct).
      Returns:
      true if the keystore properties are valid
    • isTruststorePopulated

      boolean isTruststorePopulated()
      Returns true if the necessary properties are populated to instantiate a truststore. This does not validate the values (see isTruststoreValid()).
      Returns:
      true if the path, password, and type are present
    • isAnyTruststorePopulated

      boolean isAnyTruststorePopulated()
      Returns true if any of the truststore properties is populated, indicating that the caller expects a valid truststore to be generated.
      Returns:
      true if any truststore properties are present
    • isTruststoreValid

      boolean isTruststoreValid()
      Returns true if the necessary properties are populated and the truststore can be successfully instantiated (i.e. the path is valid and the password is correct).
      Returns:
      true if the truststore properties are valid
    • getKeystorePropertiesForLogging

      String[] getKeystorePropertiesForLogging()
      Returns a String[] containing the keystore properties for logging. The order is getKeystorePath(), getKeystorePasswordForLogging(), getFunctionalKeyPasswordForLogging(), getKeystoreType() (using the type or "null").
      Returns:
      a loggable String[]
    • getTruststorePropertiesForLogging

      String[] getTruststorePropertiesForLogging()
      Returns a String[] containing the truststore properties for logging. The order is getTruststorePath(), getTruststorePasswordForLogging(), getTruststoreType() (using the type or "null").
      Returns:
      a loggable String[]
    • getEnabledProtocols

      String[] getEnabledProtocols()
      Get Enabled TLS Protocol Versions
      Returns:
      Enabled TLS Protocols