SecurityBindingElement.CreateMutualCertificateBindingElement Method

Definition

Creates an asymmetric security binding element that is configured to require certificate-based client authentication as well as certificate-based server authentication.

Overloads

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.

Remarks

The client must be configured with its certificate as well as the server's certificate. The server must be configured with its certificate.

CreateMutualCertificateBindingElement()

Source:
SecurityBindingElement.cs
Source:
SecurityBindingElement.cs

Creates an asymmetric security binding element that is configured to require certificate-based client authentication as well as certificate-based server authentication.

C#
public static System.ServiceModel.Channels.SecurityBindingElement CreateMutualCertificateBindingElement();

Returns

A SecurityBindingElement object.

Examples

The following code shows how to call this method.

C#
SecurityBindingElement security = SecurityBindingElement.CreateMutualCertificateBindingElement();

Remarks

The binding is configured so that a new random symmetric key (encrypted for the server) is generated for every request by the client and is used to protect the request as well as the response from the server. The client's certificate is used as an endorsing supporting token on the request.

A AsymmetricSecurityBindingElement is actually created.

Applies to

.NET 10 (package-provided) an aner Versiounen
Produkt Versiounen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

CreateMutualCertificateBindingElement(MessageSecurityVersion)

Source:
SecurityBindingElement.cs
Source:
SecurityBindingElement.cs

Creates an asymmetric security binding element that is configured to require certificate-based client authentication as well as certificate-based server authentication.

C#
public static System.ServiceModel.Channels.SecurityBindingElement CreateMutualCertificateBindingElement(System.ServiceModel.MessageSecurityVersion version);

Parameters

version
MessageSecurityVersion

The message security version.

Returns

A SecurityBindingElement object.

Exceptions

version is null.

Remarks

If the version is WSSecurity10, then the binding element is configured so that the client request is signed by its certificate and encrypted with the server certificate.

If the version is WSSecurity11, then the binding element is configured so that a new random symmetric key (encrypted for the server) is generated for every request by the client and is used to protect the request as well as the response from the server. The client's certificate is used as an endorsing supporting token on the request.

Notiz

Once a SecurityBindingElement object is created by calling this method, the MessageSecurityVersion property is immutable. Calling set on it does not change it.

Applies to

.NET 10 (package-provided) an aner Versiounen
Produkt Versiounen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

CreateMutualCertificateBindingElement(MessageSecurityVersion, Boolean)

Source:
SecurityBindingElement.cs
Source:
SecurityBindingElement.cs

Creates an asymmetric security binding element that is configured to require certificate-based client authentication as well as certificate-based server authentication.

C#
public static System.ServiceModel.Channels.SecurityBindingElement CreateMutualCertificateBindingElement(System.ServiceModel.MessageSecurityVersion version, bool allowSerializedSigningTokenOnReply);

Parameters

version
MessageSecurityVersion

The message security version.

allowSerializedSigningTokenOnReply
Boolean

true to allow a serialized signing token on the reply; otherwise, false.

Returns

A SecurityBindingElement object.

Exceptions

version is null.

Remarks

The allowSerializedSigningTokenOnReply parameter, when true, enables interoperability with older versions of Web Services Enhancements (WSE).

Notiz

Once a SecurityBindingElement object is created by calling this method, the MessageSecurityVersion property should be treated as immutable. Inconsistent binding behavior may occur if this value is modified.

Applies to

.NET 10 (package-provided) an aner Versiounen
Produkt Versiounen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1