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
- LocalizedNameDescriptionPair.cs
- DesigntimeLicenseContextSerializer.cs
- Metadata.cs
- DbConnectionPoolGroup.cs
- SqlCacheDependencyDatabaseCollection.cs
- QilScopedVisitor.cs
- SymbolType.cs
- MethodToken.cs
- ApplicationException.cs
- CombinedGeometry.cs
- XPathSelectionIterator.cs
- VariableReference.cs
- Stackframe.cs
- SizeIndependentAnimationStorage.cs
- DataError.cs
- TabPage.cs
- CredentialCache.cs
- DocumentCollection.cs
- SchemaNames.cs
- SqlConnectionPoolProviderInfo.cs
- Completion.cs
- AsyncSerializedWorker.cs
- CollectionBase.cs
- StylusCaptureWithinProperty.cs
- ContentIterators.cs
- DataRow.cs
- CompiledRegexRunner.cs
- ToolStripOverflowButton.cs
- DesignerAttribute.cs
- SimpleTypeResolver.cs
- SpecialNameAttribute.cs
- ReferenceEqualityComparer.cs
- SQLInt16.cs
- RawTextInputReport.cs
- ListItemCollection.cs
- OrderedDictionary.cs
- BitVector32.cs
- WebPartHeaderCloseVerb.cs
- WriterOutput.cs
- DotExpr.cs
- FederatedMessageSecurityOverHttp.cs
- AssemblyCollection.cs
- UnsafeMethods.cs
- OleDbStruct.cs
- WebPartConnectionsConnectVerb.cs
- HostedTcpTransportManager.cs
- SystemUnicastIPAddressInformation.cs
- MessageContractAttribute.cs
- DbCommandTree.cs
- CharKeyFrameCollection.cs
- ConfigurationLocation.cs
- HtmlDocument.cs
- BoundColumn.cs
- MetabaseSettings.cs
- ExpressionBuilder.cs
- DataContractSerializerServiceBehavior.cs
- SerializeAbsoluteContext.cs
- DropSource.cs
- FocusChangedEventArgs.cs
- IDQuery.cs
- WebChannelFactory.cs
- XMLUtil.cs
- TdsParserStateObject.cs
- SqlStream.cs
- BindingEditor.xaml.cs
- ParserExtension.cs
- XmlReturnReader.cs
- ConnectionInterfaceCollection.cs
- TailCallAnalyzer.cs
- Stylesheet.cs
- ImageConverter.cs
- RtfToXamlReader.cs
- InvalidCommandTreeException.cs
- DataMember.cs
- DefaultBinder.cs
- InfoCardKeyedHashAlgorithm.cs
- Style.cs
- StringValidatorAttribute.cs
- XhtmlStyleClass.cs
- HtmlElement.cs
- DataSourceProvider.cs
- ConstructorExpr.cs
- Attributes.cs
- DelegateTypeInfo.cs
- MessageSmuggler.cs
- StringUtil.cs
- CacheDependency.cs
- TagPrefixCollection.cs
- TextProperties.cs
- EventManager.cs
- XmlSchemaSet.cs
- BamlRecords.cs
- ColorIndependentAnimationStorage.cs
- XmlSiteMapProvider.cs
- XmlDocumentSerializer.cs
- DesignerActionTextItem.cs
- BamlResourceContent.cs
- NumericPagerField.cs
- TabItemWrapperAutomationPeer.cs
- WindowsEditBoxRange.cs