in e2etest/GuestProxyAgentTest/Utilities/CertificateUtility.cs [39:68]
public static X509Certificate2 GetCertificate(string thumbPrint, StoreName storeName, StoreLocation storeLocation)
{
X509Store store = new X509Store(storeName, storeLocation);
try
{
store.Open(OpenFlags.ReadOnly);
X509Certificate2Collection certs = store.Certificates.Find(X509FindType.FindByThumbprint, thumbPrint, false);
if (certs.Count <= 0)
{
return null;
}
else
{
return certs[0];
}
}
catch (Exception e)
{
Console.WriteLine("GetCertificate error: " + e.Message);
}
finally
{
if (store != null)
{
store.Close();
}
}
return null;
}