MessageSecurityOverTcp.AlgorithmSuite 属性

定义

指定要用于保护 SOAP 级消息的算法套件。

public:
 property System::ServiceModel::Security::SecurityAlgorithmSuite ^ AlgorithmSuite { System::ServiceModel::Security::SecurityAlgorithmSuite ^ get(); void set(System::ServiceModel::Security::SecurityAlgorithmSuite ^ value); };
public System.ServiceModel.Security.SecurityAlgorithmSuite AlgorithmSuite { get; set; }
member this.AlgorithmSuite : System.ServiceModel.Security.SecurityAlgorithmSuite with get, set
Public Property AlgorithmSuite As SecurityAlgorithmSuite

属性值

SecurityAlgorithmSuite

SecurityAlgorithmSuite。 默认值为 Basic256

例外

示例

下面的代码演示如何访问和设置此属性。

NetTcpBinding binding = new NetTcpBinding();
// Specify the mode, then the credential type.
binding.Security.Mode = SecurityMode.Message;
binding.Security.Message.ClientCredentialType =
    MessageCredentialType.UserName;
binding.Security.Message.AlgorithmSuite =
    System.ServiceModel.Security.SecurityAlgorithmSuite.Basic256;
Dim binding As New NetTcpBinding()
' Specify the mode, then the credential type.
binding.Security.Mode = SecurityMode.Message
binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName
binding.Security.Message.AlgorithmSuite = System.ServiceModel.Security.SecurityAlgorithmSuite.Basic256

注解

在对此设置进行修改时,应该注意相关算法的优缺点。

如果将此属性设置为默认值以外的值并使用 ServiceModel 元数据实用工具工具 (Svcutil.exe) 生成配置文件,则不会正确生成此属性,并且必须手动编辑配置文件以将相应的配置属性设置为所需值。

适用于