SecurityBindingElement.CreateSecureConversationBindingElement Method

Definition

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.

Overloads

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.

CreateSecureConversationBindingElement(SecurityBindingElement)

Source:
SecurityBindingElement.cs
Source:
SecurityBindingElement.cs

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.

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

Parameters

bootstrapSecurity
SecurityBindingElement

A SecurityBindingElement that contains specification on how the secure conversation handshake messages are secured.

Returns

A SecurityBindingElement object.

Exceptions

bootstrapSecurity is null.

Remarks

The binding element is configured to use session-based security context tokens.

The bootstrapSecurity is used to indicate the security binding and policy used to request a secure conversation token from the service.

If bootstrapSecurity is a TransportSecurityBindingElement, the binding element returned by this method is also one, and IncludeTimestamp is set to true; and the LocalClientSecuritySettings object returned from LocalClientSettings has its DetectReplays property set to false; and the LocalServiceSecuritySettings object returned from LocalServiceSettings has its DetectReplays property set to false.

Otherwise, a SymmetricSecurityBindingElement is returned, with RequireSignatureConfirmation set to false.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET Core 1.0, Core 1.1, 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
.NET Standard 2.0 (package-provided)
UWP 10.0

CreateSecureConversationBindingElement(SecurityBindingElement, Boolean)

Source:
SecurityBindingElement.cs
Source:
SecurityBindingElement.cs

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.

C#
public static System.ServiceModel.Channels.SecurityBindingElement CreateSecureConversationBindingElement(System.ServiceModel.Channels.SecurityBindingElement bootstrapSecurity, bool requireCancellation);

Parameters

bootstrapSecurity
SecurityBindingElement

A SecurityBindingElement that contains specification on how the secure conversation handshake messages are secured.

requireCancellation
Boolean

true if cancellation is required; otherwise, false. Setting this parameter to false enables a security context token that is useful in Web farm scenarios, because in this mode the session state is encoded inside the established security context token instead of being kept in the server memory.

Returns

A SecurityBindingElement object.

Exceptions

bootstrapSecurity is null.

Examples

The following code shows how to call this method.

C#
SecurityBindingElement security = SecurityBindingElement.CreateMutualCertificateBindingElement();

// Use a secure session.
security = SecurityBindingElement.CreateSecureConversationBindingElement(security, true);

Remarks

If requireCancellation is false, cookie-based security context tokens are issued; otherwise, session-based security context tokens are issued.

The bootstrapSecurity is used to indicate the security binding and policy used to request a SecureConversationToken from the service.

If bootstrapSecurity is a TransportSecurityBindingElement, the binding element returned by this method is also a TransportSecurityBindingElement, and IncludeTimestamp is set to true; and the LocalClientSecuritySettings object returned from LocalClientSettings has its DetectReplays property set to false; and the LocalServiceSecuritySettings object returned from LocalServiceSettings has its DetectReplays property set to false.

Otherwise, a SymmetricSecurityBindingElement is returned, with RequireSignatureConfirmation set to false.

Note

When impersonation is required on Windows XP, use a secure session without a security context token. When security context tokens are used with impersonation an InvalidOperationException is thrown. For more information, see Unsupported Scenarios. For more information about secure sessions, see Secure Sessions.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.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

CreateSecureConversationBindingElement(SecurityBindingElement, Boolean, ChannelProtectionRequirements)

Source:
SecurityBindingElement.cs
Source:
SecurityBindingElement.cs

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.

C#
public static System.ServiceModel.Channels.SecurityBindingElement CreateSecureConversationBindingElement(System.ServiceModel.Channels.SecurityBindingElement bootstrapSecurity, bool requireCancellation, System.ServiceModel.Security.ChannelProtectionRequirements bootstrapProtectionRequirements);

Parameters

bootstrapSecurity
SecurityBindingElement

A SecurityBindingElement that contains specification on how the secure conversation handshake messages are secured.

requireCancellation
Boolean

true if cancellation is required; otherwise, false. Setting this parameter to false enables a security context token that is useful in Web farm scenarios, because in this mode the session state is encoded inside the established security context token instead of being kept in the server memory.

bootstrapProtectionRequirements
ChannelProtectionRequirements

The ChannelProtectionRequirements object that specifies the requirements for channel protection.

Returns

A SecurityBindingElement object.

Exceptions

bootstrapSecurity is null.

Remarks

The bootstrapProtectionRequirements parameter enables customization of how the messages exchanged as part of the secure conversation handshake are secured.

The bootstrapSecurity is used to indicate the security binding and policy used to request a secure conversation token from the service.

If bootstrapSecurity is a TransportSecurityBindingElement, the binding element returned by this method is also a TransportSecurityBindingElement, and IncludeTimestamp is set to true; and the LocalClientSecuritySettings object returned from LocalClientSettings has its DetectReplays property set to false; and the LocalServiceSecuritySettings object returned from LocalServiceSettings has its DetectReplays property set to false.

Otherwise, a SymmetricSecurityBindingElement is returned, with RequireSignatureConfirmation set to false.

Note

When impersonation is required on Windows XP, use a secure session without a security context token. When security context tokens are used with impersonation an InvalidOperationException is thrown. For more information, see Unsupported Scenarios. For more information about secure sessions, see Secure Sessions.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.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