1
從PKCS#12(PFX文件)中,我如何識別集合中證書的類型以打開適當的X509Store?使用C#導入證書和鏈(PFX文件)
X509Certificate2Collection collection = new X509Certificate2Collection();
collection.Import("mycert.pfx", "mypass", X509KeyStorageFlags.PersistKeySet);
foreach(X509Certificate2 cert in collection)
{
// client cert? intermediate CA? root CA?
}
通常在我的方案中,客戶端證書具有私鑰並且根CA具有cert.Subject == cert.Issuer。這是唯一的方法嗎?