示例#1
0
 public Certificate FindByTumbprint(string thumbprint, string storeName = "My")
 {
     using (var searcher = new X509StoreSearcher(storeName, StoreLocation.LocalMachine))
     {
         return(ToCertificate(searcher.FindByThumbprint(thumbprint)));
     }
 }
示例#2
0
 public Certificate FindByFriendlyName(string friendlyName, string storeName = "My")
 {
     using (var searcher = new X509StoreSearcher(storeName, StoreLocation.LocalMachine))
     {
         return(ToCertificate(searcher.FindByFriendlyName(friendlyName)));
     }
 }
示例#3
0
 public IEnumerable <Certificate> FindAll(string storeName = "My")
 {
     using (var searcher = new X509StoreSearcher(storeName, StoreLocation.LocalMachine))
     {
         return(searcher.FindAll()
                .Select(ToCertificate));
     }
 }