| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 892 人关注过本帖
标题:如何加密Web.config中的mailSettings
只看楼主 加入收藏
airfei
Rank: 1
等 级:新手上路
帖 子:137
专家分:0
注 册:2007-4-12
收藏
 问题点数:0 回复次数:1 
如何加密Web.config中的mailSettings

如题。我用

aspnet_regiis.exe -pef "mailSettings" "C:\Inetpub\wwwroot\netEduSystem"

或者

aspnet_regiis.exe -pef "system.net\mailSettings" "C:\Inetpub\wwwroot\netEduSystem"

都不行,错误提示是找不到配制节

但是我对appSettings和connectionStrings加密都可以

aspnet_regiis.exe -pef "appSettings" "C:\Inetpub\wwwroot\netEduSystem"

aspnet_regiis.exe -pef "connectionStrings" "C:\Inetpub\wwwroot\netEduSystem"

请大家帮忙解决!谢谢

搜索更多相关主题的帖子: config mailSettings Web 
2007-06-06 01:07
airfei
Rank: 1
等 级:新手上路
帖 子:137
专家分:0
注 册:2007-4-12
收藏
得分:0 
回复:(airfei)如何加密Web.config中的mailSettings...

对了,我Web.config的结构是这样的
<?xml version="1.0"?>
<!--
注意: 除了手动编辑此文件以外,您还可以使用
Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
“网站”->“Asp.Net 配置”选项。
设置和注释的完整列表在
machine.config.comments 中,该文件通常位于
\Windows\Microsoft.Net\Framework\v2.x\Config 中
-->
<configuration>

<appSettings configProtectionProvider="RsaProtectedConfigurationProvider">
<EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyName>Rsa Key</KeyName>
</KeyInfo>
<CipherData>
<CipherValue>thR8rs01AXQ5xXWziZvxNRlKAZGd5peIDae2js06VGNQGs3Dy+FmTdiGsvN3vM2/s37FRGlZspeEnhQN2O6nQgVSiwFVt/4yEmh0mmMAlFOn1XIR6nyDTP6o2n5GD0l6JR2t+2W5RvGG9y65GtnqF0MoXOik1u630n8CIFn/m3s=</CipherValue>
</CipherData>
</EncryptedKey>
</KeyInfo>
<CipherData>
<CipherValue>svDsHZWfyEUjGRnxqQBbdyClDs4jdJESv4ogsf46IZ0hosTrPGCcOu3EOYJbvkw4aJqAWnJsPklpaIKp5UHawBIJ4d9ZNtkFbY6yHQvb8oCcTT1K2NOiGafwIV+M0TkUuBWVtiDV3hJ5RfUO59amJ46JZtJBSo1I</CipherValue>
</CipherData>
</EncryptedData>
</appSettings>
<connectionStrings configProtectionProvider="RsaProtectedConfigurationProvider">
<EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyName>Rsa Key</KeyName>
</KeyInfo>
<CipherData>
<CipherValue>mwDwwE0TxdGJN54ohSxOa747UtdafObdwNwOIe0OWEKSLs9ng29oGToLG+04CIgsmKC9tvmiyT4oYGsLJQ1Ac8YiLy/yhaDetz5oDhTHPkTY8WphM7HdyEL1Ue8Dky17CmOmALFAxZFl7uJVXUpvdNbaSw+OzhUZFZkfbngU5xs=</CipherValue>
</CipherData>
</EncryptedKey>
</KeyInfo>
<CipherData>
<CipherValue>mEiiOI1VgBCYJ2AvDngRaIegfMYO8akR5gz3xK0mPf2jNigO7kXSOvon9vViAhSKKrvuqoaYgUSgfJeUyI9kImyk0Hx5HlpUjwdrwcV8BxycjY7MXey3qXqsGm/j9dYuWzM1c57920Wli/RjZsUKA+IPj3bep3vQ/r56YP8GHF8VU6bIL0KL3ZzRndR+sSgjM1N4S/ZiTepL+3qykSE9eZjd5Rr8deeD1+FWQfoRsnk90D296JUIItkPEvGeSF/gpyCu5GyojACcvmnrUkHYcE0SOrOQ1Hg3</CipherValue>
</CipherData>
</EncryptedData>
</connectionStrings>

<system.web>

<httpRuntime executionTimeout="3600" maxRequestLength="524288"
useFullyQualifiedRedirectUrl="true" minFreeThreads="8"
minLocalRequestFreeThreads="4" appRequestQueueLimit="100" />

<!--
设置 compilation debug="true" 将调试符号插入
已编译的页面中。但由于这会
影响性能,因此只在开发过程中将此值
设置为 true。
-->
<compilation debug="true"/>
<!--
通过 <authentication> 节可以配置 ASP.NET 使用的
安全身份验证模式,
以标识传入的用户。
-->
<authentication mode="Windows"/>
<!--
如果在执行请求的过程中出现未处理的错误,
则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
开发人员通过该节可以配置
要显示的 html 错误页
以代替错误堆栈跟踪。
-->
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>

<sessionState timeout="60"/>

<globalization requestEncoding="gb2312" responseEncoding="gb2312" />

</system.web>
<system.net>
<mailSettings>
<smtp from="***@126.com">
<network host="220.181.15.112" password="***" userName="***" />
</smtp>
</mailSettings>
</system.net>
</configuration>

2007-06-06 01:12
快速回复:如何加密Web.config中的mailSettings
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.033319 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved