Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / LocalServiceSecuritySettings.cs / 1 / LocalServiceSecuritySettings.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.ServiceModel.Channels
{
using System;
using System.ServiceModel;
using System.Runtime.Serialization;
using System.ServiceModel.Security;
using System.Web.Security;
using System.Collections.ObjectModel;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
public sealed class LocalServiceSecuritySettings
{
bool detectReplays;
int replayCacheSize;
TimeSpan replayWindow;
TimeSpan maxClockSkew;
TimeSpan issuedCookieLifetime;
int maxStatefulNegotiations;
TimeSpan negotiationTimeout;
int maxCachedCookies;
int maxPendingSessions;
TimeSpan inactivityTimeout;
TimeSpan sessionKeyRenewalInterval;
TimeSpan sessionKeyRolloverInterval;
bool reconnectTransportOnFailure;
TimeSpan timestampValidityDuration;
LocalServiceSecuritySettings(LocalServiceSecuritySettings other)
{
this.detectReplays = other.detectReplays;
this.replayCacheSize = other.replayCacheSize;
this.replayWindow = other.replayWindow;
this.maxClockSkew = other.maxClockSkew;
this.issuedCookieLifetime = other.issuedCookieLifetime;
this.maxStatefulNegotiations = other.maxStatefulNegotiations;
this.negotiationTimeout = other.negotiationTimeout;
this.maxPendingSessions = other.maxPendingSessions;
this.inactivityTimeout = other.inactivityTimeout;
this.sessionKeyRenewalInterval = other.sessionKeyRenewalInterval;
this.sessionKeyRolloverInterval = other.sessionKeyRolloverInterval;
this.reconnectTransportOnFailure = other.reconnectTransportOnFailure;
this.timestampValidityDuration = other.timestampValidityDuration;
this.maxCachedCookies = other.maxCachedCookies;
}
public bool DetectReplays
{
get
{
return this.detectReplays;
}
set
{
this.detectReplays = value;
}
}
public int ReplayCacheSize
{
get
{
return this.replayCacheSize;
}
set
{
if (value < 0)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.ValueMustBeNonNegative)));
}
this.replayCacheSize = value;
}
}
public TimeSpan ReplayWindow
{
get
{
return this.replayWindow;
}
set
{
if (value < TimeSpan.Zero)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRange0)));
}
if (TimeoutHelper.IsTooLarge(value))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRangeTooBig)));
}
this.replayWindow = value;
}
}
public TimeSpan MaxClockSkew
{
get
{
return this.maxClockSkew;
}
set
{
if (value < TimeSpan.Zero)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRange0)));
}
if (TimeoutHelper.IsTooLarge(value))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRangeTooBig)));
}
this.maxClockSkew = value;
}
}
public TimeSpan IssuedCookieLifetime
{
get
{
return this.issuedCookieLifetime;
}
set
{
if (value < TimeSpan.Zero)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRange0)));
}
if (TimeoutHelper.IsTooLarge(value))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRangeTooBig)));
}
this.issuedCookieLifetime = value;
}
}
public int MaxStatefulNegotiations
{
get
{
return this.maxStatefulNegotiations;
}
set
{
if (value < 0)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.ValueMustBeNonNegative)));
}
this.maxStatefulNegotiations = value;
}
}
public TimeSpan NegotiationTimeout
{
get
{
return this.negotiationTimeout;
}
set
{
if (value < TimeSpan.Zero)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRange0)));
}
if (TimeoutHelper.IsTooLarge(value))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRangeTooBig)));
}
this.negotiationTimeout = value;
}
}
public int MaxPendingSessions
{
get
{
return this.maxPendingSessions;
}
set
{
if (value < 0)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.ValueMustBeNonNegative)));
}
this.maxPendingSessions = value;
}
}
public TimeSpan InactivityTimeout
{
get
{
return this.inactivityTimeout;
}
set
{
if (value < TimeSpan.Zero)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRange0)));
}
if (TimeoutHelper.IsTooLarge(value))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRangeTooBig)));
}
this.inactivityTimeout = value;
}
}
public TimeSpan SessionKeyRenewalInterval
{
get
{
return this.sessionKeyRenewalInterval;
}
set
{
if (value < TimeSpan.Zero)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRange0)));
}
if (TimeoutHelper.IsTooLarge(value))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRangeTooBig)));
}
this.sessionKeyRenewalInterval = value;
}
}
public TimeSpan SessionKeyRolloverInterval
{
get
{
return this.sessionKeyRolloverInterval;
}
set
{
if (value < TimeSpan.Zero)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRange0)));
}
if (TimeoutHelper.IsTooLarge(value))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRangeTooBig)));
}
this.sessionKeyRolloverInterval = value;
}
}
public bool ReconnectTransportOnFailure
{
get
{
return this.reconnectTransportOnFailure;
}
set
{
this.reconnectTransportOnFailure = value;
}
}
public TimeSpan TimestampValidityDuration
{
get
{
return this.timestampValidityDuration;
}
set
{
if (value < TimeSpan.Zero)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRange0)));
}
if (TimeoutHelper.IsTooLarge(value))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRangeTooBig)));
}
this.timestampValidityDuration = value;
}
}
public int MaxCachedCookies
{
get
{
return this.maxCachedCookies;
}
set
{
if (value < 0)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.ValueMustBeNonNegative)));
}
this.maxCachedCookies = value;
}
}
public LocalServiceSecuritySettings()
{
this.DetectReplays = SecurityProtocolFactory.defaultDetectReplays;
this.ReplayCacheSize = SecurityProtocolFactory.defaultMaxCachedNonces;
this.ReplayWindow = SecurityProtocolFactory.defaultReplayWindow;
this.MaxClockSkew = SecurityProtocolFactory.defaultMaxClockSkew;
this.IssuedCookieLifetime = NegotiationTokenAuthenticator.defaultServerIssuedTokenLifetime;
this.MaxStatefulNegotiations = NegotiationTokenAuthenticator.defaultServerMaxActiveNegotiations;
this.NegotiationTimeout = NegotiationTokenAuthenticator.defaultServerMaxNegotiationLifetime;
this.maxPendingSessions = SecuritySessionServerSettings.defaultMaximumPendingSessions;
this.inactivityTimeout = SecuritySessionServerSettings.defaultInactivityTimeout;
this.sessionKeyRenewalInterval = SecuritySessionServerSettings.defaultKeyRenewalInterval;
this.sessionKeyRolloverInterval = SecuritySessionServerSettings.defaultKeyRolloverInterval;
this.reconnectTransportOnFailure = SecuritySessionServerSettings.defaultTolerateTransportFailures;
this.TimestampValidityDuration = SecurityProtocolFactory.defaultTimestampValidityDuration;
this.maxCachedCookies = NegotiationTokenAuthenticator.defaultServerMaxCachedTokens;
}
public LocalServiceSecuritySettings Clone()
{
return new LocalServiceSecuritySettings(this);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ProtectedConfigurationSection.cs
- ProfileGroupSettingsCollection.cs
- HTMLTextWriter.cs
- CacheOutputQuery.cs
- SystemEvents.cs
- AnnotationHighlightLayer.cs
- SystemColors.cs
- MembershipUser.cs
- XPathSelectionIterator.cs
- DynamicDiscoSearcher.cs
- ExtensionQuery.cs
- DbProviderSpecificTypePropertyAttribute.cs
- MenuRenderer.cs
- OptimizerPatterns.cs
- OneOf.cs
- __ComObject.cs
- Resources.Designer.cs
- CollectionChangeEventArgs.cs
- BitmapEffectDrawing.cs
- EventLogInformation.cs
- DrawTreeNodeEventArgs.cs
- WebPartChrome.cs
- Point.cs
- _NetRes.cs
- GCHandleCookieTable.cs
- RankException.cs
- DesignerOptionService.cs
- ApplicationCommands.cs
- WebZone.cs
- Evidence.cs
- PageStatePersister.cs
- TextDecorations.cs
- EnumerableRowCollection.cs
- StopStoryboard.cs
- ErrorFormatter.cs
- SByteConverter.cs
- SiteMembershipCondition.cs
- SchemaMapping.cs
- BidirectionalDictionary.cs
- SqlUserDefinedTypeAttribute.cs
- Math.cs
- IssuanceTokenProviderBase.cs
- WebBrowserUriTypeConverter.cs
- CodeNamespace.cs
- OdbcConnectionHandle.cs
- Console.cs
- FlowDocumentFormatter.cs
- HttpSysSettings.cs
- FileChangesMonitor.cs
- MasterPageCodeDomTreeGenerator.cs
- PropertyRecord.cs
- XmlDocumentType.cs
- CatalogPartChrome.cs
- ListenerElementsCollection.cs
- Expression.cs
- DictionaryEntry.cs
- HtmlHistory.cs
- FilterableAttribute.cs
- StopStoryboard.cs
- CommandField.cs
- GeometryHitTestParameters.cs
- BehaviorService.cs
- EmbeddedMailObject.cs
- SiteMapNodeItemEventArgs.cs
- ItemChangedEventArgs.cs
- SymmetricAlgorithm.cs
- ErasingStroke.cs
- MetadataFile.cs
- ApplicationTrust.cs
- PolyBezierSegmentFigureLogic.cs
- DetailsViewDeletedEventArgs.cs
- CompilationSection.cs
- ColumnHeader.cs
- PageAsyncTask.cs
- TableItemStyle.cs
- PlanCompilerUtil.cs
- PolicyValidationException.cs
- ProxyHelper.cs
- TdsParser.cs
- EdmProviderManifest.cs
- CryptographicAttribute.cs
- _ListenerRequestStream.cs
- XslVisitor.cs
- PartitionedStreamMerger.cs
- KeySpline.cs
- ChooseAction.cs
- ExpandableObjectConverter.cs
- ApplicationDirectoryMembershipCondition.cs
- CollectionView.cs
- ExpressionPrefixAttribute.cs
- BrowserDefinitionCollection.cs
- PerformanceCounterManager.cs
- KeyValueConfigurationCollection.cs
- ApplicationTrust.cs
- X509Extension.cs
- HtmlShimManager.cs
- EditorZone.cs
- ECDiffieHellman.cs
- DataBindingCollection.cs
- ReferencedCollectionType.cs