SecurityBindingElement 類別

定義

抽象類別 (Abstract Class),其在實作時可表示支援通道 SOAP 訊息安全性的繫結項目。An abstract class that, when implemented, represents a binding element that supports channel SOAP message security.

public ref class SecurityBindingElement abstract : System::ServiceModel::Channels::BindingElement
public abstract class SecurityBindingElement : System.ServiceModel.Channels.BindingElement
type SecurityBindingElement = class
    inherit BindingElement
Public MustInherit Class SecurityBindingElement
Inherits BindingElement
繼承
SecurityBindingElement
衍生

備註

這個類別是 WCF 中 SOAP 訊息安全性繫結項目的基類。This class is the base class for the SOAP message security binding elements in WCF. 這個抽象類別有三種實作:SymmetricSecurityBindingElementAsymmetricSecurityBindingElementTransportSecurityBindingElementThere are three implementations of this abstract class: SymmetricSecurityBindingElement, AsymmetricSecurityBindingElement, and TransportSecurityBindingElement. 這些實作會建立以 WS-Security Policy 規格定義之繫結的模型。These implementations model the bindings defined in the WS-Security Policy specification.

自訂繫結包含以特定順序排列的繫結項目之集合:第一個會新增代表繫結堆疊頂端的項目,第二個新增繫結堆疊中次一項目,依此類推。A custom binding contains a collection of binding elements arranged in a specific order: the element that represents the top of the binding stack is added first, the next element down in the binding stack is added second, and so on.

若要將這個類別新增至繫結,請執行下列動作:To add this class to a binding, do the following:

  1. 建立 BindingElementCollectionCreate a BindingElementCollection.

  2. 建立在繫結堆疊中位於此繫結項目上方的自訂繫結項目,例如選擇性的 TransactionFlowBindingElementReliableSessionBindingElementCreate a custom binding element that is above this binding element in the binding stack, such as the optional TransactionFlowBindingElement and ReliableSessionBindingElement.

  3. 依先前所述的順序,使用 BindingElementCollection 方法將這些項目新增至 InsertItemAdd these elements in the order previously described to the BindingElementCollection using the InsertItem method.

  4. 建立自 SecurityBindingElement 衍生之安全性繫結項目的執行個體,例如 AsymmetricSecurityBindingElementSymmetricSecurityBindingElementTransportSecurityBindingElementCreate an instance of a security binding element derived from SecurityBindingElement, such as AsymmetricSecurityBindingElement, SymmetricSecurityBindingElement, or TransportSecurityBindingElement.

  5. 將衍生的安全性繫結項目新增至集合。Add the derived security binding element to the collection.

  6. 將其他任何自訂繫結項目新增至集合中,例如 TcpTransportBindingElementAdd any additional custom binding elements to the collection, such as TcpTransportBindingElement.

如需使用 SecurityBindingElement 的詳細資訊,請參閱SecurityBindingElement 驗證模式和 @no__t 2How 至:使用 SecurityBindingElement @ no__t-0 來建立自訂系結。For more information about using a SecurityBindingElement, see SecurityBindingElement Authentication Modes and How to: Create a Custom Binding Using the SecurityBindingElement.

注意

一旦建立 SecurityBindingElement 物件之後,您就應該將它的屬性視為不變的屬性。Once a SecurityBindingElement object is created, you should treat its properties as immutable. 在某些屬性上呼叫 set 可能會產生無法預測的結果:繫結的行為可能如同屬性保留舊的值一般,而且執行階段錯誤是發生問題的唯一徵兆。Calling set on some properties may have unpredictable effects: the binding may behave as if the property retained its old value, with a runtime failure being the only indication of an issue. 已知可能出現這種行為的兩個屬性是 KeyTypeMessageSecurityVersionTwo properties known to behave this way are KeyType and MessageSecurityVersion. 另外可能還有其他屬性也會出現同樣的狀況。There may be other properties of which this is also true.

屬性

AllowInsecureTransport

