Update javadoc for AesBytesEncrytor constructors

Update AesBytesEncryptor constructors' javadoc to:
1. mention default IV length and encryption mode,
2. provide links to appropriate constructors that allow users to
specify custom IV and encryption mode.

Related to gh-3879 and gh-9361
This commit is contained in:
Prashant Tholia 2021-04-02 23:44:43 +05:30 committed by Josh Cummings
parent 67fdac1db1
commit 3c33535681
1 changed files with 11 additions and 2 deletions

View File

@ -55,7 +55,13 @@ public final class AesBytesEncryptor implements BytesEncryptor {
/** /**
* Constructs an encryptor that uses AES encryption. Example: <code> * Constructs an encryptor that uses AES encryption. Example: <code>
* AesBytesEncryptor encryptor = new AesBytesEncryptor(yourPassword, 5c0744940b5c369b); * AesBytesEncryptor encryptor = new AesBytesEncryptor(yourPassword, 5c0744940b5c369b);
* </code> * </code> Constructed encryptor uses a 16-byte IV and CBC mode encryption. To specify
* a custom length IV, use
* {@link AesBytesEncryptor#AesBytesEncryptor(String, CharSequence, BytesKeyGenerator)
* AesBytesEncryptor(String, CharSequence, BytesKeyGenerator)}. To specify both, a
* custom length IV and a different encryption mode, use
* {@link AesBytesEncryptor#AesBytesEncryptor(String, CharSequence, BytesKeyGenerator, CipherAlgorithm)
* AesBytesEncryptor(String, CharSequence, BytesKeyGenerator, CipherAlgorithm)}.
* @param password the password value * @param password the password value
* @param salt the hex-encoded salt value * @param salt the hex-encoded salt value
*/ */
@ -67,7 +73,10 @@ public final class AesBytesEncryptor implements BytesEncryptor {
* Constructs an encryptor that uses AES encryption. Example: <code> * Constructs an encryptor that uses AES encryption. Example: <code>
* AesBytesEncryptor encryptor = * AesBytesEncryptor encryptor =
* new AesBytesEncryptor(yourPassword, 5c0744940b5c369b, KeyGenerators.secureRandom(16)); * new AesBytesEncryptor(yourPassword, 5c0744940b5c369b, KeyGenerators.secureRandom(16));
* </code> * </code> Constructed encryptor uses CBC mode encryption. To specify a different
* encryption mode, use
* {@link AesBytesEncryptor#AesBytesEncryptor(String, CharSequence, BytesKeyGenerator, CipherAlgorithm)
* AesBytesEncryptor(String, CharSequence, BytesKeyGenerator, CipherAlgorithm)}.
* @param password the password value * @param password the password value
* @param salt the hex-encoded salt value * @param salt the hex-encoded salt value
* @param ivGenerator the generator used to generate the initialization vector * @param ivGenerator the generator used to generate the initialization vector