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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HttpFormatExtensions.cs
- SelectionProcessor.cs
- LogicalExpressionTypeConverter.cs
- AuthenticationServiceManager.cs
- SoapHttpTransportImporter.cs
- WorkflowStateRollbackService.cs
- UDPClient.cs
- QueryStringParameter.cs
- SoapClientMessage.cs
- ToolStripPanelCell.cs
- SecureEnvironment.cs
- CustomValidator.cs
- DataGridViewDesigner.cs
- MenuBase.cs
- QueryHandler.cs
- ValueSerializerAttribute.cs
- MetricEntry.cs
- Pair.cs
- CreateRefExpr.cs
- SolidColorBrush.cs
- RestHandler.cs
- SimpleFieldTemplateUserControl.cs
- DiagnosticsConfiguration.cs
- ChooseAction.cs
- HtmlInputPassword.cs
- StagingAreaInputItem.cs
- CheckedPointers.cs
- Visual3D.cs
- AddingNewEventArgs.cs
- NavigationEventArgs.cs
- GraphicsPath.cs
- DbTransaction.cs
- SchemaElementDecl.cs
- BaseCollection.cs
- XmlElementList.cs
- AdornerLayer.cs
- ControlBuilder.cs
- HtmlTableCellCollection.cs
- DesignerImageAdapter.cs
- LineSegment.cs
- MimeXmlImporter.cs
- GridViewDeleteEventArgs.cs
- OleDbRowUpdatedEvent.cs
- IncrementalReadDecoders.cs
- errorpatternmatcher.cs
- _ConnectOverlappedAsyncResult.cs
- PartialTrustVisibleAssemblyCollection.cs
- DataControlField.cs
- SmtpException.cs
- MultilineStringConverter.cs
- AutomationElement.cs
- PolicyValidationException.cs
- SyndicationFeed.cs
- MailAddressCollection.cs
- BaseValidatorDesigner.cs
- XmlSignificantWhitespace.cs
- SiteMapDataSource.cs
- XPathDocumentBuilder.cs
- CodeSnippetExpression.cs
- AsyncPostBackTrigger.cs
- InheritanceAttribute.cs
- EraserBehavior.cs
- SQLDoubleStorage.cs
- ValueConversionAttribute.cs
- AttributeSetAction.cs
- TemplateBindingExtension.cs
- CopyAttributesAction.cs
- OutputChannel.cs
- TypeReference.cs
- TableRow.cs
- Color.cs
- BindingExpression.cs
- DateTimeConstantAttribute.cs
- NonValidatingSecurityTokenAuthenticator.cs
- MultitargetingHelpers.cs
- VersionedStreamOwner.cs
- XmlSerializerSection.cs
- TypedTableBase.cs
- AssertUtility.cs
- XmlTextReaderImpl.cs
- COAUTHIDENTITY.cs
- ProcessHost.cs
- WCFModelStrings.Designer.cs
- AlternationConverter.cs
- TokenBasedSetEnumerator.cs
- AQNBuilder.cs
- CngAlgorithm.cs
- Triplet.cs
- ProcessStartInfo.cs
- WebCategoryAttribute.cs
- M3DUtil.cs
- NullableDoubleMinMaxAggregationOperator.cs
- DesignerProperties.cs
- Point.cs
- Component.cs
- FacetValues.cs
- DrawingContextWalker.cs
- AdornedElementPlaceholder.cs
- AmbientValueAttribute.cs
- SmtpNetworkElement.cs