无法导出 RSA 密钥容器文件

发布于 2024-10-12 18:02:10 字数 1286 浏览 3 评论 0原文

我需要加密我的开发计算机 (Windows XP SP-3) 上的 web.config 文件并将 RSA 密钥导出到我的 QA 计算机 (Windows Server 2003)。我使用以下命令来加密我的文件。

aspnet_regiis -pe "appSettings" -app "/VirtualDirectoryName" -prov "RsaProtectedConfigurationProvider"

然后我在 web.config 文件中添加了以下部分

<configProtectedData>

然后我创建了名为“SampleKeys”的 RSA 容器

。Web.Config 加密得很好,我能够在我的开发机器上使用这个文件。然而,我必须打开“模拟”并使用我的 Windows 用户名和密码。

我需要将 RSA 密钥导出到 QA 服务器,以便我可以使用加密的配置文件。 所以我试图导出 RSA 密钥,但失败了。我不明白原因,因为我正在遵循以下链接中提到的所有步骤; 链接文本

当我尝试导出 RSA 容器时,收到错误消息“未找到 RSA 容器”。但是当我尝试使用相同的名称再次创建 RSA 容器时,我收到错误消息“RSA 容器已存在”。 alt text

即使以下命令也成功执行。

aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT AUTHORITY\NETWORK SERVICE"

但是我无法执行以下命令;

aspnet_regiis -pa "SampleKeys" "NT AUTHORITY\NETWORK SERVICE"

我收到同样的错误,提示“未找到 RSA 容器”。

我还向 ASPNET 用户授予了“C:\Document and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKey”文件夹的读取权限。 但没有任何效果。

我错过了什么吗?

I need to encrypt my web.config file on my dev machine (Windows XP SP-3) and export the RSA Key to my QA machine (Windows Server 2003). I used the following command to encrypt my file.

aspnet_regiis -pe "appSettings" -app "/VirtualDirectoryName" -prov "RsaProtectedConfigurationProvider"

and then i added the following section in my web.config file

<configProtectedData>

Then i created the RSA container with the name "SampleKeys"

Web.Config was encrypted nicely and i was able to use this file on my dev machine. I however had to turn on "Impersonation" and used my windows userName and password.

I need to export my RSA Key to QA server, so that i can use my the encrypted config file.
So i'm trying to export the RSA key and its failing. I don't understand the reason, as i'm following all the steps that are mentioned in the following link;
link text

When i try to export the RSA container, i get the error saying that the "RSA container was not found." But when i try to create the RSA container again with the same name, i get the error stating "The RSA container already exists".
alt text

even the following command executed successfully.

aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT AUTHORITY\NETWORK SERVICE"

I however could not execute the following command;

aspnet_regiis -pa "SampleKeys" "NT AUTHORITY\NETWORK SERVICE"

I got the same error saying that "RSA container was not found."

I also gave read access to ASPNET user on "C:\Document and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKey" folder.
but nothing worked.

Am i missing something?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

温柔一刀 2024-10-19 18:02:10

找到答案了!创建导出密钥后,您始终需要引用“SampleKeys”-exp。

aspnet_regiis -pa "SampleKeys"-exp "NT AUTHORITY\NETWORK SERVICE"

Found the answer! You always need to reference the "SampleKeys"-exp once you create a key for exporting.

aspnet_regiis -pa "SampleKeys"-exp "NT AUTHORITY\NETWORK SERVICE"
枫林﹌晚霞¤ 2024-10-19 18:02:10

请务必以管理员身份打开命令窗口。然后再试一次。

另外,在此线程中:

http ://forums.asp.net/t/960412.aspx/1?RSA+Key+container+was+not+found+ERROR

使用以下命令创建了默认容器:

aspnet_regiis -pc "NetFrameworkConfigurationKey" -经验值

Be sure to open the command window as an administrator. And try again.

Also, in this thread:

http://forums.asp.net/t/960412.aspx/1?RSA+Key+container+was+not+found+ERROR

a default container was created using this command:

aspnet_regiis -pc "NetFrameworkConfigurationKey" -exp

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文