Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Security / EncryptedHeader.cs / 1 / EncryptedHeader.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Security { using System.Diagnostics; using System.ServiceModel.Channels; using System.ServiceModel; using System.Globalization; using System.Xml; using System.IO; using ISecurityElement = System.IdentityModel.ISecurityElement; sealed class EncryptedHeader : DelegatingHeader { EncryptedHeaderXml headerXml; string name; string namespaceUri; MessageVersion version; public EncryptedHeader(MessageHeader plainTextHeader, EncryptedHeaderXml headerXml, string name, string namespaceUri, MessageVersion version) : base(plainTextHeader) { if (!headerXml.HasId || headerXml.Id == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(SR.GetString(SR.EncryptedHeaderXmlMustHaveId))); } this.headerXml = headerXml; this.name = name; this.namespaceUri = namespaceUri; this.version = version; } public string Id { get { return this.headerXml.Id; } } public override string Name { get { return this.name; } } public override string Namespace { get { return this.namespaceUri; } } public override string Actor { get { return this.headerXml.Actor; } } public override bool MustUnderstand { get { return this.headerXml.MustUnderstand; } } public override bool Relay { get { return this.headerXml.Relay; } } internal MessageHeader OriginalHeader { get { return this.InnerHeader; } } public override bool IsMessageVersionSupported(MessageVersion messageVersion) { return this.version.Equals(version); } protected override void OnWriteStartHeader(XmlDictionaryWriter writer, MessageVersion messageVersion) { if (!IsMessageVersionSupported(messageVersion)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SR.GetString(SR.MessageHeaderVersionNotSupported, String.Format(CultureInfo.InvariantCulture, "{0}:{1}", this.Namespace, this.Name), version.ToString()), "version")); } this.headerXml.WriteHeaderElement(writer); WriteHeaderAttributes(writer, messageVersion); this.headerXml.WriteHeaderId(writer); } protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion) { this.headerXml.WriteHeaderContents(writer); } } } // 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
- TCEAdapterGenerator.cs
- SqlBooleanMismatchVisitor.cs
- StylusPointCollection.cs
- CommentEmitter.cs
- ContentTextAutomationPeer.cs
- KeyboardDevice.cs
- TableItemStyle.cs
- EndpointReference.cs
- CorrelationTokenTypeConvertor.cs
- ThicknessKeyFrameCollection.cs
- CellParaClient.cs
- ErasingStroke.cs
- WebServiceMethodData.cs
- MessageEnumerator.cs
- Sql8ExpressionRewriter.cs
- DateTimeFormatInfoScanner.cs
- BindingElementCollection.cs
- AutoGeneratedFieldProperties.cs
- EndpointDiscoveryMetadataCD1.cs
- DataGridViewMethods.cs
- SslStream.cs
- TreeNodeStyleCollection.cs
- FormViewPageEventArgs.cs
- ProbeMatchesMessageCD1.cs
- ProviderUtil.cs
- TargetException.cs
- WebReferencesBuildProvider.cs
- XmlHelper.cs
- HtmlToClrEventProxy.cs
- CellQuery.cs
- NetCodeGroup.cs
- CalloutQueueItem.cs
- EdmSchemaError.cs
- TagPrefixInfo.cs
- CallSiteHelpers.cs
- ExpressionBuilder.cs
- compensatingcollection.cs
- ILGenerator.cs
- TypeHelper.cs
- NativeCppClassAttribute.cs
- SafeNativeMethods.cs
- InfiniteTimeSpanConverter.cs
- StringFunctions.cs
- HasActivatableWorkflowEvent.cs
- SolidColorBrush.cs
- TcpChannelFactory.cs
- StoreContentChangedEventArgs.cs
- BitmapEffectInputData.cs
- AndCondition.cs
- HttpListenerRequest.cs
- altserialization.cs
- CodeIdentifiers.cs
- ToolBar.cs
- EnlistmentState.cs
- ProcessHostServerConfig.cs
- FormsAuthentication.cs
- ZipIOCentralDirectoryFileHeader.cs
- ListenerElementsCollection.cs
- XmlUrlResolver.cs
- EntityContainer.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- DataGridSortCommandEventArgs.cs
- ToolStripMenuItem.cs
- MarkedHighlightComponent.cs
- PersonalizablePropertyEntry.cs
- Document.cs
- oledbmetadatacollectionnames.cs
- GeneralTransform.cs
- InstanceCollisionException.cs
- EnvelopeVersion.cs
- OutputCacheSection.cs
- CompilerParameters.cs
- LoadedEvent.cs
- ButtonAutomationPeer.cs
- SoapSchemaMember.cs
- TableItemPattern.cs
- CodeAttributeArgument.cs
- NewItemsContextMenuStrip.cs
- HttpCapabilitiesSectionHandler.cs
- SystemInfo.cs
- StrongNameKeyPair.cs
- InvalidPropValue.cs
- WebPartTransformerAttribute.cs
- _SecureChannel.cs
- KernelTypeValidation.cs
- PrivilegedConfigurationManager.cs
- TextRangeSerialization.cs
- Stackframe.cs
- RectangleGeometry.cs
- ParallelEnumerableWrapper.cs
- EntityContainerEntitySetDefiningQuery.cs
- PageStatePersister.cs
- QilXmlWriter.cs
- SoapFormatter.cs
- ScrollChrome.cs
- XmlParser.cs
- LinearKeyFrames.cs
- XmlRootAttribute.cs
- StateInitialization.cs
- RichTextBoxConstants.cs