Chilkat RSA 加密在 Windows7/IIS7 中失败
我开发了一个简单的 ASP.NET 网站,它使用 Chilkatdotnet2(版本 9.0.8.0)生成用于加密的 RSA 公钥/私钥对。下面是示例代码
bool success;
string UnlockChilkatRSA = "XXXXXXXXXXXXXX";
int RSAKeyLength = 1024;
Chilkat.Rsa rsa = new Chilkat.Rsa();
success = rsa.UnlockComponent(UnlockChilkatRSA);
if (!success)
{
lblmsg.Text = "RSA component unlock failed";
return;
}
success = rsa.GenerateKey(RSAKeyLength);
if (!success)
{
lblmsg.Text = rsa.LastErrorText;
return;
}
string publicKey = rsa.ExportPublicKey();
string privateKey = rsa.ExportPrivateKey();
当我在 Windows Server 2003 (IIS6) 中托管我的 Web 时效果很好,但是当我尝试在 Windows7 (IIS7) 上托管它时,这行代码 success = rsa.GenerateKey(RSAKeyLength);
不起作用并导致网络冻结。任何人都遇到过同样的问题,任何反馈将不胜感激。
I developed a simple ASP.NET website that uses Chilkatdotnet2 (version 9.0.8.0) to generate RSA Public/Private Key pair used for encryption. Below is the sample code
bool success;
string UnlockChilkatRSA = "XXXXXXXXXXXXXX";
int RSAKeyLength = 1024;
Chilkat.Rsa rsa = new Chilkat.Rsa();
success = rsa.UnlockComponent(UnlockChilkatRSA);
if (!success)
{
lblmsg.Text = "RSA component unlock failed";
return;
}
success = rsa.GenerateKey(RSAKeyLength);
if (!success)
{
lblmsg.Text = rsa.LastErrorText;
return;
}
string publicKey = rsa.ExportPublicKey();
string privateKey = rsa.ExportPrivateKey();
This works well when I host my web in Windows Server 2003 (IIS6), but when I tried to host it on Windows7 (IIS7), this line of code success = rsa.GenerateKey(RSAKeyLength);
doesnt work and cause the web to freeze. Anyone has experience the same issue, any feedback would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过将 IIS7 应用程序池中的进程模型标识更改为 NETWORK SERVICE 而不是默认的 ApplicationPoolIdentity 解决了这个问题
I solved it by changing Process Model Identity to NETWORK SERVICE instead of default ApplicationPoolIdentity in IIS7 Application Pools