in SamplesV1/ADFSecurePublish/AdfKeyVaultDeployment/KeyVaultResolver.cs [77:101]
public static X509Certificate2 FindCertificateByThumbprint(string thumbPrint)
{
X509Certificate2 cert;
X509Store myLocalStore = new X509Store(StoreName.My, StoreLocation.LocalMachine);
cert = FindCertFromStore(thumbPrint, myLocalStore);
if (cert != null)
{
return cert;
}
X509Store myCurrentUserStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
cert = FindCertFromStore(thumbPrint, myCurrentUserStore);
if (cert != null)
{
return cert;
}
X509Store caLocalStore = new X509Store(StoreName.CertificateAuthority, StoreLocation.LocalMachine);
cert = FindCertFromStore(thumbPrint, caLocalStore);
return cert;
}