G
Guest
System.Security.Cryptography.Utils._CreateCSP throws a
System.Security.Cryptography.CryptographicException with the message "file
not found" when we impersonate IIS5 to a fixed account from web.config. If we
let it run under the ASPNET user things are fine.
does anyone have an idea what goes wrong here?
web.config:
<identity userName="server_account" password="password"/>
default.aspx (to verify the error):
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Security.Cryptography;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
using (RSA rsa = RSA.Create())
{
string a = rsa.ToXmlString(false);
Label1.Text = "succeeded: " + a;
}
}
catch (Exception ex)
{
Label1.Text = ex.ToString();
}
}
}
System.Security.Cryptography.CryptographicException with the message "file
not found" when we impersonate IIS5 to a fixed account from web.config. If we
let it run under the ASPNET user things are fine.
does anyone have an idea what goes wrong here?
web.config:
<identity userName="server_account" password="password"/>
default.aspx (to verify the error):
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Security.Cryptography;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
using (RSA rsa = RSA.Create())
{
string a = rsa.ToXmlString(false);
Label1.Text = "succeeded: " + a;
}
}
catch (Exception ex)
{
Label1.Text = ex.ToString();
}
}
}