类 AESUtils
java.lang.Object
spring.turbo.util.crypto.AESUtils
- 从以下版本开始:
- 1.0.0
- 作者:
- 应卓
-
字段概要
字段修饰符和类型字段说明static final intstatic final intstatic final int -
方法概要
修饰符和类型方法说明static Stringdecrypt(AES.Mode mode, String cipherText, SecretKey key, IvParameterSpec iv) static Stringencrypt(AES.Mode mode, String input, SecretKey key, IvParameterSpec iv) static IvParameterSpecstatic SecretKeystatic SecretKeygenerateKey(int n) static SecretKeygetKeyFromPassword(String password, String salt)
-
字段详细资料
-
方法详细资料
-
generateKey
-
generateKey
-
getKeyFromPassword
public static SecretKey getKeyFromPassword(String password, String salt) throws NoSuchAlgorithmException, InvalidKeySpecException -
generateIv
-
encrypt
public static String encrypt(AES.Mode mode, String input, SecretKey key, IvParameterSpec iv) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException -
decrypt
public static String decrypt(AES.Mode mode, String cipherText, SecretKey key, IvParameterSpec iv) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException
-