0

我开发了一个简单的 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) 上托管我的网站时,这很有效,但是当我尝试在 Windows7 (IIS7) 上托管它时,这行代码success = rsa.GenerateKey(RSAKeyLength);不起作用并导致网络冻结。任何人都遇到过同样的问题,任何反馈将不胜感激。

4

1 回答 1

1

我通过将进程模型标识更改为 NETWORK SERVICE 而不是 IIS7 应用程序池中的默认 ApplicationPoolIdentity 解决了这个问题

于 2010-09-01T09:59:36.793 回答