public final class AesKit extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
ENCRYPT_PREFIX
表明是加密的字符串的前缀标识常量.
|
| 构造器和说明 |
|---|
AesKit() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
decodeBase64(String s)
将 Base64 的字符串转成字节数组.
|
static String |
decrypt(String text)
本插件使用的 AES 默认解密方法.
|
static String |
decrypt(String secretKey,
String text)
AES 解密.
|
static String |
encodeBase64(byte[] bytes)
将字节数组转成 Base64 的字符串.
|
static String |
encrypt(String text)
本插件使用的 AES 默认加密方法.
|
static String |
encrypt(String secretKey,
String text)
AES 加密.
|
static String |
getSecretKey()
获取 AES 的加密、解密的密钥.
|
public static String encrypt(String text)
text - 待加密的文本public static String encrypt(String secretKey, String text)
secretKey - 密钥text - 待加密的文本public static String decrypt(String text)
text - 待加密的文本public static String decrypt(String secretKey, String text)
secretKey - 密钥text - 待解密文本public static String getSecretKey()
这里 AES 的密钥长度为 128.
public static String encodeBase64(byte[] bytes)
bytes - 字节数组public static byte[] decodeBase64(String s)
s - Base64的字符串Copyright © 2019–2020 blinkfox. All rights reserved.