This documentation is archived and is not being maintained.

LocalClientSecuritySettings Class

Specifies local client security settings.


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

public sealed class LocalClientSecuritySettings

The LocalClientSecuritySettings type exposes the following members.

Public methodSupported by Portable Class LibraryLocalClientSecuritySettingsInitializes a new instance of the LocalClientSecuritySettings class.

Public propertyCacheCookiesGets or sets a value that indicates whether secure conversation cookies are cached.
Public propertyCookieRenewalThresholdPercentageGets or sets the threshold percentage for renewal of secure conversation cookies.
Public propertyDetectReplaysGets or sets a value that indicates whether replay detection is enabled on messages the client receives from the service.
Public propertyIdentityVerifierGets or sets the identity verifier.
Public propertySupported by Portable Class LibraryMaxClockSkewGets or sets the maximum allowable time difference between the system clocks of the two parties that are communicating.
Public propertyMaxCookieCachingTimeGets or sets the maximum caching time for secure conversation cookies.
Public propertyReconnectTransportOnFailureGets or sets a value that indicates whether security sessions attempt to reconnect after transport failures.
Public propertyReplayCacheSizeGets or sets the number of cached nonces used for replay detection.
Public propertySupported by Portable Class LibraryReplayWindowGets or sets the maximum time that a message nonce is valid.
Public propertySessionKeyRenewalIntervalGets or sets the time span after which the initiator renews the key for the security session.
Public propertySessionKeyRolloverIntervalGets or sets the time interval for which the previous session key is valid on incoming messages during a key renewal.
Public propertySupported by Portable Class LibraryTimestampValidityDurationGets or sets the maximum duration that the messages are valid when sent by the client. If a message is received by the service after this duration, it should discard the message.

Public methodSupported by Portable Class LibraryCloneCreates a new instance of this class, which is a copy or clone of the current instance.
Public methodSupported by Portable Class LibraryEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Portable Class LibraryFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Portable Class LibraryGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Portable Class LibraryGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Portable Class LibraryMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Portable Class LibraryToStringReturns a string that represents the current object. (Inherited from Object.)

This class contains the local security settings used by the SecurityBindingElement (and classes derived from it) to build the security channel. These settings are local to the client and are not determined from the service's security policy.

This example shows how to use the LocalClientSecuritySettings class.

// Create an instance of the binding to use.
WSHttpBinding b = new WSHttpBinding();

// Get the binding element collection.
BindingElementCollection bec = b.CreateBindingElements();

// Find the SymmetricSecurityBindingElement in the collection.
// Important: Cast to the SymmetricSecurityBindingElement when using the Find
// method.
SymmetricSecurityBindingElement sbe = (SymmetricSecurityBindingElement)

// Get the LocalSecuritySettings from the binding element.
LocalClientSecuritySettings lc = sbe.LocalClientSettings;

// Print out values.
Console.WriteLine("Maximum cookie caching time: {0} days", lc.MaxCookieCachingTime.Days);
Console.WriteLine("Replay Cache Size: {0}", lc.ReplayCacheSize);
Console.WriteLine("ReplayWindow: {0} minutes", lc.ReplayWindow.Minutes);
Console.WriteLine("MaxClockSkew: {0} minutes", lc.MaxClockSkew.Minutes);

// Change the MaxClockSkew to 3 minutes.
lc.MaxClockSkew = new TimeSpan(0, 0, 3, 0);

// Print the new value.
Console.WriteLine("New MaxClockSkew: {0} minutes", lc.MaxClockSkew.Minutes);

// Create an EndpointAddress for the service.
EndpointAddress ea = new EndpointAddress("http://localhost/calculator");

// Create a client. The binding has the changed MaxClockSkew.
// CalculatorClient cc = new CalculatorClient(b, ea);
// Use the new client. (Not shown.)
// cc.Close();

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

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.