public class RandomIVGenerator extends Object implements IVGenerator
This implementation of IVGenerator holds a secure random
generator which can be used for generating random IVs 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.
| Constructor and Description |
|---|
RandomIVGenerator()
Creates a new instance of RandomIVGenerator using the
default secure random number generation algorithm.
|
RandomIVGenerator(String secureRandomAlgorithm)
Creates a new instance of RandomIVGenerator specifying a
secure random number generation algorithm.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
generateIV(int length)
Generate a random IV of the specified length in bytes.
|
boolean |
includePlainIVInEncryptionResults()
This IV generator needs the salt to be included unencrypted in
encryption results, because of its being random.
|
public RandomIVGenerator()
public RandomIVGenerator(String secureRandomAlgorithm)
public byte[] generateIV(int length)
generateIV in interface IVGeneratorlength - length in bytes.public boolean includePlainIVInEncryptionResults()
includePlainIVInEncryptionResults in interface IVGeneratorCopyright © 2018 The JASYPT team. All rights reserved.