问题描述
我需要从证书存储中加载证书:
using (var store = new X509Store(StoreName.TrustedPeople,StoreLocation.LocalMachine))
{
store.Open(OpenFlags.ReadOnly);
var certs = store.Certificates.Find(X509FindType.FindBySubjectName,certificateName,false);
if (certs == null || certs.Count == 0)
{
...
}
return certs[0];
}
但是有时在调用store.Open(OpenFlags.ReadOnly);时抛出异常
System.Security.Cryptography.CryptographicException:内部错误 发生了。在 System.Security.Cryptography.X509Certificates.X509Store.Open(OpenFlags 标志)
用户拥有开店的权限,大多数情况下开店成功,只是有时失败。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)