public class AlipayConfigUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
ALIPAY_SHA_256_WITH_RSA |
static String |
RSA
RSA2对应的真实非对称加密算法名称
|
static String |
SHA_256_WITH_RSA
RSA2对应的真实签名算法名称
|
| 构造器和说明 |
|---|
AlipayConfigUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
decrypt(String cipherText)
密文
|
String |
doDecrypt(String cipherTextBase64)
私钥解密
|
String |
doEncrypt(String plainText)
公钥加密
|
String |
encrypt(String plainText,
Map<String,String> headerParams)
AES加密
|
String |
generateSign(String content) |
boolean |
generateVerify(String content,
String sign,
String alipayPublicKey) |
String |
getAlipayPublicKey()
Getter method for property alipayPublicKey.
|
String |
getAppCertSN()
Getter method for property appCertSN.
|
String |
getAppId()
Getter method for property appId.
|
ConcurrentHashMap<String,String> |
getCachedAlipayPublicKey()
Getter method for property cachedAlipayPublicKey.
|
String |
getCharset()
Getter method for property charset.
|
String |
getEncryptKey()
Getter method for property encryptKey.
|
String |
getEncryptType()
Getter method for property encryptType.
|
String |
getPrivateKey()
Getter method for property privateKey.
|
String |
getRootCertContent()
Getter method for property rootCertContent.
|
String |
getRootCertSN()
Getter method for property rootCertSN.
|
void |
setAlipayPublicKey(String alipayPublicKey)
Setter method for property alipayPublicKey.
|
void |
setAppCertSN(String appCertSN)
Setter method for property appCertSN.
|
void |
setAppId(String appId)
Setter method for property appId.
|
void |
setCachedAlipayPublicKey(ConcurrentHashMap<String,String> cachedAlipayPublicKey)
Setter method for property cachedAlipayPublicKey.
|
void |
setCharset(String charset)
Setter method for property charset.
|
void |
setEncryptKey(String encryptKey)
Setter method for property encryptKey.
|
void |
setEncryptType(String encryptType)
Setter method for property encryptType.
|
void |
setPrivateKey(String privateKey)
Setter method for property privateKey.
|
void |
setRootCertContent(String rootCertContent)
Setter method for property rootCertContent.
|
void |
setRootCertSN(String rootCertSN)
Setter method for property rootCertSN.
|
void |
sign(String httpMethod,
String httpRequestUri,
String httpRequestBody,
Map<String,String> headerParams)
计算签名并添加header
|
boolean |
verify(String content,
String sign,
String alipayCertSN,
String timestamp,
String nonce)
验证签名
|
public void sign(String httpMethod, String httpRequestUri, String httpRequestBody, Map<String,String> headerParams) throws ApiException
httpMethod - 本次请求的http方法httpRequestUri - 本次请求的uri信息(不包括域名)httpRequestBody - 本次请求的body内容,body为空时按空字符串处理,即""headerParams - headerApiExceptionpublic String generateSign(String content) throws ApiException
ApiExceptionpublic boolean verify(String content, String sign, String alipayCertSN, String timestamp, String nonce) throws ApiException
content - 待验签的内容sign - 签名值的Base64串alipayCertSN - 支付宝公钥证书序列号timestamp - 时间戳nonce - nonceApiExceptionpublic boolean generateVerify(String content, String sign, String alipayPublicKey) throws ApiException
ApiExceptionpublic String encrypt(String plainText, Map<String,String> headerParams) throws ApiException
plainText - 明文headerParams - The header parametersApiExceptionpublic String decrypt(String cipherText) throws ApiException
cipherText - 密文ApiExceptionpublic String doDecrypt(String cipherTextBase64) throws ApiException
cipherTextBase64 - ApiExceptionpublic String doEncrypt(String plainText) throws ApiException
plainText - ApiExceptionpublic String getAppId()
public void setAppId(String appId)
appId - value to be assigned to property appIdpublic String getCharset()
public void setCharset(String charset)
charset - value to be assigned to property charsetpublic String getPrivateKey()
public void setPrivateKey(String privateKey)
privateKey - value to be assigned to property privateKeypublic String getAlipayPublicKey()
public void setAlipayPublicKey(String alipayPublicKey)
alipayPublicKey - value to be assigned to property alipayPublicKeypublic String getRootCertContent()
public void setRootCertContent(String rootCertContent)
rootCertContent - value to be assigned to property rootCertContentpublic String getRootCertSN()
public void setRootCertSN(String rootCertSN)
rootCertSN - value to be assigned to property rootCertSNpublic String getAppCertSN()
public void setAppCertSN(String appCertSN)
appCertSN - value to be assigned to property appCertSNpublic ConcurrentHashMap<String,String> getCachedAlipayPublicKey()
public void setCachedAlipayPublicKey(ConcurrentHashMap<String,String> cachedAlipayPublicKey)
cachedAlipayPublicKey - value to be assigned to property cachedAlipayPublicKeypublic String getEncryptType()
public void setEncryptType(String encryptType)
encryptType - value to be assigned to property encryptTypepublic String getEncryptKey()
public void setEncryptKey(String encryptKey)
encryptKey - value to be assigned to property encryptKeyCopyright © 2024. All rights reserved.