Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Security / IssuedTokenClientCredential.cs / 1 / IssuedTokenClientCredential.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Security { using System.Collections.Generic; using System.ServiceModel.Channels; using System.ServiceModel; using System.ServiceModel.Description; using System.ServiceModel.Security.Tokens; public sealed class IssuedTokenClientCredential { SecurityKeyEntropyMode defaultKeyEntropyMode = AcceleratedTokenProvider.defaultKeyEntropyMode; KeyedByTypeCollectionlocalIssuerChannelBehaviors; Dictionary > issuerChannelBehaviors; bool cacheIssuedTokens = SpnegoTokenProvider.defaultClientCacheTokens; TimeSpan maxIssuedTokenCachingTime = SpnegoTokenProvider.DefaultClientMaxTokenCachingTime; EndpointAddress localIssuerAddress; Binding localIssuerBinding; int issuedTokenRenewalThresholdPercentage = AcceleratedTokenProvider.defaultServiceTokenValidityThresholdPercentage; bool isReadOnly; internal IssuedTokenClientCredential() { } internal IssuedTokenClientCredential(IssuedTokenClientCredential other) { this.defaultKeyEntropyMode = other.defaultKeyEntropyMode; this.cacheIssuedTokens = other.cacheIssuedTokens; this.issuedTokenRenewalThresholdPercentage = other.issuedTokenRenewalThresholdPercentage; this.maxIssuedTokenCachingTime = other.maxIssuedTokenCachingTime; this.localIssuerAddress = other.localIssuerAddress; this.localIssuerBinding = (other.localIssuerBinding != null) ? new CustomBinding(other.localIssuerBinding) : null; if (other.localIssuerChannelBehaviors != null) this.localIssuerChannelBehaviors = GetBehaviorCollection(other.localIssuerChannelBehaviors); if (other.issuerChannelBehaviors != null) { this.issuerChannelBehaviors = new Dictionary >(); foreach (Uri uri in other.issuerChannelBehaviors.Keys) { this.issuerChannelBehaviors.Add(uri, GetBehaviorCollection(other.issuerChannelBehaviors[uri])); } } this.isReadOnly = other.isReadOnly; } public EndpointAddress LocalIssuerAddress { get { return this.localIssuerAddress; } set { ThrowIfImmutable(); this.localIssuerAddress = value; } } public Binding LocalIssuerBinding { get { return this.localIssuerBinding; } set { ThrowIfImmutable(); this.localIssuerBinding = value; } } public SecurityKeyEntropyMode DefaultKeyEntropyMode { get { return this.defaultKeyEntropyMode; } set { SecurityKeyEntropyModeHelper.Validate(value); ThrowIfImmutable(); this.defaultKeyEntropyMode = value; } } public bool CacheIssuedTokens { get { return this.cacheIssuedTokens; } set { ThrowIfImmutable(); this.cacheIssuedTokens = value; } } public int IssuedTokenRenewalThresholdPercentage { get { return this.issuedTokenRenewalThresholdPercentage; } set { ThrowIfImmutable(); this.issuedTokenRenewalThresholdPercentage = value; } } public Dictionary > IssuerChannelBehaviors { get { if (this.issuerChannelBehaviors == null) this.issuerChannelBehaviors = new Dictionary >(); return this.issuerChannelBehaviors; } } public KeyedByTypeCollection LocalIssuerChannelBehaviors { get { if (this.localIssuerChannelBehaviors == null) this.localIssuerChannelBehaviors = new KeyedByTypeCollection (); return this.localIssuerChannelBehaviors; } } public TimeSpan MaxIssuedTokenCachingTime { get { return this.maxIssuedTokenCachingTime; } 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))); } ThrowIfImmutable(); this.maxIssuedTokenCachingTime = value; } } KeyedByTypeCollection GetBehaviorCollection(KeyedByTypeCollection behaviors) { KeyedByTypeCollection result = new KeyedByTypeCollection (); foreach (IEndpointBehavior behavior in behaviors) { result.Add(behavior); } return result; } internal void MakeReadOnly() { this.isReadOnly = true; } void ThrowIfImmutable() { if (this.isReadOnly) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ObjectIsReadOnly))); } } } } // 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
- TextElementEditingBehaviorAttribute.cs
- LayoutSettings.cs
- CaseStatement.cs
- LicenseException.cs
- SymLanguageVendor.cs
- Command.cs
- LinkDescriptor.cs
- MeshGeometry3D.cs
- UndoUnit.cs
- DataGridViewLinkCell.cs
- CryptographicAttribute.cs
- DataGridColumn.cs
- DesignerAutoFormatStyle.cs
- FormViewPagerRow.cs
- MemberDescriptor.cs
- SessionStateModule.cs
- LifetimeServices.cs
- ReflectEventDescriptor.cs
- DesignerTextViewAdapter.cs
- SafeUserTokenHandle.cs
- ProtectedConfigurationSection.cs
- PropertyItemInternal.cs
- CapabilitiesState.cs
- WaitHandleCannotBeOpenedException.cs
- LocatorManager.cs
- BroadcastEventHelper.cs
- SqlNotificationEventArgs.cs
- DiscoveryClientDocuments.cs
- CommonRemoteMemoryBlock.cs
- XsltFunctions.cs
- SystemTcpStatistics.cs
- XmlRawWriter.cs
- AttributeCollection.cs
- COM2Properties.cs
- XmlAtomicValue.cs
- DataBoundControlHelper.cs
- DataObject.cs
- DataListItem.cs
- JsonDeserializer.cs
- ConfigXmlSignificantWhitespace.cs
- RIPEMD160Managed.cs
- AuthorizationRuleCollection.cs
- PackageRelationshipSelector.cs
- TheQuery.cs
- CqlGenerator.cs
- ListViewItemMouseHoverEvent.cs
- XmlDownloadManager.cs
- UniqueConstraint.cs
- TypeCacheManager.cs
- OptimisticConcurrencyException.cs
- XmlConvert.cs
- HTMLTextWriter.cs
- ParameterBuilder.cs
- FieldTemplateFactory.cs
- VirtualPath.cs
- ValueCollectionParameterReader.cs
- FileAuthorizationModule.cs
- DbgUtil.cs
- CaseInsensitiveOrdinalStringComparer.cs
- XmlSequenceWriter.cs
- SchemaHelper.cs
- ByeOperation11AsyncResult.cs
- CacheDict.cs
- DocumentApplicationJournalEntry.cs
- Point3DKeyFrameCollection.cs
- ExtentCqlBlock.cs
- Page.cs
- TransformerInfo.cs
- XmlException.cs
- NonVisualControlAttribute.cs
- CompilerScopeManager.cs
- QilXmlWriter.cs
- PrivilegedConfigurationManager.cs
- ScriptingJsonSerializationSection.cs
- Ticks.cs
- CheckedListBox.cs
- Int32CollectionConverter.cs
- ControlBindingsCollection.cs
- RsaSecurityTokenAuthenticator.cs
- GradientSpreadMethodValidation.cs
- SafeFindHandle.cs
- ExceptionUtil.cs
- MimeTypePropertyAttribute.cs
- DesignerTransactionCloseEvent.cs
- UpdateTranslator.cs
- _ConnectOverlappedAsyncResult.cs
- ContextStack.cs
- XamlToRtfParser.cs
- VarInfo.cs
- DataGridViewButtonCell.cs
- CaseInsensitiveHashCodeProvider.cs
- PeerApplicationLaunchInfo.cs
- SafeWaitHandle.cs
- IODescriptionAttribute.cs
- OleDbRowUpdatedEvent.cs
- RulePatternOps.cs
- BitmapEffect.cs
- ProfilePropertySettings.cs
- ConfigXmlCDataSection.cs
- ByteArrayHelperWithString.cs