存储网站密钥和/或密码的最佳实践是什么?这些密钥用于各种第 3 方 Web 服务。最好将它们放在 Web.config 文件中、数据库中或以某种方式加密吗?
您可以将加密值存储在 .config 文件中,ASP.NET 2.0 将即时解密它们。
您的配置将类似于:
<configSections>
<section
name="sampleSection"
type="System.Configuration.SingleTagSectionHandler"
/>
</configSections>
<MySecrets
FavoriteMusic="Disco"
FavoriteLanguage="COBOL"
DreamJob="Dancing in the opening ceremonies of the Olympics"
/>
然后在配置文件所在的目录中从命令行运行以下命令:
aspnet_regiis -pef MySecrets .
来自 K.斯科特·艾伦:
http://odetocode.com/Blogs/scott/archive/2006/01/08/2707.aspx http://odetocode.com/Blogs/scott/archive/2006/01/08/2707.aspx
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)