gpt4 book ai didi

asp.net - 为多个服务器加密 web.config 数据

转载 作者:行者123 更新时间:2023-12-02 00:33:26 25 4
gpt4 key购买 nike

我需要为客户端加密我的 web.config 文件的部分。我看到的大多数引用文献都是使用 aspnet_regiis 进行加密。但是,据我所知,这需要在托管站点的 Web 服务器上进行,这意味着每个服务器的加密值都不同。我无权访问该客户的服务器。我找到了一个关于以跨服务器可移植的方式加密 web.config 数据的可能性的传递引用,但没有找到任何更详细的信息。有谁知道如何做到这一点?

最佳答案

需要加密using RSA因为使用 RSAProtectedConfigurationProvider,您可以跨服务器复制您的 key 。

Web Farm Scenarios
You can use RSA encryption in Web farms, because you can export RSA keys. You need to do this if you encrypt data in a Web.config file prior to deploying it to other servers in a Web farm. In this case, the private key required to decrypt the data must be exported and deployed to the other servers.

Using the RSA Provider to Encrypt a Connection String in Web.config in a Web Farm

To do this, you must create a custom RSA encryption key container and deploy the same key container on all servers in your Web farm. This won't work by default because the default RSA encryption key, "NetFrameworkConfigurationKey", is different for each computer.

因此,向下滚动到上述链接的“Web Farm Scenarios”部分并按照步骤操作。

关于asp.net - 为多个服务器加密 web.config 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5717749/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com