public class AESUtil extends Object
| Constructor and Description |
|---|
AESUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
aesDecryptByBytes(byte[] encryptBytes,
String decryptKey)
AES解密
|
static byte[] |
aesEncryptToBytes(String content,
String encryptKey)
AES加密
|
static byte[] |
base64Decode(String base64Code)
base 64 decode
|
static String |
base64Encode(byte[] bytes)
base 64 encode
|
static String |
decrypt(String encryptStr,
String decryptKey)
将base 64 code AES解密
|
static String |
encrypt(String content,
String encryptKey)
AES加密为base 64 code
|
public static String base64Encode(byte[] bytes)
bytes - 待编码的byte[]public static byte[] base64Decode(String base64Code) throws Exception
base64Code - 待解码的base 64 codeExceptionpublic static byte[] aesEncryptToBytes(String content, String encryptKey) throws Exception
content - 待加密的内容encryptKey - 加密密钥Exceptionpublic static String encrypt(String content, String encryptKey) throws Exception
content - 待加密的内容encryptKey - 加密密钥,必须16位Exceptionpublic static String aesDecryptByBytes(byte[] encryptBytes, String decryptKey) throws Exception
encryptBytes - 待解密的byte[]decryptKey - 解密密钥ExceptionCopyright © 2020. All rights reserved.