public class StringFixedIVGenerator extends Object implements IVGenerator
String based implementation of IVGenerator, that will
always return the same IV. This IV is returned as bytes using the
specified charset for conversion (UTF-8 by default).
If the requested IV has a size in bytes smaller than the specified IV, the first n bytes are returned. If it is larger, an exception is thrown.
This class is thread-safe.
| Constructor and Description |
|---|
StringFixedIVGenerator(String iv)
Creates a new instance of FixedStringIVGenerator using
the default charset.
|
StringFixedIVGenerator(String iv,
String charset)
Creates a new instance of FixedStringIVGenerator
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
generateIV(int lengthBytes)
Return IV with the specified byte length.
|
boolean |
includePlainIVInEncryptionResults()
As this salt generator provides a fixed IV, its inclusion
unencrypted in encryption results
is not necessary, and in fact not desirable (so that it remains hidden).
|
public StringFixedIVGenerator(String iv)
iv - the specified salt.public StringFixedIVGenerator(String iv,
String charset)
iv - the specified salt.charset - the specified charsetpublic byte[] generateIV(int lengthBytes)
generateIV in interface IVGeneratorlengthBytes - length in bytes.public boolean includePlainIVInEncryptionResults()
includePlainIVInEncryptionResults in interface IVGeneratorCopyright © 2018 The JASYPT team. All rights reserved.