public class AesUtil extends Object
| 构造器和说明 |
|---|
AesUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
aesDecrypt(String encryptStr,
String decryptKey)
将base 64 code AES解密
|
static String |
aesDecrypt1(String str,
String key) |
static String |
aesDecryptByBytes(byte[] encryptBytes,
String decryptKey)
AES解密
|
static String |
aesEncrypt(String content,
String encryptKey)
AES加密为base 64 code
|
static String |
aesEncrypt1(String str,
String key) |
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 void |
main(String[] args) |
static byte[] |
md5(byte[] bytes)
获取byte[]的md5值
|
static byte[] |
md5(String msg)
获取字符串md5值
|
static String |
md5Encrypt(String msg)
结合base64实现md5加密
|
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 - 异常public static byte[] md5(byte[] bytes)
throws Exception
bytes - byte[]Exception - 异常public static byte[] md5(String msg) throws Exception
msg - 要加密的字符串Exception - 异常public static String md5Encrypt(String msg) throws Exception
msg - 待加密字符串Exception - 异常public static byte[] aesEncryptToBytes(String content, String encryptKey) throws Exception
content - 待加密的内容encryptKey - 加密密钥Exception - 异常public static String aesEncrypt(String content, String encryptKey) throws Exception
content - 待加密的内容encryptKey - 加密密钥Exception - 异常public static String aesDecryptByBytes(byte[] encryptBytes, String decryptKey) throws Exception
encryptBytes - 待解密的byte[]decryptKey - 解密密钥Exception - 异常Copyright © 2024. All rights reserved.