取得或設定值,這個值表示是否可傳送混合模式的安全訊息至不安全的傳輸,例如 HTTP。Gets or sets a value that indicates whether mixed-mode secured messages can be sent over an unsecured transport such as HTTP.

DefaultAlgorithmSuite

取得或設定訊息加密和金鑰包裝演算法。Gets or sets the message encryption and key-wrap algorithms.

EnableUnsecuredResponse

取得或設定值,這個值表示 WCF 是否可以接收及傳送不安全的回應至安全的要求。Gets or sets a value that indicates whether WCF can send and receive unsecured responses to secured requests.

EndpointSupportingTokenParameters

取得支援權杖參數的端點。Gets the endpoint that supports token parameters.

IncludeTimestamp

取得或設定值,指出時間戳記是否包含在各個訊息中。Gets or sets a value that indicates whether time stamps are included in each message.

KeyEntropyMode

取得或設定用於建立金鑰的 Entropy 來源。Gets or sets the source of entropy used to create keys.

LocalClientSettings

取得用戶端所使用本機安全性設定的特定繫結項目。Gets the binding properties specific to local security settings used by the client.

LocalServiceSettings

取得服務所使用本機安全性設定的特定繫結項目。Gets the binding properties specific to local security settings used by the service.

MessageSecurityVersion

取得或設定訊息安全性版本。Gets or sets the message security version.

OperationSupportingTokenParameters

取得支援權杖參數之作業的集合。Gets the collection of operation supporting token parameters.

OptionalEndpointSupportingTokenParameters

取得服務端點的選擇性支援權杖參數。Gets the optional supporting token parameters for the service endpoint.

OptionalOperationSupportingTokenParameters

取得支援權杖參數之選擇性作業的集合。Gets the collection of optional operation supporting token parameters.

ProtectTokens

取得或設定安全性繫結項目是否保護權杖。Gets or sets whether the security binding element protects tokens.

SecurityHeaderLayout

取得或設定此繫結之安全性標頭中的項目順序。Gets or sets the ordering of the elements in the security header for this binding.

方法

BuildChannelFactory<TChannel>(BindingContext)

根據傳入的 SecurityBindingElement 設定和繫結內容建立通道處理站。Creates a channel factory based on the SecurityBindingElement settings and the binding context passed in. 所建立的通道處理站是 SOAP 訊息安全性通道處理站,其內部具有對應至繫結內容之通道處理站的參考 (包括傳輸通道處理站)。The channel factory created is a SOAP message security channel factory, which internally has a reference to the channel factory that corresponds to the binding context, (which includes the transport channel factory).

BuildChannelFactoryCore<TChannel>(BindingContext)

當實作時會建立指定型別的通道處理站。When implemented, creates a channel factory of a specified type.

BuildChannelListener<TChannel>(BindingContext)

根據傳入的 SecurityBindingElement 設定和繫結內容建立通道接聽程式。Creates a channel listener based on the SecurityBindingElement settings and the binding context passed in.

BuildChannelListenerCore<TChannel>(BindingContext)

當實作時會建立指定型別的通道接聽程式。When implemented, creates a channel listener of a specified type.

CanBuildChannelFactory<TChannel>(BindingContext)

判斷是否可以建置指定之型別的通道處理站。Determines whether a channel factory of the specified type can be built.

CanBuildChannelListener<TChannel>(BindingContext)

判斷是否可以建置指定之型別的通道接聽項。Determines whether a channel listener of the specified type can be built.

Clone()

在衍生類別中覆寫時,傳回繫結項目物件的複本。When overridden in a derived class, returns a copy of the binding element object.

(繼承來源 BindingElement)
CreateAnonymousForCertificateBindingElement()

建立對稱式安全性繫結項目,這個項目則設定為匿名用戶端驗證和憑證架構的伺服器驗證。Creates a symmetric security binding element that is configured for anonymous client authentication and certificate-based server authentication.

