Package org.apache.nifi.security.util
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
SSLContext
s.-
Method Summary
Modifier and TypeMethodDescriptionString[]
Get Enabled TLS Protocol VersionsReturns the "working" key password -- if the key password is populated, it is returned; otherwise thegetKeystorePassword()
is returned.Returns"********"
if the functional key password is populated,"null"
if not.Returns"********"
if the key password is populated,"null"
if not.Returns"********"
if the keystore password is populated,"null"
if not.String[]
Returns aString[]
containing the keystore properties for logging.Returns"********"
if the truststore password is populated,"null"
if not.String[]
Returns aString[]
containing the truststore properties for logging.boolean
Returnstrue
if any of the keystore properties is populated, indicating that the caller expects a valid keystore to be generated.boolean
Returnstrue
if any of the truststore properties is populated, indicating that the caller expects a valid truststore to be generated.static boolean
isEmpty
(TlsConfiguration tlsConfiguration) Returnstrue
if the provided TlsConfiguration isnull
or empty (i.e.boolean
Returnstrue
if the necessary properties are populated to instantiate a keystore.boolean
Returnstrue
if the necessary properties are populated and the keystore can be successfully instantiated (i.e.boolean
Returnstrue
if the necessary properties are populated to instantiate a truststore.boolean
Returnstrue
if the necessary properties are populated and the truststore can be successfully instantiated (i.e.
-
Method Details
-
isEmpty
Returnstrue
if the provided TlsConfiguration isnull
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 thegetKeystorePassword()
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()Returnstrue
if the necessary properties are populated to instantiate a keystore. This does not validate the values (seeisKeystoreValid()
).- Returns:
- true if the path, password, and type are present
-
isAnyKeystorePopulated
boolean isAnyKeystorePopulated()Returnstrue
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()Returnstrue
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()Returnstrue
if the necessary properties are populated to instantiate a truststore. This does not validate the values (seeisTruststoreValid()
).- Returns:
- true if the path, password, and type are present
-
isAnyTruststorePopulated
boolean isAnyTruststorePopulated()Returnstrue
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()Returnstrue
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 aString[]
containing the keystore properties for logging. The order isgetKeystorePath()
,getKeystorePasswordForLogging()
,getFunctionalKeyPasswordForLogging()
,getKeystoreType()
(using the type or "null").- Returns:
- a loggable String[]
-
getTruststorePropertiesForLogging
String[] getTruststorePropertiesForLogging()Returns aString[]
containing the truststore properties for logging. The order isgetTruststorePath()
,getTruststorePasswordForLogging()
,getTruststoreType()
(using the type or "null").- Returns:
- a loggable String[]
-
getEnabledProtocols
String[] getEnabledProtocols()Get Enabled TLS Protocol Versions- Returns:
- Enabled TLS Protocols
-