I´m developing a tool (ASP.NET page that generates a file with stamped with a private key to be validated later on other app.
I´m using makecert for the certificate creation:
makecert -sky "privatekey" -sk "MyCompany"-n "CN=MyCompany" -ss -pe CertFile.cert
The generated cert is on my dev machine. Then I run this code and It can be found with no problem:
X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
X509Certificate2Collection certs;
store.Open(OpenFlags.ReadOnly);
X509Certificate2Collection certs = store.Certificates.Find(X509FindType.FindBySubjectName, "MyCompany", false);
The certs variable contains no certificates (in a test environment)
I intalled the certificate on the Test Server (Win 2003) using the double click and install cert, using mmc and importing certificate, and exporting the certificate from my machine and then importing in the Test Server.
Is there a step that I´m missing?
UPDATE:
I think this can be the problem. ASPNET User does not have permission to access certificate, also the certificate is not installed on the Machine, just fot the local user.
I´m looking for this link: http://geekswithblogs.net/lorint/archive/2005/12/30/64516.aspx
Thanks