CreateCertificateOverTransportBindingElement()

建立安全性繫結項目,這個項目需要用戶端使用 SOAP 訊息安全性執行憑證架構的驗證。Creates a security binding element that expects clients to do certificate-based authentication using SOAP message security.

CreateCertificateOverTransportBindingElement(MessageSecurityVersion)

建立安全性繫結項目,這個項目需要用戶端使用 SOAP 訊息安全性執行憑證架構的驗證。Creates a security binding element that expects clients to do certificate-based authentication using SOAP message security.

CreateCertificateSignatureBindingElement()

建立要使用憑證簽署訊息的繫結項目。Creates a binding element using a certificate to sign messages. 這個繫結項目只能用於單向訊息交換,而且只能簽署訊息。This binding element can be used only for one-way message exchanges and is capable only of signing the message.

CreateIssuedTokenBindingElement(IssuedSecurityTokenParameters)

建立對稱的安全性繫結項目,該項目已設定為需要使用以對稱金鑰為基礎發行之權杖的用戶端驗證。Creates a symmetric security binding element that is configured to require client authentication using a symmetric-key based issued token.

CreateIssuedTokenForCertificateBindingElement(IssuedSecurityTokenParameters)

建立對稱式安全性繫結項目,這個項目則設定為需要根據發行的權杖進行用戶端驗證,並且需要根據伺服器憑證進行伺服器驗證。Creates a symmetric security binding element that is configured to require client authentication based on an issued token and server authentication based on the server certificate.

CreateIssuedTokenForSslBindingElement(IssuedSecurityTokenParameters)

建立對稱式安全性繫結項目,這個項目則設定為需要根據發行的權杖進行用戶端驗證,並且需要根據伺服器憑證進行伺服器驗證。Creates a symmetric security binding element that is configured to require client authentication based on an issued token and server authentication based on the server certificate.

CreateIssuedTokenForSslBindingElement(IssuedSecurityTokenParameters, Boolean)

建立對稱式安全性繫結項目,這個項目則設定為需要根據發行的權杖進行用戶端驗證,並且需要根據伺服器憑證進行伺服器驗證。Creates a symmetric security binding element that is configured to require client authentication based on an issued token and server authentication based on the server certificate.

CreateIssuedTokenOverTransportBindingElement(IssuedSecurityTokenParameters)

建立安全性繫結項目,該項目已設定為需要使用發行之權杖的 SOAP 安全性用戶端驗證。Creates a security binding element configured to require SOAP security based client authentication using an issued token. 這個繫結項目需要傳輸提供伺服器驗證和訊息保護 (例如 HTTPS)。This binding element requires the transport to provide server authentication and message protection (for example, HTTPS).

CreateKerberosBindingElement()

建立對稱的安全性繫結項目,該項目已設定為需要以用戶端之 Kerberos 權杖為基礎的用戶端驗證。Creates a symmetric security binding element that is configured to require client authentication based on the client's Kerberos token.

CreateKerberosOverTransportBindingElement()

建立安全性繫結項目,該項目已設定為需要使用用戶端之 Kerberos 權杖的 SOAP 安全性用戶端驗證。Creates a security binding element that is configured to require SOAP-security based client authentication using the client's Kerberos token. 這個繫結項目需要傳輸提供伺服器驗證和訊息保護 (例如 HTTPS)。This binding element requires the transport to provide server authentication and message protection (for example, HTTPS).

CreateMutualCertificateBindingElement()

建立非對稱安全性繫結項目,這個項目則設定為需要進行憑證架構的用戶端驗證和伺服器驗證。Creates an asymmetric security binding element that is configured to require certificate-based client authentication as well as certificate-based server authentication.

CreateMutualCertificateBindingElement(MessageSecurityVersion)

建立非對稱安全性繫結項目,這個項目則設定為需要進行憑證架構的用戶端驗證和伺服器驗證。Creates an asymmetric security binding element that is configured to require certificate-based client authentication as well as certificate-based server authentication.

