using Client.TenPayHttpClient.Signer; using Senparc.Weixin.TenPayV3.TenPayHttpClient.Verifier; using System; using System.Collections.Generic; using System.Text; namespace Senparc.Weixin.TenPayV3.TenPayHttpClient { /// /// 微信支付证书工厂类 /// public static class TenPayCertFactory { /// /// 获取签名对象 /// /// /// /// public static ISigner GetSigner(CertType certType) { switch (certType) { case CertType.RSA: return new SHA256WithRSASigner(); case CertType.SM: return new SM3WithSM2Signer(); default: throw new ArgumentOutOfRangeException(nameof(certType)); } } /// /// 获取验签对象 /// /// /// /// public static IVerifier GetVerifier(CertType certType) { switch (certType) { case CertType.RSA: return new SHA256WithRSAVerifier(); case CertType.SM: return new SM3WithSM2Verifier(); default: throw new ArgumentOutOfRangeException(nameof(certType)); } } } }