Class FixedStringSaltGenerator
java.lang.Object
org.jasypt.salt.FixedStringSaltGenerator
- All Implemented Interfaces:
SaltGenerator
Deprecated.
This implementation of SaltGenerator always returns a fixed salt
set by the user as a String, which is returned as salt bytes using the
specified charset for conversion (UTF-8 by default).
If the requested salt has a size in bytes smaller than the specified salt, the first n bytes are returned. If it is larger, an exception is thrown.
This class is thread-safe.
- Since:
- 1.2
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Creates a new instance of FixedStringSaltGenerator -
Method Summary
Modifier and TypeMethodDescriptionbyte[]generateSalt(int lengthBytes) Deprecated.Return salt with the specified byte length.booleanDeprecated.As this salt generator provides a fixed salt, its inclusion unencrypted in encryption results is not necessary, and in fact not desirable (so that it remains hidden).voidsetCharset(String charset) Deprecated.Sets the charset to be applied to the salt for conversion into bytes.voidDeprecated.Sets the salt to be returned.
-
Field Details
-
DEFAULT_CHARSET
-
salt
Deprecated. -
charset
Deprecated. -
saltBytes
private byte[] saltBytesDeprecated.
-
-
Constructor Details
-
FixedStringSaltGenerator
public FixedStringSaltGenerator()Deprecated.Creates a new instance of FixedStringSaltGenerator
-
-
Method Details
-
setSalt
Deprecated.Sets the salt to be returned.- Parameters:
salt- the specified salt.
-
setCharset
Deprecated.Sets the charset to be applied to the salt for conversion into bytes.- Parameters:
charset- the specified charset
-
generateSalt
public byte[] generateSalt(int lengthBytes) Deprecated.Return salt with the specified byte length.- Specified by:
generateSaltin interfaceSaltGenerator- Parameters:
lengthBytes- length in bytes.- Returns:
- the generated salt.
-
includePlainSaltInEncryptionResults
public boolean includePlainSaltInEncryptionResults()Deprecated.As this salt generator provides a fixed salt, its inclusion unencrypted in encryption results is not necessary, and in fact not desirable (so that it remains hidden).- Specified by:
includePlainSaltInEncryptionResultsin interfaceSaltGenerator- Returns:
- false
-
StringFixedSaltGenerator, which implements the newFixedSaltGeneratorinterface and therefore is able to benefit from the performance improvements associated with it. This class will be removed in 1.10.0 (or 2.0.0).