I need to do HTTP web requests that require a client X509 certificate to authenticate. I want to use the X509 certificates that are already installed on the computer. When I query the store for the certificates, it returns zero certificates.
I'm accessing the store as follows:
X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadOnly);
Debug.Log("Certificate Count: " + store.Certificates.Count);
foreach(var c in store.Certificates) {
Debug.Log("Certificate issued by: " + c.Issuer);
}
store.Close();
This code reports a certificate count of 0. This exact same code (changing Console.Writeline for Debug.Log), runs on a natively compiled C# app and prints the 4 custom certificates I have installed.
I can load a pfx (p12) certificate from file and do the web authentication, but that's not a usable solution. I really need to be able to pull the certificates from the system's X509Store to properly authenticate.
↧