public final class AesBytesEncryptor extends java.lang.Object implements BytesEncryptor
Modifier and Type | Class and Description |
---|---|
static class |
AesBytesEncryptor.CipherAlgorithm |
Constructor and Description |
---|
AesBytesEncryptor(javax.crypto.SecretKey secretKey,
BytesKeyGenerator ivGenerator,
AesBytesEncryptor.CipherAlgorithm alg)
Constructs an encryptor that uses AES encryption.
|
AesBytesEncryptor(java.lang.String password,
java.lang.CharSequence salt) |
AesBytesEncryptor(java.lang.String password,
java.lang.CharSequence salt,
BytesKeyGenerator ivGenerator) |
AesBytesEncryptor(java.lang.String password,
java.lang.CharSequence salt,
BytesKeyGenerator ivGenerator,
AesBytesEncryptor.CipherAlgorithm alg) |
Modifier and Type | Method and Description |
---|---|
byte[] |
decrypt(byte[] encryptedBytes)
Decrypt the byte array.
|
byte[] |
encrypt(byte[] bytes)
Encrypt the byte array.
|
public AesBytesEncryptor(java.lang.String password, java.lang.CharSequence salt)
public AesBytesEncryptor(java.lang.String password, java.lang.CharSequence salt, BytesKeyGenerator ivGenerator)
public AesBytesEncryptor(java.lang.String password, java.lang.CharSequence salt, BytesKeyGenerator ivGenerator, AesBytesEncryptor.CipherAlgorithm alg)
public AesBytesEncryptor(javax.crypto.SecretKey secretKey, BytesKeyGenerator ivGenerator, AesBytesEncryptor.CipherAlgorithm alg)
secretKey
- the secret (symmetric) keyivGenerator
- the generator used to generate the initialization vector. If
null, then a default algorithm will be used based on the provided
AesBytesEncryptor.CipherAlgorithm
alg
- the AesBytesEncryptor.CipherAlgorithm
to be usedpublic byte[] encrypt(byte[] bytes)
BytesEncryptor
encrypt
in interface BytesEncryptor
public byte[] decrypt(byte[] encryptedBytes)
BytesEncryptor
decrypt
in interface BytesEncryptor