This topic has not yet been rated - Rate this topic

AsymmetricSecurityBindingElement Class

Represents a custom binding element that supports channel security using asymmetric encryption. This binding element signs the message using the sender's authentication token and encrypts the message using the recipient's token.

System.Object
  System.ServiceModel.Channels.BindingElement
    System.ServiceModel.Channels.SecurityBindingElement
      System.ServiceModel.Channels.AsymmetricSecurityBindingElement

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)
public sealed class AsymmetricSecurityBindingElement : SecurityBindingElement, 
	IPolicyExportExtension

The AsymmetricSecurityBindingElement type exposes the following members.

  Name Description
Public method AsymmetricSecurityBindingElement() Creates an instance of this class.
Public method AsymmetricSecurityBindingElement(SecurityTokenParameters) Initializes a new instance of AsymmetricSecurityBindingElement with the specified recipient token parameters.
Public method AsymmetricSecurityBindingElement(SecurityTokenParameters, SecurityTokenParameters) Initializes a new instance of AsymmetricSecurityBindingElement with the specified recipient and initiator token parameters.
Top
  Name Description
Public property AllowInsecureTransport Gets or sets a value that indicates whether mixed-mode secured messages can be sent over an unsecured transport such as HTTP. (Inherited from SecurityBindingElement.)
Public property AllowSerializedSigningTokenOnReply Gets or sets a value that indicates whether serializing a signing token on a reply message is allowed.
Public property DefaultAlgorithmSuite Gets or sets the message encryption and key-wrap algorithms. (Inherited from SecurityBindingElement.)
Public property EnableUnsecuredResponse Gets or sets a value that indicates whether can send and receive unsecured responses to secured requests. (Inherited from SecurityBindingElement.)
Public property EndpointSupportingTokenParameters Gets the endpoint that supports token parameters. (Inherited from SecurityBindingElement.)
Public property IncludeTimestamp Gets or sets a value that indicates whether time stamps are included in each message. (Inherited from SecurityBindingElement.)
Public property InitiatorTokenParameters Specifies the token definition for the initiator.
Public property KeyEntropyMode Gets or sets the source of entropy used to create keys. (Inherited from SecurityBindingElement.)
Public property LocalClientSettings Gets the binding properties specific to local security settings used by the client. (Inherited from SecurityBindingElement.)
Public property LocalServiceSettings Gets the binding properties specific to local security settings used by the service. (Inherited from SecurityBindingElement.)
Public property MessageProtectionOrder Gets or sets the order of message encryption and signing for this binding.
Public property MessageSecurityVersion Gets or sets the message security version. (Inherited from SecurityBindingElement.)
Public property OperationSupportingTokenParameters Gets the collection of operation supporting token parameters. (Inherited from SecurityBindingElement.)
Public property OptionalEndpointSupportingTokenParameters Gets the optional supporting token parameters for the service endpoint. (Inherited from SecurityBindingElement.)
Public property OptionalOperationSupportingTokenParameters Gets the collection of optional operation supporting token parameters. (Inherited from SecurityBindingElement.)
Public property RecipientTokenParameters Specifies the token definition for the recipient.
Public property RequireSignatureConfirmation Gets or sets a value that indicates whether message signatures must be confirmed.
Public property SecurityHeaderLayout Gets or sets the ordering of the elements in the security header for this binding. (Inherited from SecurityBindingElement.)
Top
  Name Description
Public method BuildChannelFactory<TChannel> Creates a channel factory based on the SecurityBindingElement settings and the binding context passed in. 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). (Inherited from SecurityBindingElement.)
Protected method BuildChannelFactoryCore<TChannel> When implemented, creates a channel factory of a specified type. (Inherited from SecurityBindingElement.)
Public method BuildChannelListener<TChannel> Creates a channel listener based on the SecurityBindingElement settings and the binding context passed in. (Inherited from SecurityBindingElement.)
Protected method BuildChannelListenerCore<TChannel> When implemented, creates a channel listener of a specified type. (Inherited from SecurityBindingElement.)
Public method CanBuildChannelFactory<TChannel> Gets a value that indicates whether a channel factory of the specified type can be built. (Inherited from SecurityBindingElement.)
Public method CanBuildChannelListener<TChannel> Gets a value that indicates whether a channel listener of the specified type can be built. (Inherited from SecurityBindingElement.)
Public method Clone Creates a new instance of this class initialized from the current one. (Overrides BindingElement.Clone().)
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetProperty<T> Gets a specified object from the BindingContext. (Overrides SecurityBindingElement.GetProperty<T>(BindingContext).)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method SetKeyDerivation Sets a value that indicates whether derived keys are required. (Overrides SecurityBindingElement.SetKeyDerivation(Boolean).)
Public method ToString Returns a string that represents this AsymmetricSecurityBindingElement instance. (Overrides SecurityBindingElement.ToString().)
Top
  Name Description
Explicit interface implemetation Private method IPolicyExportExtension.ExportPolicy Exports a custom policy assertion about bindings, which is added to the Web Services Description Language (WSDL) information.
Top

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 forth.

To add this class to a binding

  1. Create a BindingElementCollection.

  2. Create custom binding elements that is above this binding element in the binding stack, such as the optional TransactionFlowBindingElement and ReliableSessionBindingElement.

  3. Add the created elements in the preceding order to the BindingElementCollection using the InsertItem(Int32, BindingElement) method.

  4. Create an instance of AsymmetricSecurityBindingElement and add it to the collection.

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

Before using this class, you should determine if a standard binding meets your security requirements.

Note Note

Once an instance of this object is created, you should treat the properties of its base class SecurityBindingElement as immutable. Calling set on some properties may have unpredictable effects: the binding may behave as if the property retained its old value, with a run-time failure being the only indication of an issue. Two properties known to behave this way are KeyType and MessageSecurityVersion. There may be other properties this is true of.

The following example shows how to use this class to create a custom binding that includes this class as a security binding element. For more information about the code in this example, see How To: Reference X.509 Certificates Consistently.


public Binding CreateClientBinding()
{
    //<snippet2>
    AsymmetricSecurityBindingElement abe =
        (AsymmetricSecurityBindingElement)SecurityBindingElement.
        CreateMutualCertificateBindingElement(
        MessageSecurityVersion.
        WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10);

    abe.SetKeyDerivation(false);

    X509SecurityTokenParameters istp =
       abe.InitiatorTokenParameters as X509SecurityTokenParameters;
    if (istp != null)
    {
        istp.X509ReferenceStyle =
        X509KeyIdentifierClauseType.IssuerSerial;
    }
    X509SecurityTokenParameters rstp =
    abe.RecipientTokenParameters as X509SecurityTokenParameters;
    if (rstp != null)
    {
        rstp.X509ReferenceStyle =
        X509KeyIdentifierClauseType.IssuerSerial;
    }

    HttpTransportBindingElement transport = 
        new HttpTransportBindingElement();

    return new CustomBinding(abe, transport);
}


.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