CreateMutualCertificateBindingElement(MessageSecurityVersion, Boolean)

建立非對稱安全性繫結項目,這個項目則設定為需要進行憑證架構的用戶端驗證和伺服器驗證。Creates an asymmetric security binding element that is configured to require certificate-based client authentication as well as certificate-based server authentication.

CreateMutualCertificateDuplexBindingElement()

建立非對稱安全性繫結項目,這個項目則設定為需要進行憑證架構的用戶端驗證和伺服器驗證。Creates an asymmetric security binding element that is configured to require certificate-based client authentication as well as certificate-based server authentication. 這個驗證模式可以用來確保雙向訊息交換模式的安全性,並且需要透過範圍外的用戶端憑證來設定服務。This authentication mode can be used to secure duplex message-exchange patterns and requires the service to be configured with the client certificate out of band.

CreateMutualCertificateDuplexBindingElement(MessageSecurityVersion)

建立非對稱安全性繫結項目,這個項目則設定為需要進行憑證架構的用戶端驗證和伺服器驗證。Creates an asymmetric security binding element that is configured to require certificate-based client authentication as well as certificate-based server authentication. 這個驗證模式可以用來確保雙向訊息交換模式的安全性,並且需要透過範圍外的用戶端憑證來設定服務。This authentication mode can be used to secure duplex message exchange patterns and requires the service to be configured with the client certificate out of band.

CreateSecureConversationBindingElement(SecurityBindingElement)

建立對稱式安全性繫結項目,這個項目則設定為建立用戶端與服務之間的安全對話。Creates a symmetric security binding element that is configured to establish a secure conversation between the client and service. 在安全對話交換結束時發出的安全性內容權杖是用來確保這些訊息的安全。The security context token issued at the end of the secure conversation handshake is used to secure the messages. 啟動安裝安全性繫結項目會指定如何保護安全對話交換訊息。The bootstrap security binding element specifies how the secure conversation handshake messages are secured.

CreateSecureConversationBindingElement(SecurityBindingElement, Boolean)

建立對稱式安全性繫結項目,這個項目則設定為建立用戶端與服務之間的安全對話。Creates a symmetric security binding element that is configured to establish a secure conversation between the client and service. 在安全對話交換結束時發出的安全性內容權杖是用來確保這些訊息的安全。The security context token issued at the end of the secure conversation handshake is used to secure the messages.

CreateSecureConversationBindingElement(SecurityBindingElement, Boolean, ChannelProtectionRequirements)

建立對稱式安全性繫結項目,這個項目則設定為建立用戶端與服務之間的安全對話。Creates a symmetric security binding element that is configured to establish a secure conversation between the client and service. 在安全對話交換結束時發出的安全性內容權杖是用來確保這些訊息的安全。The security context token issued at the end of the secure conversation handshake is used to secure the messages. 啟動安裝安全性繫結項目會指定如何保護安全對話交換訊息。The bootstrap security binding element specifies how the secure conversation handshake messages are secured.

CreateSslNegotiationBindingElement(Boolean)

建立對稱式安全性繫結項目,這個項目則設定為執行用戶端與伺服器之間的 SOAP 層級的 SSL 交涉,同時指示是否需要用戶端憑證。Creates a symmetric security binding element that is configured to do SOAP-level SSL negotiation between the client and server, noting whether a client certificate is required.

CreateSslNegotiationBindingElement(Boolean, Boolean)

建立對稱式安全性繫結項目,這個項目會執行 SOAP SSL 交涉,同時指示是否需要用戶端憑證和取消。Creates a symmetric security binding element that does SOAP SSL negotiation, noting whether a client certificate and cancellation is required.

CreateSspiNegotiationBindingElement()

建立對稱式安全性繫結項目,這個項目會根據交涉式驗證封裝來執行 SOAP SSPI 交涉。Creates a symmetric security binding element that does SOAP SSPI negotiation based on the Negotiate authentication package.

