Package org.jasypt.salt
Class ZeroSaltGenerator
- Object
-
- org.jasypt.salt.ZeroSaltGenerator
-
- All Implemented Interfaces:
SaltGenerator
public class ZeroSaltGenerator extends Object implements SaltGenerator
This implementation of
SaltGenerator
always returns a salt of the required length, filled with zero bytes.This class is thread-safe.
- Since:
- 1.4
- Author:
- Daniel Fernández
-
-
Constructor Summary
Constructors Constructor Description ZeroSaltGenerator()
Creates a new instance of ZeroSaltGenerator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
generateSalt(int lengthBytes)
Return salt with the specified byte length.boolean
includePlainSaltInEncryptionResults()
As this salt generator provides a predictable salt, its inclusion unencrypted in encryption results is not necessary, and in fact not desirable (so that it remains hidden).
-
-
-
Method Detail
-
generateSalt
public byte[] generateSalt(int lengthBytes)
Return salt with the specified byte length. This will return an array of zero bytes, with the specified length.- Specified by:
generateSalt
in interfaceSaltGenerator
- Parameters:
lengthBytes
- length in bytes.- Returns:
- the generated salt.
-
includePlainSaltInEncryptionResults
public boolean includePlainSaltInEncryptionResults()
As this salt generator provides a predictable 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
-
-