[英]physical path for personal certificate store
这似乎是一个不常见的话题,因为我找不到任何参考。
数字证书存储在商店中。
如您所见...
个人数字证书存储在哪里? 我们在这里可以看到商店名称为My:
http://msdn.microsoft.com/zh-CN/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);
}
据我所知,没有单个证书的物理文件。
第二个问题:您缺少像store.Open(OpenFlags.ReadWrite);
这样的Open
调用store.Open(OpenFlags.ReadWrite);
。 请参阅MSDN X509Store上的完整示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.