I've got a solution that works with our example. I'm hoping that it may be a partial solution and you may be able to apply it in some way to your particular problem.
replace:
X509Certificate2 cert = new X509Certificate2(CertPath,
with:
X509Certificate2 cert = new X509Certificate2(File.Read
Main Topics
Browse All Topics





by: xsdPosted on 2007-05-17 at 02:59:48ID: 19106946
I don't have a solution, but would like to know if there have been any discoveries with this problem (as I'm having difficulties with this also.)
CertPassword);
phy.Crypto graphicExc eption: The system cannot find the file specified."
In our case, we're running a asp.net 2.0 webapp, and have written code that is trying to instantiate a certificate. The file is a .p12 which stored in a folder of the web application (not in the keystore).
The system is running on win2003 and we're using IIS impersonation for the internet anoymous account - I'm pretty sure it's this which is causing the problems. The code works fine on the development system.
I don't think I need to show you all of the code, as it's simply failing on the following line (pretty self-contained :-
X509Certificate2 cert = new X509Certificate2(CertPath,
We're getting the error:-
"System.Security.Cryptogra
Both the path and the password are correct - I know this because the 'cheat fix' mentioned above (and elsewhere on the web) of running something like calc.exe using the account in question, causes everything to just start working.
I have tried using a stream reader and passing a byte array (instead of a mappath'd resolved path to the certificate) - no joy this way either.