枚举 AuthRoot
时和 CertificateAuthorities
X509 商店,我一直找不到导入到 Trusted Root Certification Authorities
的自签名 SSL 证书在本地机器上:
X509Store store = new X509Store(StoreName.AuthRoot); // also tried StoreName.CertificateAuthorities
store.Open(OpenFlags.ReadOnly);
var storecollection = (X509Certificate2Collection) store.Certificates;
foreach (X509Certificate2 x509 in storecollection)
{
Console.WriteLine("certificate name: {0}", x509.Subject);
}
自签名 SSL 证书是否被枚举器视为无效而跳过?我找错地方了吗?这是我在 MMC 的证书管理单元中看到的内容:
最佳答案
StoreName.Root
是您想要的“受信任的根证书颁发机构”。AuthRoot
是“第三方根证书颁发机构”,CertificateAuthority
是“中级证书颁发机构”。
关于ssl - 其中 X509 StoreName 是指存储在 Windows10 中受信任的根证书颁发机构下的证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63286085/