Closed AndersBillLinden closed 7 years ago
I am able to find the cert using https://stackoverflow.com/questions/11115511/how-to-find-certificate-by-its-thumbprint-in-c-sharp with the parameters
string certThumbPrint = "FP Testcert 2";
X509Store certStore = new X509Store(StoreName.My, StoreLocation.LocalMachine);
well, too lazy to rename the variable, worth noting also that I changed to X509FindType.FindBySubjectName
You should be able to fetch any certificate from the LocalMachine store regardless of its type. but it requires correct access rights. But it seems as if you resolved it?
No, I need to fetch the client cert from the LocalMachine store location.
I am creating a winforms application that authenticates and then collects, exactly as your console application.
If I fetch the client cert from the CurrentUser store location, it works, but not if I am using LocalMachine.
Is it impossible to use LocalMachine for this?
Working web.config snippet <clientCertificate findValue="FP Testcert 2" x509FindType="FindBySubjectName" storeLocation="CurrentUser" storeName="My" />
Does not work <clientCertificate findValue="FP Testcert 2" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="My" />
Screenshot: