|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.jasypt.salt.RandomSaltGenerator
public class RandomSaltGenerator
This implementation of SaltGenerator
holds a secure random
generator which can be used for generating random salts for encryption
or digesting.
The algorithm used for random number generation can be configured at instantiation time. If not, the default algorithm will be used.
This class is thread-safe.
Field Summary | |
---|---|
static String |
DEFAULT_SECURE_RANDOM_ALGORITHM
The default algorithm to be used for secure random number generation: set to SHA1PRNG. |
Constructor Summary | |
---|---|
RandomSaltGenerator()
Creates a new instance of RandomSaltGenerator using the default secure random number generation algorithm. |
|
RandomSaltGenerator(String secureRandomAlgorithm)
Creates a new instance of RandomSaltGenerator specifying a secure random number generation algorithm. |
Method Summary | |
---|---|
byte[] |
generateSalt(int lengthBytes)
Generate a random salt of the specified length in bytes. |
boolean |
includePlainSaltInEncryptionResults()
This salt generator needs the salt to be included unencrypted in encryption results, because of its being random. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_SECURE_RANDOM_ALGORITHM
Constructor Detail |
---|
public RandomSaltGenerator()
public RandomSaltGenerator(String secureRandomAlgorithm)
Method Detail |
---|
public byte[] generateSalt(int lengthBytes)
generateSalt
in interface SaltGenerator
lengthBytes
- length in bytes.
public boolean includePlainSaltInEncryptionResults()
includePlainSaltInEncryptionResults
in interface SaltGenerator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |