【发布时间】:2012-11-30 16:38:21
【问题描述】:
这似乎是一个不常见的话题,因为我找不到任何参考。
数字证书存储在商店中。
如你所见...
How do I programmatically remove a certificate in Trusted Root Certification Authorities?
个人数字证书存储在哪里? 商店名称是我的,我们可以在这里看到:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.storename.aspx
但我需要找到文件本身的位置才能以编程方式操作证书。
编辑
我也在尝试以这种方式打印我的证书名称和路径,但我什么也没打印:
X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
X509Certificate2Collection storecollection =
(X509Certificate2Collection)store.Certificates;
Console.WriteLine("Store name: {0}", store.Name);
Console.WriteLine("Store location: {0}", store.Location);
foreach (X509Certificate2 x509 in storecollection)
{
Console.WriteLine("certificate name: {0}",x509.Subject);
}
【问题讨论】:
标签: c# asp.net .net asp.net-mvc asp.net-mvc-4