WindowsStreamSecurityBindingElement Class


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Represents the binding element used to specify Windows stream security settings.

Namespace:   System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)


public class WindowsStreamSecurityBindingElement : StreamUpgradeBindingElement, 
	ITransportTokenAssertionProvider, IPolicyExportExtension


Initializes a new instance of the WindowsStreamSecurityBindingElement class.


Initializes a new instance of the WindowsStreamSecurityBindingElement class from an existing instance.


Gets or sets the protection level.


Creates a channel factory that can be used to create a channel.(Overrides BindingElement.BuildChannelFactory<TChannel>(BindingContext).)


Creates a channel listener of the specified type.(Overrides BindingElement.BuildChannelListener<TChannel>(BindingContext).)


Creates an instance on the client of the StreamUpgradeProvider based on the channel context provided.(Overrides StreamUpgradeBindingElement.BuildClientStreamUpgradeProvider(BindingContext).)


Creates an instance on the server of the StreamUpgradeProvider based on the channel context provided.(Overrides StreamUpgradeBindingElement.BuildServerStreamUpgradeProvider(BindingContext).)


Determines whether a channel factory of the specified type can be built.(Overrides BindingElement.CanBuildChannelFactory<TChannel>(BindingContext).)


Determines whether a channel listener of the specified type can be built.(Overrides BindingElement.CanBuildChannelListener<TChannel>(BindingContext).)


Creates a new binding element from this instance of the class. (Overrides BindingElement.Clone().)


Determines whether the specified object is equal to the current object.(Inherited from Object.)


Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)


Serves as the default hash function. (Inherited from Object.)


Gets a specified object from the BindingContext.(Overrides BindingElement.GetProperty<T>(BindingContext).)


Gets the XmlElement that represents the transport token used in the security binding.


Gets the Type of the current instance.(Inherited from Object.)


Creates a shallow copy of the current Object.(Inherited from Object.)


Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIPolicyExportExtension.ExportPolicy(MetadataExporter, PolicyConversionContext)

Exports a custom policy assertion about Windows stream security.

Transports that use a stream-oriented protocol such as TCP and named pipes support stream-based transport upgrades. Specifically, WCF provides security upgrades. The configuration of this transport security is encapsulated by this class as well as by SslStreamSecurityBindingElement, which can be configured and added to a custom binding. In addition, a third party can write its own custom StreamSecurityBindingElement. These binding elements extend the StreamUpgradeBindingElement class that is called to build the client and server stream upgrade providers.

A custom binding contains a collection of binding elements arranged in a specific order: the element representing 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

  1. Create any required custom binding elements that are above this binding element in the binding stack, such as the optional TransactionFlowBindingElement and ReliableSessionBindingElement.

  2. Add the created elements in the order described previously to the BindingElementCollection using the InsertItem method.

  3. Create an instance of WindowsStreamSecurityBindingElement and add it to the collection.

  4. Add any additional custom binding elements to the collection, such as TcpTransportBindingElement.

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top