mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-20 10:38:10 +08:00
fix(tenpayv3): 修复解密响应中敏感数据中部分情况下抛出异常的问题
This commit is contained in:
@@ -34,8 +34,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
|||||||
{
|
{
|
||||||
case EncryptionAlgorithms.AEAD_AES_256_GCM:
|
case EncryptionAlgorithms.AEAD_AES_256_GCM:
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(client.Credentials.MerchantCertificatePrivateKey))
|
if (string.IsNullOrEmpty(client.Credentials.MerchantV3Secret))
|
||||||
throw new WechatTenpayException("Failed to decrypt response, because the merchant private key is not set.");
|
throw new WechatTenpayException("Failed to decrypt response, because the merchant APIv3 secret is not set.");
|
||||||
|
|
||||||
certificate.EncryptCertificate.CipherText = AESUtility.DecryptWithGCM(
|
certificate.EncryptCertificate.CipherText = AESUtility.DecryptWithGCM(
|
||||||
encodingKey: new EncodedString(client.Credentials.MerchantV3Secret, EncodingKinds.Literal),
|
encodingKey: new EncodedString(client.Credentials.MerchantV3Secret, EncodingKinds.Literal),
|
||||||
|
Reference in New Issue
Block a user