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