LocalClientSecuritySettings Class
TOC
Collapse the table of content
Expand the table of content

LocalClientSecuritySettings Class

 

Specifies local client security settings.

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

System.Object
  System.ServiceModel.Channels.LocalClientSecuritySettings

public sealed class LocalClientSecuritySettings

NameDescription
System_CAPS_pubmethodLocalClientSecuritySettings()

Initializes a new instance of the LocalClientSecuritySettings class.

NameDescription
System_CAPS_pubpropertyCacheCookies

Gets or sets a value that indicates whether secure conversation cookies are cached.

System_CAPS_pubpropertyCookieRenewalThresholdPercentage

Gets or sets the threshold percentage for renewal of secure conversation cookies.

System_CAPS_pubpropertyDetectReplays

Gets or sets a value that indicates whether replay detection is enabled on messages the client receives from the service.

System_CAPS_pubpropertyIdentityVerifier

Gets or sets the identity verifier.

System_CAPS_pubpropertyMaxClockSkew

Gets or sets the maximum allowable time difference between the system clocks of the two parties that are communicating.

System_CAPS_pubpropertyMaxCookieCachingTime

Gets or sets the maximum caching time for secure conversation cookies.

System_CAPS_pubpropertyNonceCache

Gets or sets the cache for the local client security settings.

System_CAPS_pubpropertyReconnectTransportOnFailure

Gets or sets a value that indicates whether security sessions attempt to reconnect after transport failures.

System_CAPS_pubpropertyReplayCacheSize

Gets or sets the number of cached nonces used for replay detection.

System_CAPS_pubpropertyReplayWindow

Gets or sets the maximum time that a message nonce is valid.

System_CAPS_pubpropertySessionKeyRenewalInterval

Gets or sets the time span after which the initiator renews the key for the security session.

System_CAPS_pubpropertySessionKeyRolloverInterval

Gets or sets the time interval for which the previous session key is valid on incoming messages during a key renewal.

System_CAPS_pubpropertyTimestampValidityDuration

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.

NameDescription
System_CAPS_pubmethodClone()

Creates a new instance of this class, which is a copy or clone of the current instance.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns 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)
    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();

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft