C#.NET ASP.NET IIS 加载.pfx私钥证书时报错“出现了内部错误。”
原始代码报错:
X509Certificate2 x509cer = new X509Certificate2(rawData, m.cert_pwd);
解决方法,加上enum:
X509Certificate2 x509cer = new X509Certificate2(rawData, m.cert_pwd, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
X509Certificate2
标签:X509KeyStorageFlags,ASP,私钥,IIS,X509Certificate2,NET From: https://www.cnblogs.com/runliuv/p/16925693.html