public abstract class BaseAsymmetricEncryptor extends Object implements IAsymmetricEncryptor
| 构造器和说明 |
|---|
BaseAsymmetricEncryptor() |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
decrypt(String cipherTextBase64,
String charset,
String privateKey)
对密文进行非对称解密
|
protected abstract String |
doDecrypt(String cipherTextBase64,
String charset,
String privateKey) |
protected abstract String |
doEncrypt(String plainText,
String charset,
String publicKey) |
protected abstract String |
doSign(String content,
String charset,
String privateKey) |
protected abstract boolean |
doVerify(String content,
String charset,
String publicKey,
String sign) |
String |
encrypt(String plainText,
String charset,
String publicKey)
对明文进行非对称加密
|
protected abstract String |
getAsymmetricType() |
String |
sign(String content,
String charset,
String privateKey)
计算指定内容的签名
|
boolean |
verify(String content,
String charset,
String publicKey,
String sign)
验证指定内容的签名是否正确
|
public String decrypt(String cipherTextBase64, String charset, String privateKey) throws AlipayApiException
IAsymmetricEncryptordecrypt 在接口中 IAsymmetricEncryptorcipherTextBase64 - 密文Base64编码字符串charset - 明文的字符集编码privateKey - 私钥字符串AlipayApiExceptionpublic String encrypt(String plainText, String charset, String publicKey) throws AlipayApiException
IAsymmetricEncryptorencrypt 在接口中 IAsymmetricEncryptorplainText - 明文字符串charset - 明文的字符集编码publicKey - 公钥字符串AlipayApiExceptionpublic String sign(String content, String charset, String privateKey) throws AlipayApiException
IAsymmetricEncryptorsign 在接口中 IAsymmetricEncryptorcontent - 待签名的原文charset - 待签名的原文的字符集编码privateKey - 私钥字符串AlipayApiExceptionpublic boolean verify(String content, String charset, String publicKey, String sign) throws AlipayApiException
IAsymmetricEncryptorverify 在接口中 IAsymmetricEncryptorcontent - 待校验的原文charset - 待校验的原文的字符集编码publicKey - 公钥字符串sign - 签名字符串AlipayApiExceptionprotected abstract String doDecrypt(String cipherTextBase64, String charset, String privateKey) throws Exception
Exceptionprotected abstract String doEncrypt(String plainText, String charset, String publicKey) throws Exception
Exceptionprotected abstract String doSign(String content, String charset, String privateKey) throws Exception
Exceptionprotected abstract boolean doVerify(String content, String charset, String publicKey, String sign) throws Exception
Exceptionprotected abstract String getAsymmetricType()
Copyright © 2023. All rights reserved.