类 EncryptUtils
- java.lang.Object
-
- cloud.longfa.encrypt.util.EncryptUtils
-
public class EncryptUtils extends Object
The type Encrypt utils.- 从以下版本开始:
- : 1.0.0
- 作者:
- : longfa
-
-
字段概要
字段 修饰符和类型 字段 说明 static cn.hutool.crypto.digest.DigesterdigesterThe constant digester.static StringPRIVATE_KEYThe constant PRIVATE_KEY.static StringPUBLIC_KEYThe constant PUBLIC_KEY.static cn.hutool.crypto.asymmetric.RSArsaThe constant rsa.static byte[]SERVER_IVThe constant SERVER_IV.static byte[]SERVER_KEYThe constant SERVER_KEY.static cn.hutool.crypto.symmetric.SymmetricCryptosm4The constant sm4.
-
构造器概要
构造器 构造器 说明 EncryptUtils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static StringaesDecrypt(String encrypt, byte[] key, byte[] iv)aes解密static StringaesEncrypt(String content)aes加密static StringrsaDecrypt(String encrypt)RSA非对称加密解密static StringrsaEncrypt(String content)RSA非对称加密算法static Stringsm3DigesterFile(File file)Sm 3 digester file string.static Stringsm3DigesterObject(String content)Sm 3 digester object string.static Stringsm4Decrypt(String encrypt)过密算法 解密static Stringsm4Encrypt(String context)SM4 国密
-
-
-
字段详细资料
-
SERVER_KEY
public static final byte[] SERVER_KEY
The constant SERVER_KEY.
-
SERVER_IV
public static final byte[] SERVER_IV
The constant SERVER_IV.
-
sm4
public static final cn.hutool.crypto.symmetric.SymmetricCrypto sm4
The constant sm4.
-
rsa
public static cn.hutool.crypto.asymmetric.RSA rsa
The constant rsa.
-
PRIVATE_KEY
public static String PRIVATE_KEY
The constant PRIVATE_KEY.
-
PUBLIC_KEY
public static String PUBLIC_KEY
The constant PUBLIC_KEY.
-
digester
public static final cn.hutool.crypto.digest.Digester digester
The constant digester.
-
-
方法详细资料
-
aesEncrypt
public static String aesEncrypt(String content)
aes加密- 参数:
content- 文本内容跟- 返回:
- 加密字符串 16进制
-
aesDecrypt
public static String aesDecrypt(String encrypt, byte[] key, byte[] iv)
aes解密- 参数:
encrypt- 密文key- 密钥iv- 偏移量- 返回:
- 明文 string
-
rsaEncrypt
public static String rsaEncrypt(String content)
RSA非对称加密算法- 参数:
content- 明文- 返回:
- 密文 string
-
rsaDecrypt
public static String rsaDecrypt(String encrypt)
RSA非对称加密解密- 参数:
encrypt- 密文- 返回:
- 明文 string
-
sm3DigesterObject
public static String sm3DigesterObject(String content)
Sm 3 digester object string.- 参数:
content- the content- 返回:
- the string
-
-