开发者

Chilkat RSA Encrypt fails in Windows7/IIS7

开发者 https://www.devze.com 2023-01-13 17:28 出处:网络
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

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.


I solved it by changing Process Model Identity to NETWORK SERVICE instead of default ApplicationPoolIdentity in IIS7 Application Pools

0

上一篇:

:下一篇

精彩评论

暂无评论...
验证码 换一张
取 消