This documentation is archived and is not being maintained.
LocalClientSecuritySettings Class
Visual Studio 2008
Specifies local client security settings.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
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();
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: