by George Aung [gaung at juniper dot com] posted on 2004/09/10 |
|
We are getting following error when we are trying to run in .Net Web Application with pkcs12 certificate. If we run as standalone command line application then it works? Any clues?
Unable to import the PFX file! [error code = 2]
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Org.Mentalis.Security.Certificates.CertificateException: Unable to import the PFX file! [error code = 2]
Source Error:
Line 93: sr.Close();
Line 94:
Line 95: Certificate cert = Certificate.CreateFromPfxFile(@file, pass, false);
Line 96: //Converts the Certificate instance to an ordinary X509Certificate instance
Line 97: X509Certificate cert2 = cert.ToX509();
Source File: c:\inetpub\wwwroot\webapplication1\webform1.aspx.cs Line: 95
Stack Trace:
[CertificateException: Unable to import the PFX file! [error code = 2]]
Org.Mentalis.Security.Certificates.CertificateStore.CreateFromPfxFile(Byte[] file, String password, Boolean exportable, KeysetLocation location)
Org.Mentalis.Security.Certificates.CertificateStore.CreateFromPfxFile(Byte[] file, String password, Boolean exportable)
Org.Mentalis.Security.Certificates.CertificateStore.CreateFromPfxFile(String file, String password, Boolean exportable)
Org.Mentalis.Security.Certificates.Certificate.CreateFromPfxFile(String file, String password, Boolean exportable)
Juniper.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\webapplication1\webform1.aspx.cs:95
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
|