SecurityMode 枚举
定义
确定绑定的安全设置。Determines the security settings for a binding.
public enum class SecurityMode
public enum SecurityMode
type SecurityMode =
Public Enum SecurityMode
- 继承
字段
| Message | 2 | 使用 SOAP 消息安全提供安全性。Security is provided using SOAP message security. |
| None | 0 | 禁用安全性。Security is disabled. |
| Transport | 1 | 使用安全传输(例如 HTTPS)提供安全性。Security is provided using a secure transport (for example, HTTPS). |
| TransportWithMessageCredential | 3 | 安全传输(例如 HTTPS)会提供完整性、保密性和身份验证,而 SOAP 消息安全会提供客户端身份验证。A secure transport (for example, HTTPS) provides integrity, confidentiality, and authentication while SOAP message security provides client authentication. |
示例
下面的示例设置 Mode 的 WSHttpBinding 属性。The following example sets the Mode property of the WSHttpBinding. 有关更多示例,请参阅 如何:设置安全模式。For more examples, see How to: Set the Security Mode.
WSHttpBinding b = new WSHttpBinding();
b.Security.Mode = SecurityMode.Transport;
Dim b As New WSHttpBinding()
b.Security.Mode = SecurityMode.Transport
注解
ProtectionLevel如果设置为 "无",则将忽略任何传输的设置 SecurityMode 。Any ProtectionLevel settings of a transport are ignored if the SecurityMode is set to None. 有关属性的详细信息 ProtectionLevel ,请参阅 了解保护级别。For more information about the ProtectionLevel property, see Understanding Protection Level.
有关 Windows Communication Foundation (WCF) 安全性以及此属性如何影响常规安全功能的详细信息,请参阅 保护服务 和 编程 WCF 安全性。For more information about Windows Communication Foundation (WCF) security and how this property affects general security features, see Securing Services and Programming WCF Security. 有关传输模式的详细信息,请参阅 传输安全性。For more information about the transport mode, see Transport Security.
请注意,如果选择 "TransportWithMessageCredential",则将忽略或中设置的值 HttpClientCredentialType TcpClientCredentialType 。Note that if you choose TransportWithMessageCredential, then the value set in HttpClientCredentialType or TcpClientCredentialType is ignored.