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
- TitleStyle.cs
- ProfileProvider.cs
- ScriptComponentDescriptor.cs
- TextTreeExtractElementUndoUnit.cs
- PngBitmapEncoder.cs
- CompositionAdorner.cs
- RemotingSurrogateSelector.cs
- StickyNote.cs
- VoiceInfo.cs
- DataGridViewSortCompareEventArgs.cs
- InputLanguageSource.cs
- RuleProcessor.cs
- EntitySetBase.cs
- CodeAssignStatement.cs
- ValueUnavailableException.cs
- InputMethodStateChangeEventArgs.cs
- BindingOperations.cs
- HandleValueEditor.cs
- RangeBase.cs
- Utils.cs
- ApplicationSettingsBase.cs
- SiteMapHierarchicalDataSourceView.cs
- XmlSerializer.cs
- ConfigXmlText.cs
- OrderedDictionary.cs
- XmlUrlEditor.cs
- AutoCompleteStringCollection.cs
- Automation.cs
- ThreadExceptionEvent.cs
- QilList.cs
- DispatcherTimer.cs
- StringToken.cs
- TypeDescriptionProviderAttribute.cs
- DropAnimation.xaml.cs
- TextLineBreak.cs
- SchemaImporterExtension.cs
- HandleCollector.cs
- TableItemPatternIdentifiers.cs
- XmlWrappingWriter.cs
- SHA256Managed.cs
- XAMLParseException.cs
- TypeBuilder.cs
- MultilineStringConverter.cs
- TypeDescriptionProviderAttribute.cs
- SafeNativeMethodsOther.cs
- CollectionsUtil.cs
- ActivationArguments.cs
- StatusBarItem.cs
- ProfileModule.cs
- StatusBar.cs
- ByteAnimation.cs
- CriticalFinalizerObject.cs
- IncrementalCompileAnalyzer.cs
- _OverlappedAsyncResult.cs
- DynamicDiscoveryDocument.cs
- ReplacementText.cs
- Viewport2DVisual3D.cs
- MonitoringDescriptionAttribute.cs
- ActivitySurrogate.cs
- Floater.cs
- CodeAttachEventStatement.cs
- MemberAssignment.cs
- ListViewItemMouseHoverEvent.cs
- X509ScopedServiceCertificateElement.cs
- IImplicitResourceProvider.cs
- WindowHideOrCloseTracker.cs
- RSAPKCS1SignatureDeformatter.cs
- Marshal.cs
- CollectionChangedEventManager.cs
- InheritanceUI.cs
- WindowsIdentity.cs
- SiteMapProvider.cs
- ItemCheckedEvent.cs
- followingquery.cs
- MessageQueuePermission.cs
- RequiredFieldValidator.cs
- ConstNode.cs
- NonPrimarySelectionGlyph.cs
- Point3DCollection.cs
- lengthconverter.cs
- Variable.cs
- SessionStateContainer.cs
- Util.cs
- TypeGeneratedEventArgs.cs
- MenuTracker.cs
- FilteredDataSetHelper.cs
- BufferedReadStream.cs
- XmlAttributes.cs
- ButtonBaseAutomationPeer.cs
- WeakKeyDictionary.cs
- ExeContext.cs
- WebEventCodes.cs
- MetadataProperty.cs
- MenuItemCollection.cs
- ApplicationBuildProvider.cs
- PathFigure.cs
- TcpChannelHelper.cs
- ArgumentNullException.cs
- WebPartDisplayModeCancelEventArgs.cs
- DoubleLinkList.cs