CreateSspiNegotiationBindingElement(Boolean)

建立對稱式安全性繫結項目,這個項目會根據交涉式驗證封裝來執行 SOAP SSPI 交涉。Creates a symmetric security binding element that does SOAP SSPI negotiation based on the Negotiate authentication package.

CreateSspiNegotiationOverTransportBindingElement()

建立安全性繫結項目,這個項目則設定為使用交涉式驗證封裝,根據 SOAP SSPI 交涉來進行用戶端驗證。Creates a security binding element that is configured for client authentication based on SOAP SSPI negotiation using the Negotiate authentication package. 這個繫結項目需要傳輸提供伺服器驗證和訊息保護 (例如 HTTPS)。The binding element requires the transport to provide server authentication and message protection (for example, HTTPS).

CreateSspiNegotiationOverTransportBindingElement(Boolean)

建立安全性繫結項目,這個項目則設定為使用交涉式驗證封裝,根據 SOAP SSPI 交涉來進行用戶端驗證。Creates a security binding element that is configured for client authentication based on SOAP SSPI negotiation using the Negotiate authentication package. 這個繫結項目需要傳輸提供伺服器驗證和訊息保護 (例如 HTTPS)。The binding element requires the transport to provide server authentication and message protection (for example, HTTPS).

CreateUserNameForCertificateBindingElement()

建立對稱式安全性繫結項目,這個項目則設定為需要進行使用者名稱和密碼架構的用戶端驗證,並且進行憑證架構的伺服器驗證。Creates a symmetric security binding element that is configured to require user name- and password-based client authentication and certificate-based server authentication. 建立的繫結項目需要使用服務憑證來設定用戶端,該憑證在開啟與服務的通訊通道之前是超出範圍的。The created binding element requires the client to be configured with a service certificate that is out-of-band before opening a communication channel with a service.

CreateUserNameForSslBindingElement()

建立對稱式安全性繫結項目,這個項目則設定為需要進行使用者名稱和密碼架構的用戶端驗證,並且進行憑證架構的伺服器驗證。Creates a symmetric security binding element that is configured to require user name- and password-based client authentication and certificate-based server authentication. 用戶端會使用 SOAP 層級的 SSL 通訊協定來驗證伺服器。The client authenticates the server using the SOAP-level SSL protocol.

CreateUserNameForSslBindingElement(Boolean)

建立對稱式安全性繫結項目,這個項目則設定為需要進行使用者名稱和密碼架構的用戶端驗證,並且進行憑證架構的伺服器驗證。Creates a symmetric security binding element that is configured to require user name- and password-based client authentication and certificate-based server authentication. 用戶端會使用 SOAP 層級的 SSL 通訊協定來驗證伺服器。The client authenticates the server using the SOAP-level SSL protocol.

CreateUserNameOverTransportBindingElement()

建立安全性繫結項目,這個項目則設定為以 SOAP 訊息傳送之一部分的使用者名稱和密碼為基礎的用戶端驗證。Creates a security binding element that is configured for client authentication based on a user name and password sent as part of the SOAP message. 這個繫結項目需要傳輸提供伺服器驗證和訊息保護 (例如 HTTPS)。The binding element requires the transport to provide server authentication and message protection (for example, HTTPS).

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetProperty<T>(BindingContext)

取得使用指定之 BindingContext 的指定物件。Gets a specified object using the specified BindingContext.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
SetIssuerBindingContextIfRequired(SecurityTokenParameters, BindingContext)

設定權杖需求屬性的索引鍵,如果是有關已發行權杖的需求,其值便會是用來與發行方溝通的 BindingContext。Sets the key for the token requirement property whose value is the BindingContext used to talk to the issuing party if the requirement is for an issued token.

SetKeyDerivation(Boolean)

設定值,這個值表示是否需要衍生金鑰。Sets a value that indicates whether derived keys are required.

ToString()

傳回這個類別的描述。Returns a description of this class.

適用於

另請參閱