MessageSecurityOverTcp.AlgorithmSuite 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
指定要用於保護 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。 預設為 Basic256。
例外狀況
AlgorithmSuite 的值是 null
。
範例
下列程式碼示範如何存取及設定這個屬性。
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) 產生組態檔,則不會正確產生此屬性,而且您必須手動編輯組態檔,將對應的組態屬性設定為所需的值。