cn.hutool.crypto.asymmetric.AbstractAsymmetricCrypto Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hutool-all Show documentation
Show all versions of hutool-all Show documentation
Hutool是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。
package cn.hutool.crypto.asymmetric;
import java.security.PrivateKey;
import java.security.PublicKey;
/**
* 抽象的非对称加密对象,包装了加密和解密为Hex和Base64的封装
*
* @param 返回自身类型
* @author Looly
*/
public abstract class AbstractAsymmetricCrypto>
extends BaseAsymmetric
implements AsymmetricEncryptor, AsymmetricDecryptor{
private static final long serialVersionUID = 1L;
// ------------------------------------------------------------------ Constructor start
/**
* 构造
*
* 私钥和公钥同时为空时生成一对新的私钥和公钥
* 私钥和公钥可以单独传入一个,如此则只能使用此钥匙来做加密或者解密
*
* @param algorithm 算法
* @param privateKey 私钥
* @param publicKey 公钥
* @since 3.1.1
*/
public AbstractAsymmetricCrypto(String algorithm, PrivateKey privateKey, PublicKey publicKey) {
super(algorithm, privateKey, publicKey);
}
// ------------------------------------------------------------------ Constructor end
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy