类 SaSecureUtil
java.lang.Object
cn.dev33.satoken.secure.SaSecureUtil
Sa-Token 常见加密算法工具类
- 从以下版本开始:
- 1.14.0
- 作者:
- click33
-
方法概要
修饰符和类型方法说明static StringaesDecrypt(String key, String text) AES解密static StringaesEncrypt(String key, String text) AES加密static Stringmd5加密static String已过时。static StringrsaDecryptByPrivate(String privateKeyString, String content) 已过时。static StringrsaDecryptByPublic(String publicKeyString, String content) 已过时。static StringrsaEncryptByPrivate(String privateKeyString, String content) 已过时。static StringrsaEncryptByPublic(String publicKeyString, String content) 已过时。已过时。static Stringsha1加密static Stringsha256加密static Stringsha256BySalt(String str, String salt) 已过时。static Stringsha384加密static Stringsha512加密
-
方法详细资料
-
md5
md5加密- 参数:
str- 指定字符串- 返回:
- 加密后的字符串
-
sha1
sha1加密- 参数:
str- 指定字符串- 返回:
- 加密后的字符串
-
sha256
sha256加密- 参数:
str- 指定字符串- 返回:
- 加密后的字符串
-
sha384
sha384加密- 参数:
str- 指定字符串- 返回:
- 加密后的字符串
-
sha512
sha512加密- 参数:
str- 指定字符串- 返回:
- 加密后的字符串
-
md5BySalt
已过时。md5加盐加密: md5(md5(str) + md5(salt))- 参数:
str- 字符串salt- 盐- 返回:
- 加密后的字符串
-
sha256BySalt
已过时。sha256加盐加密: sha256(sha256(str) + sha256(salt))- 参数:
str- 字符串salt- 盐- 返回:
- 加密后的字符串
-
aesEncrypt
AES加密- 参数:
key- 加密的密钥text- 需要加密的字符串- 返回:
- 返回Base64转码后的加密数据
-
aesDecrypt
AES解密- 参数:
key- 加密的密钥text- 已加密的密文- 返回:
- 返回解密后的数据
-
rsaGenerateKeyPair
已过时。生成密钥对- 返回:
- Map对象 (private=私钥, public=公钥)
- 抛出:
Exception- 异常
-
rsaEncryptByPublic
已过时。RSA公钥加密- 参数:
publicKeyString- 公钥content- 内容- 返回:
- 加密后内容
-
rsaEncryptByPrivate
已过时。RSA私钥加密- 参数:
privateKeyString- 私钥content- 内容- 返回:
- 加密后内容
-
rsaDecryptByPublic
已过时。RSA公钥解密- 参数:
publicKeyString- 公钥content- 已加密内容- 返回:
- 解密后内容
-
rsaDecryptByPrivate
已过时。RSA私钥解密- 参数:
privateKeyString- 公钥content- 已加密内容- 返回:
- 解密后内容
-