From 3e7feb941993ea1d05c5fbe5ad3adc28749088c6 Mon Sep 17 00:00:00 2001 From: Roc Date: Tue, 26 Nov 2024 00:37:03 +0800 Subject: [PATCH] =?UTF-8?q?[WeChatPay.V3]=20=E4=BF=AE=E6=AD=A3=20.NET=209?= =?UTF-8?q?=20=E4=B8=8B=E8=BD=BD=E8=A7=A3=E6=9E=90=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E8=AF=81=E4=B9=A6=20#182?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V3/WeChatPayPlatformCertificateManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Essensoft.Paylink.WeChatPay/V3/WeChatPayPlatformCertificateManager.cs b/src/Essensoft.Paylink.WeChatPay/V3/WeChatPayPlatformCertificateManager.cs index 42c252e9d..c2e16dc6c 100644 --- a/src/Essensoft.Paylink.WeChatPay/V3/WeChatPayPlatformCertificateManager.cs +++ b/src/Essensoft.Paylink.WeChatPay/V3/WeChatPayPlatformCertificateManager.cs @@ -44,7 +44,7 @@ public async Task GetCertificateAsync(IWeChatPayCl { var certStr = AEAD_AES_256_GCM.Decrypt(certificate.EncryptCertificate.Nonce, certificate.EncryptCertificate.Ciphertext, certificate.EncryptCertificate.AssociatedData, options.APIv3Key); #if NET9_0_OR_GREATER - var x509cert = X509CertificateLoader.LoadPkcs12(Encoding.UTF8.GetBytes(certStr), string.Empty, X509KeyStorageFlags.DefaultKeySet | X509KeyStorageFlags.Exportable); + var x509cert = X509CertificateLoader.LoadCertificate(Encoding.UTF8.GetBytes(certStr)); #else var x509cert = new X509Certificate2(Encoding.UTF8.GetBytes(certStr), string.Empty, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable); #endif @@ -114,7 +114,7 @@ public async Task GetCertificateAsync(IWeChatPayCl { var certStr = AEAD_AES_256_GCM.Decrypt(certificate.EncryptCertificate.Nonce, certificate.EncryptCertificate.Ciphertext, certificate.EncryptCertificate.AssociatedData, options.APIv3Key); #if NET9_0_OR_GREATER - var x509cert = X509CertificateLoader.LoadPkcs12(Encoding.UTF8.GetBytes(certStr), string.Empty, X509KeyStorageFlags.DefaultKeySet | X509KeyStorageFlags.Exportable); + var x509cert = X509CertificateLoader.LoadCertificate(Encoding.UTF8.GetBytes(certStr)); #else var x509cert = new X509Certificate2(Encoding.UTF8.GetBytes(certStr), string.Empty, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable); #endif