public class AESUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private static String |
ALGORITHMSTR
算法
|
| 构造器和说明 |
|---|
AESUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
aesDecrypt(String encryptStr,
String decryptKey)
将base 64 code AES解密
|
static String |
aesDecryptByBytes(byte[] encryptBytes,
String decryptKey)
AES解密
|
static String |
aesEncrypt(String content,
String encryptKey)
AES加密为base 64 code
|
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 |
binary(byte[] bytes,
int radix)
将byte[]转为各种进制的字符串
|
static String |
getKey()
获取随机key
|
public static String getKey()
public static String binary(byte[] bytes, int radix)
bytes - byte[]radix - 可以转换进制的范围,从Character.MIN_RADIX到Character.MAX_RADIX,超出范围后变为10进制public static String base64Encode(byte[] bytes)
bytes - 待编码的byte[]public static byte[] base64Decode(String base64Code) throws Exception
base64Code - 待解码的base 64 codeException - epublic static byte[] aesEncryptToBytes(String content, String encryptKey) throws Exception
content - 待加密的内容encryptKey - 加密密钥Exception - epublic static String aesEncrypt(String content, String encryptKey) throws Exception
content - 待加密的内容encryptKey - 加密密钥Exception - epublic static String aesDecryptByBytes(byte[] encryptBytes, String decryptKey) throws Exception
encryptBytes - 待解密的byte[]decryptKey - 解密密钥Exception - eCopyright © 2023. All rights reserved.