Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Security / Tokens / ServiceModelSecurityTokenRequirement.cs / 1 / ServiceModelSecurityTokenRequirement.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Security.Tokens { using System; using System.Text; using System.ServiceModel.Channels; using System.ServiceModel; using System.ServiceModel.Description; using System.Xml; using System.ServiceModel.Security; using System.Collections.Generic; using System.IdentityModel.Tokens; using System.IdentityModel.Selectors; using System.Globalization; public abstract class ServiceModelSecurityTokenRequirement : SecurityTokenRequirement { protected const string Namespace = "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement"; const string securityAlgorithmSuiteProperty = Namespace + "/SecurityAlgorithmSuite"; const string securityBindingElementProperty = Namespace + "/SecurityBindingElement"; const string issuerAddressProperty = Namespace + "/IssuerAddress"; const string issuerBindingProperty = Namespace + "/IssuerBinding"; const string secureConversationSecurityBindingElementProperty = Namespace + "/SecureConversationSecurityBindingElement"; const string supportSecurityContextCancellationProperty = Namespace + "/SupportSecurityContextCancellation"; const string messageSecurityVersionProperty = Namespace + "/MessageSecurityVersion"; const string defaultMessageSecurityVersionProperty = Namespace + "/DefaultMessageSecurityVersion"; const string issuerBindingContextProperty = Namespace + "/IssuerBindingContext"; const string transportSchemeProperty = Namespace + "/TransportScheme"; const string isInitiatorProperty = Namespace + "/IsInitiator"; const string targetAddressProperty = Namespace + "/TargetAddress"; const string viaProperty = Namespace + "/Via"; const string listenUriProperty = Namespace + "/ListenUri"; const string auditLogLocationProperty = Namespace + "/AuditLogLocation"; const string suppressAuditFailureProperty = Namespace + "/SuppressAuditFailure"; const string messageAuthenticationAuditLevelProperty = Namespace + "/MessageAuthenticationAuditLevel"; const string isOutOfBandTokenProperty = Namespace + "/IsOutOfBandToken"; // the following properties dont have top level OM properties but are part of the property bag const string supportingTokenAttachmentModeProperty = Namespace + "/SupportingTokenAttachmentMode"; const string messageDirectionProperty = Namespace + "/MessageDirection"; const string httpAuthenticationSchemeProperty = Namespace + "/HttpAuthenticationScheme"; const string issuedSecurityTokenParametersProperty = Namespace + "/IssuedSecurityTokenParameters"; const string privacyNoticeUriProperty = Namespace + "/PrivacyNoticeUri"; const string privacyNoticeVersionProperty = Namespace + "/PrivacyNoticeVersion"; const string duplexClientLocalAddressProperty = Namespace + "/DuplexClientLocalAddress"; const string endpointFilterTableProperty = Namespace + "/EndpointFilterTable"; const string channelParametersCollectionProperty = Namespace + "/ChannelParametersCollection"; const bool defaultSupportSecurityContextCancellation = false; protected ServiceModelSecurityTokenRequirement() : base() { this.Properties[SupportSecurityContextCancellationProperty] = defaultSupportSecurityContextCancellation; } static public string SecurityAlgorithmSuiteProperty { get { return securityAlgorithmSuiteProperty; } } static public string SecurityBindingElementProperty { get { return securityBindingElementProperty; } } static public string IssuerAddressProperty { get { return issuerAddressProperty; } } static public string IssuerBindingProperty { get { return issuerBindingProperty; } } static public string SecureConversationSecurityBindingElementProperty { get { return secureConversationSecurityBindingElementProperty; } } static public string SupportSecurityContextCancellationProperty { get { return supportSecurityContextCancellationProperty; } } static public string MessageSecurityVersionProperty { get { return messageSecurityVersionProperty; } } static internal string DefaultMessageSecurityVersionProperty { get { return defaultMessageSecurityVersionProperty; } } static public string IssuerBindingContextProperty { get { return issuerBindingContextProperty; } } static public string TransportSchemeProperty { get { return transportSchemeProperty; } } static public string IsInitiatorProperty { get { return isInitiatorProperty; } } static public string TargetAddressProperty { get { return targetAddressProperty; } } static public string ViaProperty { get { return viaProperty; } } static public string ListenUriProperty { get { return listenUriProperty; } } static public string AuditLogLocationProperty { get { return auditLogLocationProperty; } } static public string SuppressAuditFailureProperty { get { return suppressAuditFailureProperty; } } static public string MessageAuthenticationAuditLevelProperty { get { return messageAuthenticationAuditLevelProperty; } } static public string IsOutOfBandTokenProperty { get { return isOutOfBandTokenProperty; } } static public string SupportingTokenAttachmentModeProperty { get { return supportingTokenAttachmentModeProperty; } } static public string MessageDirectionProperty { get { return messageDirectionProperty; } } static public string HttpAuthenticationSchemeProperty { get { return httpAuthenticationSchemeProperty; } } static public string IssuedSecurityTokenParametersProperty { get { return issuedSecurityTokenParametersProperty; } } static public string PrivacyNoticeUriProperty { get { return privacyNoticeUriProperty; } } static public string PrivacyNoticeVersionProperty { get { return privacyNoticeVersionProperty; } } static public string DuplexClientLocalAddressProperty { get { return duplexClientLocalAddressProperty; } } static public string EndpointFilterTableProperty { get { return endpointFilterTableProperty; } } static public string ChannelParametersCollectionProperty { get { return channelParametersCollectionProperty; } } public bool IsInitiator { get { return GetPropertyOrDefault(IsInitiatorProperty, false); } } public SecurityAlgorithmSuite SecurityAlgorithmSuite { get { return GetPropertyOrDefault (SecurityAlgorithmSuiteProperty, null); } set { this.Properties[SecurityAlgorithmSuiteProperty] = value; } } public SecurityBindingElement SecurityBindingElement { get { return GetPropertyOrDefault (SecurityBindingElementProperty, null); } set { this.Properties[SecurityBindingElementProperty] = value; } } public EndpointAddress IssuerAddress { get { return GetPropertyOrDefault (IssuerAddressProperty, null); } set { this.Properties[IssuerAddressProperty] = value; } } public Binding IssuerBinding { get { return GetPropertyOrDefault (IssuerBindingProperty, null); } set { this.Properties[IssuerBindingProperty] = value; } } public SecurityBindingElement SecureConversationSecurityBindingElement { get { return GetPropertyOrDefault (SecureConversationSecurityBindingElementProperty, null); } set { this.Properties[SecureConversationSecurityBindingElementProperty] = value; } } public SecurityTokenVersion MessageSecurityVersion { get { return GetPropertyOrDefault (MessageSecurityVersionProperty, null); } set { this.Properties[MessageSecurityVersionProperty] = value; } } internal MessageSecurityVersion DefaultMessageSecurityVersion { get { MessageSecurityVersion messageSecurityVersion; return (this.TryGetProperty (DefaultMessageSecurityVersionProperty, out messageSecurityVersion)) ? messageSecurityVersion : null; } set { this.Properties[DefaultMessageSecurityVersionProperty] = (object)value; } } public string TransportScheme { get { return GetPropertyOrDefault (TransportSchemeProperty, null); } set { this.Properties[TransportSchemeProperty] = value; } } internal bool SupportSecurityContextCancellation { get { return GetPropertyOrDefault (SupportSecurityContextCancellationProperty, defaultSupportSecurityContextCancellation); } set { this.Properties[SupportSecurityContextCancellationProperty] = value; } } internal EndpointAddress DuplexClientLocalAddress { get { return GetPropertyOrDefault (duplexClientLocalAddressProperty, null); } set { this.Properties[duplexClientLocalAddressProperty] = value; } } internal TValue GetPropertyOrDefault (string propertyName, TValue defaultValue) { TValue result; if (!TryGetProperty (propertyName, out result)) { result = defaultValue; } return result; } internal string InternalToString() { StringBuilder sb = new StringBuilder(); sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "{0}:", this.GetType().ToString())); foreach (string propertyName in this.Properties.Keys) { object propertyValue = this.Properties[propertyName]; sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "PropertyName: {0}", propertyName)); sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "PropertyValue: {0}", propertyValue)); sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "---")); } return sb.ToString().Trim(); } } } // 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
- ObjectKeyFrameCollection.cs
- PropertyGrid.cs
- TypeNameConverter.cs
- GetPageNumberCompletedEventArgs.cs
- PromptBuilder.cs
- QueryOutputWriterV1.cs
- XpsFilter.cs
- NestedContainer.cs
- basenumberconverter.cs
- FileDataSourceCache.cs
- PropagatorResult.cs
- BlockCollection.cs
- ArraySortHelper.cs
- BaseComponentEditor.cs
- PassportAuthenticationModule.cs
- ExtensionFile.cs
- StructuredTypeInfo.cs
- CaseInsensitiveHashCodeProvider.cs
- AvtEvent.cs
- FontStretches.cs
- DefaultParameterValueAttribute.cs
- SelectionItemProviderWrapper.cs
- CodeGroup.cs
- Events.cs
- GridItemCollection.cs
- TemplateField.cs
- contentDescriptor.cs
- DecoderExceptionFallback.cs
- FixedLineResult.cs
- CorrelationQueryBehavior.cs
- DrawingAttributeSerializer.cs
- WeakReference.cs
- AudioFormatConverter.cs
- PowerModeChangedEventArgs.cs
- SqlLiftWhereClauses.cs
- CheckBox.cs
- Brush.cs
- DataGridViewColumnTypeEditor.cs
- IndexedString.cs
- WindowsToolbarItemAsMenuItem.cs
- streamingZipPartStream.cs
- ExtendedProperty.cs
- PopupRoot.cs
- ImageAnimator.cs
- SecurityTokenRequirement.cs
- TagNameToTypeMapper.cs
- PhysicalAddress.cs
- HoistedLocals.cs
- ColorAnimationBase.cs
- _ListenerRequestStream.cs
- ConfigurationManagerInternalFactory.cs
- BamlResourceSerializer.cs
- RadioButtonBaseAdapter.cs
- XPathParser.cs
- COM2ExtendedTypeConverter.cs
- ErrorRuntimeConfig.cs
- WebConfigurationHostFileChange.cs
- TreeSet.cs
- XamlTemplateSerializer.cs
- ExceptionList.cs
- SafeRightsManagementEnvironmentHandle.cs
- AutomationPropertyInfo.cs
- CodeTypeDelegate.cs
- FixedSOMTableCell.cs
- AudioFormatConverter.cs
- DelegateSerializationHolder.cs
- RegexGroupCollection.cs
- HttpCookiesSection.cs
- ResXDataNode.cs
- DrawingCollection.cs
- Hyperlink.cs
- Relationship.cs
- SystemInformation.cs
- ActivitySurrogate.cs
- ComponentResourceManager.cs
- PropertyDescriptor.cs
- TrackBarRenderer.cs
- PagedDataSource.cs
- ParameterSubsegment.cs
- PageTheme.cs
- DrawingCollection.cs
- SystemIcmpV4Statistics.cs
- WorkflowServiceNamespace.cs
- Animatable.cs
- TextContainerChangeEventArgs.cs
- DurationConverter.cs
- Exceptions.cs
- ProfileInfo.cs
- xmlsaver.cs
- ProgressBar.cs
- MemberInfoSerializationHolder.cs
- View.cs
- ServiceNotStartedException.cs
- HttpCapabilitiesSectionHandler.cs
- StsCommunicationException.cs
- WebMethodAttribute.cs
- MessageBox.cs
- CSharpCodeProvider.cs
- TreeChangeInfo.cs
- HtmlControlAdapter.cs