Package | Description |
---|---|
cn.hutool.crypto |
加密解密模块,实现了对JDK中加密解密算法的封装,入口为SecureUtil,实现了:
1.
|
cn.hutool.crypto.asymmetric |
非对称加密的实现,包括RSA等
|
Modifier and Type | Method and Description |
---|---|
static String |
SecureUtil.generateAlgorithm(AsymmetricAlgorithm asymmetricAlgorithm,
DigestAlgorithm digestAlgorithm)
生成算法,格式为XXXwithXXX
|
static Signature |
SecureUtil.generateSignature(AsymmetricAlgorithm asymmetricAlgorithm,
DigestAlgorithm digestAlgorithm)
生成签名对象,仅用于非对称加密
|
Modifier and Type | Method and Description |
---|---|
static AsymmetricAlgorithm |
AsymmetricAlgorithm.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static AsymmetricAlgorithm[] |
AsymmetricAlgorithm.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
Constructor and Description |
---|
AsymmetricCrypto(AsymmetricAlgorithm algorithm)
构造,创建新的私钥公钥对
|
AsymmetricCrypto(AsymmetricAlgorithm algorithm,
byte[] privateKey,
byte[] publicKey)
构造 私钥和公钥同时为空时生成一对新的私钥和公钥
私钥和公钥可以单独传入一个,如此则只能使用此钥匙来做加密或者解密 |
AsymmetricCrypto(AsymmetricAlgorithm algorithm,
PrivateKey privateKey,
PublicKey publicKey)
构造 私钥和公钥同时为空时生成一对新的私钥和公钥
私钥和公钥可以单独传入一个,如此则只能使用此钥匙来做加密或者解密 |
AsymmetricCrypto(AsymmetricAlgorithm algorithm,
String privateKeyStr,
String publicKeyStr)
构造 私钥和公钥同时为空时生成一对新的私钥和公钥
私钥和公钥可以单独传入一个,如此则只能使用此钥匙来做加密或者解密 |
Copyright © 2024. All rights reserved.