Package org.jasypt.salt
Class FixedByteArraySaltGenerator
- Object
-
- org.jasypt.salt.FixedByteArraySaltGenerator
-
- All Implemented Interfaces:
SaltGenerator
public class FixedByteArraySaltGenerator extends Object implements SaltGenerator
Deprecated.Deprecated in 1.9.2 in favour ofByteArrayFixedSaltGenerator
, which implements the newFixedSaltGenerator
interface 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).This implementation of
SaltGenerator
always returns a fixed salt set by the user.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
- Author:
- Daniel Fernández
-
-
Constructor Summary
Constructors Constructor Description FixedByteArraySaltGenerator()
Deprecated.Creates a new instance of FixedByteArraySaltGenerator
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description byte[]
generateSalt(int lengthBytes)
Deprecated.Return salt with the specified byte length.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).void
setSalt(byte[] salt)
Deprecated.Sets the salt to be returned.
-
-
-
Method Detail
-
setSalt
public void setSalt(byte[] salt)
Deprecated.Sets the salt to be returned.- Parameters:
salt
- the specified salt.
-
generateSalt
public byte[] generateSalt(int lengthBytes)
Deprecated.Return salt with the specified byte length.- Specified by:
generateSalt
in 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:
includePlainSaltInEncryptionResults
in interfaceSaltGenerator
- Returns:
- false
-
-