public class AesEncrypt extends Object
| Constructor and Description |
|---|
AesEncrypt() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decrypt(byte[] data,
SecretKey key,
IvParameterSpec iv,
String cipherName)
Decrypt message with specified secret key, cipher name, init vector and cipher name.
|
static byte[] |
decryptByCTRNoPadding(byte[] data,
byte[] key,
byte[] iv)
Decrypt message with AES/CTR/NoPadding cipher
|
static byte[] |
encrypt(byte[] data,
SecretKey key,
IvParameterSpec iv,
String cipherName)
Encrypt message with specified secret key, cipher name, init vector and cipher name.
|
static byte[] |
encrypt(byte[] data,
SecretKey key,
String cipherName)
Encrypt message with specified secret key and cipher name.
|
static byte[] |
encryptByCTRNoPadding(byte[] data,
byte[] key,
byte[] iv)
Encrypt message with AES/CTR/NoPadding cipher
|
static SecretKey |
loadKey(byte[] key,
String algorithm)
Load secret key with provided key data and specified algorithm
|
public static SecretKey loadKey(byte[] key, String algorithm)
key - specified key data in btye arrayalgorithm - specified algorithmpublic static byte[] encrypt(byte[] data,
SecretKey key,
String cipherName)
data - specified message data in byte arraykey - specified secret keycipherName - specified cipher namepublic static byte[] encrypt(byte[] data,
SecretKey key,
IvParameterSpec iv,
String cipherName)
data - specified message data in byte arraykey - specified secret keyiv - specified init vectorcipherName - specified cipher namepublic static byte[] decrypt(byte[] data,
SecretKey key,
IvParameterSpec iv,
String cipherName)
data - specified cipher message data in byte arraykey - specified secret keyiv - specified init vectorcipherName - specified cipher namepublic static byte[] encryptByCTRNoPadding(byte[] data,
byte[] key,
byte[] iv)
data - specified message data in byte arraykey - specified key in byte arrayiv - specified init vectorpublic static byte[] decryptByCTRNoPadding(byte[] data,
byte[] key,
byte[] iv)
data - specified message data in byte arraykey - specified key in byte arrayiv - specified init vectorCopyright © 2021. All rights reserved.