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