Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SecurityBindingElement.CreateSecureConversationBindingElement Method (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.

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

public static SecurityBindingElement CreateSecureConversationBindingElement(
	SecurityBindingElement bootstrapSecurity,
	bool requireCancellation
)

Parameters

bootstrapSecurity
Type: System.ServiceModel.Channels.SecurityBindingElement

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

requireCancellation
Type: System.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.

ExceptionCondition
ArgumentNullException

bootstrapSecurity is null.

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.

NoteNote

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.

The following code shows how to call this method.

SecurityBindingElement security = SecurityBindingElement.CreateMutualCertificateBindingElement();

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft