1
在.Net 4.0中,我一直無法使用X509Store的find方法從定製商店獲取證書。使用下面的代碼:無法通過公用名稱從c#中的商店獲取證書
X509Store store = new X509Store(storeName, StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadOnly);
X509Certificate2Collection col = store.Certificates.Find(X509FindType.FindBySubjectName, commonName,false);
證書是否在CurrentUser商店而不是機器商店? – 2012-08-15 09:13:55
你會得到一個異常,或者查找只是返回null? – Polyfun 2012-08-15 09:43:34
@ShellShock它會給它一個0項的集合,我得到一個越界異常:索引超出範圍。必須是非負數且小於集合的大小。 參數名稱:index當我嘗試使用集合 – flumeware 2012-08-15 09:45:35