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
- TemplatePagerField.cs
- DrawToolTipEventArgs.cs
- SplitterPanel.cs
- Literal.cs
- CollectionViewSource.cs
- _NTAuthentication.cs
- ActivityTrace.cs
- ViewEvent.cs
- ExtensionQuery.cs
- AccessKeyManager.cs
- SelectionBorderGlyph.cs
- TitleStyle.cs
- WebControlsSection.cs
- OperatingSystem.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- DoubleKeyFrameCollection.cs
- KeyInstance.cs
- UrlPath.cs
- SspiHelper.cs
- ContainsRowNumberChecker.cs
- SendSecurityHeaderElement.cs
- Parameter.cs
- PrintPreviewControl.cs
- NamespaceList.cs
- WebBrowserHelper.cs
- ActivityXRefConverter.cs
- Visitor.cs
- AsyncPostBackTrigger.cs
- CompareValidator.cs
- InlineObject.cs
- OdbcParameterCollection.cs
- ContentPlaceHolder.cs
- DbProviderFactoriesConfigurationHandler.cs
- HMACMD5.cs
- XmlDataSourceDesigner.cs
- GenericWebPart.cs
- EntityPropertyMappingAttribute.cs
- FullTrustAssembliesSection.cs
- SetStateEventArgs.cs
- DesignSurfaceCollection.cs
- Triangle.cs
- TextTreeTextElementNode.cs
- ApplicationInterop.cs
- ErrorTableItemStyle.cs
- DateTimeOffset.cs
- SynchronizedReadOnlyCollection.cs
- QueryResults.cs
- BaseValidator.cs
- Matrix3D.cs
- ZeroOpNode.cs
- XmlProcessingInstruction.cs
- XComponentModel.cs
- ResourcePart.cs
- BaseComponentEditor.cs
- ImageInfo.cs
- CorrelationToken.cs
- VectorValueSerializer.cs
- IsolatedStoragePermission.cs
- HttpContextWrapper.cs
- EventEntry.cs
- Ipv6Element.cs
- PointAnimationUsingPath.cs
- XmlCompatibilityReader.cs
- TreeViewImageIndexConverter.cs
- WindowsListViewScroll.cs
- SettingsPropertyWrongTypeException.cs
- Debug.cs
- CryptoKeySecurity.cs
- XmlSchemaInfo.cs
- MatrixTransform3D.cs
- TableRowGroup.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- NetworkInterface.cs
- AssemblyGen.cs
- SizeChangedInfo.cs
- BitmapPalettes.cs
- WebPartZone.cs
- SymLanguageType.cs
- SettingsPropertyValueCollection.cs
- DataError.cs
- XmlConvert.cs
- ArraySet.cs
- ConversionHelper.cs
- TextRunCache.cs
- SecurityDescriptor.cs
- UInt32Storage.cs
- DataGridViewDataConnection.cs
- MethodBuilderInstantiation.cs
- DrawListViewItemEventArgs.cs
- QilChoice.cs
- HybridWebProxyFinder.cs
- ObjectCache.cs
- Message.cs
- Message.cs
- TemplateBuilder.cs
- CodeObjectCreateExpression.cs
- RuntimeConfig.cs
- PagedDataSource.cs
- LabelAutomationPeer.cs
- LocalFileSettingsProvider.cs