in RESTProxy/Models/Encryption.cs [60:84]
private static X509Certificate2 GetCertificateFromStore(string thumbprint)
{
X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
try
{
store.Open(OpenFlags.ReadOnly);
X509Certificate2Collection certificateCollection = store.Certificates.Find(
X509FindType.FindByThumbprint,
thumbprint,
false);
if (certificateCollection.Count == 0)
{
throw new ApplicationException(string.Format("Certificate with thumbprint {0} was not found within the local machine store.", thumbprint));
}
return certificateCollection[0];
}
finally
{
store.Close();
}
}