RSA密钥容器不能打开 [英] The RSA key container could not be opened

查看:1610
本文介绍了RSA密钥容器不能打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在开发运行XP家用的老式机器上的ASP.NET网站。我最近买了一个新的Win 7的PC和移动在我的所有项目文件。当我尝试并运行该项目,我得到这个错误信息:

I've been developing an ASP.NET site on an older machine running XP home. I recently got a new Win 7 PC and moved all my project files across. When I try and run the project, I get this error message:

无法使用提供解密MyRsaProtectedConfigurationProvider错误消息从提供商:RSA密钥容器不能打开。

我意识到,我使用的是 RSA加密技术进行加密我的web.config文件的部分。这就是现在的问题所在。我不知道如何拿到钥匙再工作,这样我可以我的新机器上使用它。我出口从旧机键和采用进口的:

I realised that I encrypted parts of my web.config file using a RSA encryption. This is where the problem now lies. I'm not sure how to get that key working again so that I can use it on my new machine. I exported the key from the older machine and imported it using:

为aspnet_regiis -piRSAProviderNameC:\\ RSA_configkey.xml

这是成功导入。然后我跑项目,但相同的错误消息出现了。我想这可能是一个权限的事情,所以我跑:

This was imported successfully. I then ran the project, but the same error message came up. I figured it might be a permission thing, so I ran:

为aspnet_regiis -paRSAProviderName\\桌面-full

这也是成功的,但我仍然得到错误。从阅读的时候,我见过的人使用ASPNET而不是\\桌面(Desktop是我的机器名)。然而,当我尝试使用ASPNET,我得到:

This was also successful, but I still get the error. From reading around, I've seen people use "ASPNET" instead of "\Desktop" (Desktop is my machine name). However, when I try and use "ASPNET", I get:

帐户名和安全ID之间没有映射已完成。 <从HRESULT = 0x80070534

我不能对项目工作,直到这个是固定的,所以任何帮助是非常AP preciated。
谢谢!

I can't work on the project until this is fixed, so any help is much appreciated. Thanks!

推荐答案

如果您仍然可以访问旧机器,你总是可以解密这台机器上的配置部分,然后复制未加密的配置文件到新机器上(和如果必要,重新加密旧机器上的文件)。

If you still have access to the older machine, you could always decrypt the configuration section on that machine, then copy the unencrypted config file to the new machine (and, if necessary, re-encrypt the file on the old machine).

在Windows 7中,在其下您的IIS应用程序池默认情况下运行的帐户很可能会 ApplicationPoolIdentity (而不是 ASPNET )。要授予的权限,试试这个:

On Windows 7, the account under which your IIS application pools run by default will likely be ApplicationPoolIdentity (as opposed to ASPNET). To grant permissions, try this:

aspnet_regiis -pa RSAProviderName "IIS APPPOOL\DefaultAppPool" -full

顺便说一句,如果你决定与抄袭旧机的关键,新的要持之以恒,你应该确保,导出时,导出私钥数据太:

By the way, if you do decide to persevere with copying the key from the old machine to the new one, you should make sure that, when exporting, you export the private key data too:

aspnet_regiis -px RSAProviderName C:\RSA_configkey.xml -pri

和可选,使导入过程中的关键数据导出:

And, optionally, to make the key data exportable during the import:

aspnet_regiis -pi RSAProviderName C:\RSA_configkey.xml -exp

这篇关于RSA密钥容器不能打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