public class AESEncryptionUtils extends Object
| Constructor and Description |
|---|
AESEncryptionUtils() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(byte[] bytes,
byte[] iv,
SecretKey secret)
Decrypt given data using AES/CBC/PKCS7Padding with given initialization
vector and secret key.
|
byte[] |
decrypt(byte[] bytes,
byte[] iv,
SecretKey secret,
String padding)
Decrypt given data using give padding with given initialization
vector and secret key.
|
byte[] |
encrypt(byte[] bytes,
byte[] iv,
SecretKey secret)
Encrypt given data using AES/CBC/PKCS7Padding with given initialization
vector and secret key.
|
byte[] |
encrypt(byte[] bytes,
byte[] iv,
SecretKey secret,
String padding)
Encrypt given data using given padding with given initialization
vector and secret key.
|
public byte[] encrypt(byte[] bytes,
byte[] iv,
SecretKey secret,
String padding)
throws InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException
bytes - Bytes to be encrypted.iv - Initialization vector.secret - Secret signature key.padding - Padding to be used, for example "AES/CBC/PKCS7Padding".InvalidKeyException - In case an invalid key is provided.IllegalBlockSizeException - In case invalid key size is provided.BadPaddingException - In case invalid padding is provided.public byte[] encrypt(byte[] bytes,
byte[] iv,
SecretKey secret)
throws InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException
bytes - Bytes to be encrypted.iv - Initialization vector.secret - Secret signature key.InvalidKeyException - In case an invalid key is provided.IllegalBlockSizeException - In case invalid key size is provided.BadPaddingException - In case invalid padding is provided.public byte[] decrypt(byte[] bytes,
byte[] iv,
SecretKey secret,
String padding)
throws InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException
bytes - Encrypted bytes to be decrypted.iv - Initialization vector.secret - Secret signature key.padding - Padding to be used, for example "AES/CBC/PKCS7Padding".InvalidKeyException - In case an invalid key is provided.IllegalBlockSizeException - In case invalid key size is provided.BadPaddingException - In case invalid padding is provided.public byte[] decrypt(byte[] bytes,
byte[] iv,
SecretKey secret)
throws InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException
bytes - Encrypted bytes to be decrypted.iv - Initialization vector.secret - Secret signature key.InvalidKeyException - In case an invalid key is provided.IllegalBlockSizeException - In case invalid key size is provided.BadPaddingException - In case invalid padding is provided.Copyright © 2016 Lime - HighTech Solutions Inc.. All rights reserved.