Class EnvironmentStringDigesterConfig
- Object
-
- org.jasypt.digest.config.SimpleDigesterConfig
-
- org.jasypt.digest.config.EnvironmentDigesterConfig
-
- org.jasypt.digest.config.EnvironmentStringDigesterConfig
-
- All Implemented Interfaces:
DigesterConfig,StringDigesterConfig
public class EnvironmentStringDigesterConfig extends EnvironmentDigesterConfig implements StringDigesterConfig
Implementation for
StringDigesterConfigwhich can retrieve configuration values from environment variables or system properties.The name of the environment variable or system property (JVM property) to query for each parameter can be set with its corresponding setXEnvName or setXSysProperty method.
As this class extends
SimpleDigesterConfig, parameter values can be also set with the usual setX methods.For any of the configuration parameters, if its value is not configured in any way, a null value will be returned by the corresponding getX method.
- Since:
- 1.3
- Author:
- Daniel Fernández
-
-
Constructor Summary
Constructors Constructor Description EnvironmentStringDigesterConfig()Creates a new EnvironmentStringDigesterConfig instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetPrefix()Adds the returned (plain) prefix at the beginning of generated digests, and also expects to find it in any plain message provided for matching operations (raising anEncryptionOperationNotPossibleExceptionif not).StringgetPrefixEnvName()Retrieve the name of the environment variable which value has been loaded as a value for the "prefix" parameter.StringgetPrefixSysPropertyName()Retrieve the name of the JVM system property which value has been loaded as a value for the "prefix" parameter.StringgetStringOutputType()This parameter lets the user specify the form in which String output will be encoded.StringgetStringOutputTypeEnvName()Retrieve the name of the environment variable which value has been loaded as the String output type.StringgetStringOutputTypeSysPropertyName()Retrieve the name of the JVM system property which value has been loaded as the String output type.StringgetSuffix()Adds the returned (plain) suffix at the end of generated digests, and also expects to find it in any plain message provided for matching operations (raising anEncryptionOperationNotPossibleExceptionif not).StringgetSuffixEnvName()Retrieve the name of the environment variable which value has been loaded as a value for the "suffix" parameter.StringgetSuffixSysPropertyName()Retrieve the name of the JVM system property which value has been loaded as a value for the "suffix" parameter.StringgetUnicodeNormalizationIgnoredEnvName()Retrieve the name of the environment variable which value has been loaded as a value for the "unicode normalization ignored" parameter.StringgetUnicodeNormalizationIgnoredSysPropertyName()Retrieve the name of the JVM system property which value has been loaded as a value for the "unicode normalization ignored" parameter.BooleanisUnicodeNormalizationIgnored()This parameter lets the user specify if the Unicode text normalization step performed during String digest and matching should be ignored.voidsetPrefix(String prefix)Sets the prefix to be added at the beginning of encryption results, and also to be expected at the beginning of plain messages provided for matching operations (raising anEncryptionOperationNotPossibleExceptionif not).voidsetPrefixEnvName(String prefixEnvName)Set the config object to use the specified environment variable to load the value for the "prefix" parameter.voidsetPrefixSysPropertyName(String prefixSysPropertyName)Set the config object to use the specified JVM system property to load a value for the "prefix" parameter.voidsetStringOutputType(String stringOutputType)Sets the the form in which String output will be encoded.voidsetStringOutputTypeEnvName(String stringOutputTypeEnvName)Set the config object to use the specified environment variable to load the value for the String output type.voidsetStringOutputTypeSysPropertyName(String stringOutputTypeSysPropertyName)Set the config object to use the specified JVM system property to load the value for the String output type.voidsetSuffix(String suffix)Sets the suffix to be added at the end of encryption results, and also to be expected at the end of plain messages provided for matching operations (raising anEncryptionOperationNotPossibleExceptionif not).voidsetSuffixEnvName(String suffixEnvName)Set the config object to use the specified environment variable to load the value for the "suffix" parameter.voidsetSuffixSysPropertyName(String suffixSysPropertyName)Set the config object to use the specified JVM system property to load a value for the "suffix" parameter.voidsetUnicodeNormalizationIgnored(Boolean unicodeNormalizationIgnored)Sets whether the unicode text normalization step should be ignored.voidsetUnicodeNormalizationIgnored(String unicodeNormalizationIgnored)Sets whether the unicode text normalization step should be ignored.voidsetUnicodeNormalizationIgnoredEnvName(String unicodeNormalizationIgnoredEnvName)Set the config object to use the specified environment variable to load the value for the "unicode normalization ignored" parameter.voidsetUnicodeNormalizationIgnoredSysPropertyName(String unicodeNormalizationIgnoredSysPropertyName)Set the config object to use the specified JVM system property to load a value for the "unicode normalization ignored" parameter.-
Methods inherited from class org.jasypt.digest.config.EnvironmentDigesterConfig
getAlgorithmEnvName, getAlgorithmSysPropertyName, getInvertPositionOfPlainSaltInEncryptionResultsEnvName, getInvertPositionOfPlainSaltInEncryptionResultsSysPropertyName, getInvertPositionOfSaltInMessageBeforeDigestingEnvName, getInvertPositionOfSaltInMessageBeforeDigestingSysPropertyName, getIterationsEnvName, getIterationsSysPropertyName, getPoolSizeEnvName, getPoolSizeSysPropertyName, getProviderClassNameEnvName, getProviderClassNameSysPropertyName, getProviderNameEnvName, getProviderNameSysPropertyName, getSaltGeneratorClassNameEnvName, getSaltGeneratorClassNameSysPropertyName, getSaltSizeBytesEnvName, getSaltSizeBytesSysPropertyName, getUseLenientSaltSizeCheckEnvName, getUseLenientSaltSizeCheckSysPropertyName, setAlgorithm, setAlgorithmEnvName, setAlgorithmSysPropertyName, setInvertPositionOfPlainSaltInEncryptionResults, setInvertPositionOfPlainSaltInEncryptionResultsEnvName, setInvertPositionOfPlainSaltInEncryptionResultsSysPropertyName, setInvertPositionOfSaltInMessageBeforeDigesting, setInvertPositionOfSaltInMessageBeforeDigestingEnvName, setInvertPositionOfSaltInMessageBeforeDigestingSysPropertyName, setIterations, setIterations, setIterationsEnvName, setIterationsSysPropertyName, setPoolSize, setPoolSize, setPoolSizeEnvName, setPoolSizeSysPropertyName, setProvider, setProviderClassName, setProviderClassNameEnvName, setProviderClassNameSysPropertyName, setProviderName, setProviderNameEnvName, setProviderNameSysPropertyName, setSaltGenerator, setSaltGeneratorClassName, setSaltGeneratorClassNameEnvName, setSaltGeneratorClassNameSysPropertyName, setSaltSizeBytes, setSaltSizeBytes, setSaltSizeBytesEnvName, setSaltSizeBytesSysPropertyName, setUseLenientSaltSizeCheck, setUseLenientSaltSizeCheckEnvName, setUseLenientSaltSizeCheckSysPropertyName
-
Methods inherited from class org.jasypt.digest.config.SimpleDigesterConfig
getAlgorithm, getInvertPositionOfPlainSaltInEncryptionResults, getInvertPositionOfSaltInMessageBeforeDigesting, getIterations, getPoolSize, getProvider, getProviderName, getSaltGenerator, getSaltSizeBytes, getUseLenientSaltSizeCheck
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jasypt.digest.config.DigesterConfig
getAlgorithm, getInvertPositionOfPlainSaltInEncryptionResults, getInvertPositionOfSaltInMessageBeforeDigesting, getIterations, getPoolSize, getProvider, getProviderName, getSaltGenerator, getSaltSizeBytes, getUseLenientSaltSizeCheck
-
-
-
-
Method Detail
-
getUnicodeNormalizationIgnoredEnvName
public String getUnicodeNormalizationIgnoredEnvName()
Retrieve the name of the environment variable which value has been loaded as a value for the "unicode normalization ignored" parameter.- Returns:
- the name of the variable
-
setUnicodeNormalizationIgnoredEnvName
public void setUnicodeNormalizationIgnoredEnvName(String unicodeNormalizationIgnoredEnvName)
Set the config object to use the specified environment variable to load the value for the "unicode normalization ignored" parameter.- Parameters:
unicodeNormalizationIgnoredEnvName- the name of the environment variable
-
getUnicodeNormalizationIgnoredSysPropertyName
public String getUnicodeNormalizationIgnoredSysPropertyName()
Retrieve the name of the JVM system property which value has been loaded as a value for the "unicode normalization ignored" parameter.- Returns:
- the name of the property
-
setUnicodeNormalizationIgnoredSysPropertyName
public void setUnicodeNormalizationIgnoredSysPropertyName(String unicodeNormalizationIgnoredSysPropertyName)
Set the config object to use the specified JVM system property to load a value for the "unicode normalization ignored" parameter.- Parameters:
unicodeNormalizationIgnoredSysPropertyName- the name of the property
-
getStringOutputTypeEnvName
public String getStringOutputTypeEnvName()
Retrieve the name of the environment variable which value has been loaded as the String output type.- Returns:
- the name of the variable
-
setStringOutputTypeEnvName
public void setStringOutputTypeEnvName(String stringOutputTypeEnvName)
Set the config object to use the specified environment variable to load the value for the String output type.- Parameters:
stringOutputTypeEnvName- the name of the environment variable
-
getStringOutputTypeSysPropertyName
public String getStringOutputTypeSysPropertyName()
Retrieve the name of the JVM system property which value has been loaded as the String output type.- Returns:
- the name of the property
-
setStringOutputTypeSysPropertyName
public void setStringOutputTypeSysPropertyName(String stringOutputTypeSysPropertyName)
Set the config object to use the specified JVM system property to load the value for the String output type.- Parameters:
stringOutputTypeSysPropertyName- the name of the property
-
setUnicodeNormalizationIgnored
public void setUnicodeNormalizationIgnored(Boolean unicodeNormalizationIgnored)
Sets whether the unicode text normalization step should be ignored.
The Java Virtual Machine internally handles all Strings as UNICODE. When digesting or matching digests in jasypt, these Strings are first normalized to its NFC form so that digest matching is not affected by the specific form in which the messages where input.
It is normally safe (and recommended) to leave this parameter set to its default FALSE value (and thus DO perform normalization operations). But in some specific cases in which issues with legacy software could arise, it might be useful to set this to TRUE.
For more information on unicode text normalization, see this issue of Core Java Technologies Tech Tips.
If not set, null will be returned.
- Parameters:
unicodeNormalizationIgnored- whether the unicode text normalization step should be ignored or not.
-
setUnicodeNormalizationIgnored
public void setUnicodeNormalizationIgnored(String unicodeNormalizationIgnored)
Sets whether the unicode text normalization step should be ignored.
The Java Virtual Machine internally handles all Strings as UNICODE. When digesting or matching digests in jasypt, these Strings are first normalized to its NFC form so that digest matching is not affected by the specific form in which the messages where input.
It is normally safe (and recommended) to leave this parameter set to its default FALSE value (and thus DO perform normalization operations). But in some specific cases in which issues with legacy software could arise, it might be useful to set this to TRUE.
For more information on unicode text normalization, see this issue of Core Java Technologies Tech Tips.
If not set, null will be returned.
- Parameters:
unicodeNormalizationIgnored- whether the unicode text normalization step should be ignored or not.- Since:
- 1.4
-
setStringOutputType
public void setStringOutputType(String stringOutputType)
Sets the the form in which String output will be encoded. Available encoding types are:
- base64 (default)
- hexadecimal
If not set, null will be returned.
- Parameters:
stringOutputType- the string output type.
-
setPrefix
public void setPrefix(String prefix)
Sets the prefix to be added at the beginning of encryption results, and also to be expected at the beginning of plain messages provided for matching operations (raising an
EncryptionOperationNotPossibleExceptionif not).If not set, null will be returned.
Determines the result of:
getPrefix()- Parameters:
prefix-- Since:
- 1.7
-
setSuffix
public void setSuffix(String suffix)
Sets the suffix to be added at the end of encryption results, and also to be expected at the end of plain messages provided for matching operations (raising an
EncryptionOperationNotPossibleExceptionif not).If not set, null will be returned.
Determines the result of:
getSuffix()- Parameters:
suffix-- Since:
- 1.7
-
isUnicodeNormalizationIgnored
public Boolean isUnicodeNormalizationIgnored()
Description copied from interface:StringDigesterConfigThis parameter lets the user specify if the Unicode text normalization step performed during String digest and matching should be ignored.
The Java Virtual Machine internally handles all Strings as UNICODE. When digesting or matching digests in jasypt, these Strings are first normalized to its NFC form so that digest matching is not affected by the specific form in which the messages where input.
It is normally safe (and recommended) to leave this parameter set to its default FALSE value (and thus DO perform normalization operations). But in some specific cases in which issues with legacy software could arise, it might be useful to set this to TRUE.
For more information on unicode text normalization, see this issue of Core Java Technologies Tech Tips.
- Specified by:
isUnicodeNormalizationIgnoredin interfaceStringDigesterConfig- Returns:
- whether the unicode text normalization step should be ignored or not.
-
getStringOutputType
public String getStringOutputType()
Description copied from interface:StringDigesterConfigThis parameter lets the user specify the form in which String output will be encoded. Available encoding types are:
- base64 (default)
- hexadecimal
- Specified by:
getStringOutputTypein interfaceStringDigesterConfig- Returns:
- The name of the encoding type for String output
-
getPrefix
public String getPrefix()
Description copied from interface:StringDigesterConfigAdds the returned (plain) prefix at the beginning of generated digests, and also expects to find it in any plain message provided for matching operations (raising an
EncryptionOperationNotPossibleExceptionif not).- Specified by:
getPrefixin interfaceStringDigesterConfig- Returns:
- the prefix to be added to all digests
-
getSuffix
public String getSuffix()
Description copied from interface:StringDigesterConfigAdds the returned (plain) suffix at the end of generated digests, and also expects to find it in any plain message provided for matching operations (raising an
EncryptionOperationNotPossibleExceptionif not).- Specified by:
getSuffixin interfaceStringDigesterConfig- Returns:
- the suffix to be added to all digests
-
getPrefixEnvName
public String getPrefixEnvName()
Retrieve the name of the environment variable which value has been loaded as a value for the "prefix" parameter.- Returns:
- the name of the variable
- Since:
- 1.7
-
setPrefixEnvName
public void setPrefixEnvName(String prefixEnvName)
Set the config object to use the specified environment variable to load the value for the "prefix" parameter.- Parameters:
prefixEnvName- the name of the environment variable- Since:
- 1.7
-
getPrefixSysPropertyName
public String getPrefixSysPropertyName()
Retrieve the name of the JVM system property which value has been loaded as a value for the "prefix" parameter.- Returns:
- the name of the property
- Since:
- 1.7
-
setPrefixSysPropertyName
public void setPrefixSysPropertyName(String prefixSysPropertyName)
Set the config object to use the specified JVM system property to load a value for the "prefix" parameter.- Parameters:
prefixSysPropertyName- the name of the property- Since:
- 1.7
-
getSuffixEnvName
public String getSuffixEnvName()
Retrieve the name of the environment variable which value has been loaded as a value for the "suffix" parameter.- Returns:
- the name of the variable
- Since:
- 1.7
-
setSuffixEnvName
public void setSuffixEnvName(String suffixEnvName)
Set the config object to use the specified environment variable to load the value for the "suffix" parameter.- Parameters:
suffixEnvName- the name of the environment variable- Since:
- 1.7
-
getSuffixSysPropertyName
public String getSuffixSysPropertyName()
Retrieve the name of the JVM system property which value has been loaded as a value for the "suffix" parameter.- Returns:
- the name of the property
- Since:
- 1.7
-
setSuffixSysPropertyName
public void setSuffixSysPropertyName(String suffixSysPropertyName)
Set the config object to use the specified JVM system property to load a value for the "suffix" parameter.- Parameters:
suffixSysPropertyName- the name of the property- Since:
- 1.7
-
-