I am trying to sign an xml document with a private key, reading the
key from a .pfx file. The code following.
string xml;
xml = Request.MapPath("/rsacert.pfx");
xml = HttpUtility.HtmlDecode(xml);
Trace.Write(xml);
Response.Write("<p/>");
X509Certificate2 cert = new X509Certificate2(xml, "");
RSACryptoServiceProvider crypto = cert.PrivateKey as
RSACryptoServiceProvider;
Response.Write("<p/>");
Response.Write(crypto.ToString());
If execute the code on my laptop it works (I have .net 2.0 + compact +
sdk + visual studio installed), if upload the code on one of the test
servers (windows 2003 server + .net 2.0 + compact + sdk, but no VS2005
of course) doesn't work and an exception occurs.
I get a security exception from .net "The system cannot find the file
specified." when executing the following line of code (taken from the
source code, xml is file name and it's correct):
X509Certificate2 cert = new X509Certificate2(xml, " ");
I think it's was they talk about here:
http://support.microsoft.com/kb/915980
As they say the hotfix need to be requested to the customer support, I
will on monday, but they also add if your application run on "Full
trust" it shouldn't happen. My application is running on "Full Trust".
Has anyone got the hotfix? Does it really fix the problem?
I generated the certificate using makecert as explained here:
http://code.google.com/support/bin/a...64#DotNetTools
Since I understood (reading articles here and there on the web) that
the problem is related to certificates not installed in the
certificates store of windows 2003 server. I right clicked on the .pfx
file and choose "import", I can see it in the certificates store, but
still doesn't work, same exception, nothing changed.
I am lost... I hate the world... Everyone is evil... Programming
sucks... I hate certificates... I want a world free of them...
Please HELP!