This topic has not yet been rated - Rate this topic

LocalClientSecuritySettings Class

Specifies local client security settings.

System.Object
  System.ServiceModel.Channels.LocalClientSecuritySettings

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)
public sealed class LocalClientSecuritySettings

The LocalClientSecuritySettings type exposes the following members.

  Name Description
Public method Supported by Portable Class Library LocalClientSecuritySettings Initializes a new instance of the LocalClientSecuritySettings class.
Top
  Name Description
Public property CacheCookies Gets or sets a value that indicates whether secure conversation cookies are cached.
Public property CookieRenewalThresholdPercentage Gets or sets the threshold percentage for renewal of secure conversation cookies.
Public property DetectReplays Gets or sets a value that indicates whether replay detection is enabled on messages the client receives from the service.
Public property IdentityVerifier Gets or sets the identity verifier.
Public property Supported by Portable Class Library MaxClockSkew Gets or sets the maximum allowable time difference between the system clocks of the two parties that are communicating.
Public property MaxCookieCachingTime Gets or sets the maximum caching time for secure conversation cookies.
Public property ReconnectTransportOnFailure Gets or sets a value that indicates whether security sessions attempt to reconnect after transport failures.
Public property ReplayCacheSize Gets or sets the number of cached nonces used for replay detection.
Public property Supported by Portable Class Library ReplayWindow Gets or sets the maximum time that a message nonce is valid.
Public property SessionKeyRenewalInterval Gets or sets the time span after which the initiator renews the key for the security session.
Public property SessionKeyRolloverInterval Gets or sets the time interval for which the previous session key is valid on incoming messages during a key renewal.
Public property Supported by Portable Class Library TimestampValidityDuration Gets 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.
Top
  Name Description
Public method Supported by Portable Class Library Clone Creates a new instance of this class, which is a copy or clone of the current instance.
Public method Supported by Portable Class Library Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Supported by Portable Class Library 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 Supported by Portable Class Library GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method Supported by Portable Class Library GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method Supported by Portable Class Library MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Supported by Portable Class Library ToString Returns a string that represents the current object. (Inherited from Object.)
Top

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)
    bec.Find<SecurityBindingElement>();

// 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);
Console.ReadLine();

// 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);
Console.ReadLine();

// 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.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