public final class AESUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
KEY_SIZE_128 |
static int |
KEY_SIZE_192 |
static int |
KEY_SIZE_256 |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
decrypt(AES.Mode mode,
String cipherText,
SecretKey key,
IvParameterSpec iv) |
static String |
encrypt(AES.Mode mode,
String input,
SecretKey key,
IvParameterSpec iv) |
static IvParameterSpec |
generateIv() |
static SecretKey |
generateKey() |
static SecretKey |
generateKey(int n) |
static SecretKey |
getKeyFromPassword(String password,
String salt) |
public static final int KEY_SIZE_128
public static final int KEY_SIZE_192
public static final int KEY_SIZE_256
public static SecretKey generateKey() throws NoSuchAlgorithmException
public static SecretKey generateKey(int n) throws NoSuchAlgorithmException
public static SecretKey getKeyFromPassword(String password, String salt) throws NoSuchAlgorithmException, InvalidKeySpecException
public static IvParameterSpec generateIv()
public static String encrypt(AES.Mode mode, String input, SecretKey key, IvParameterSpec iv) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException
public static String decrypt(AES.Mode mode, String cipherText, SecretKey key, IvParameterSpec iv) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException
Copyright © 2022. All rights reserved.