Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / EnvelopedSignatureTransform.cs / 1 / EnvelopedSignatureTransform.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel { using System.Xml; using System.Security.Cryptography; sealed class EnvelopedSignatureTransform : Transform { string prefix = XmlSignatureStrings.Prefix; public EnvelopedSignatureTransform() { } public override string Algorithm { get { return XD.XmlSignatureDictionary.EnvelopedSignature.Value; } } public override object Process(object input, SignatureResourcePool resourcePool, DictionaryManager dictionaryManager) { XmlTokenStream tokenStream = input as XmlTokenStream; if (tokenStream != null) { tokenStream.SetElementExclusion(XmlSignatureStrings.Signature, XmlSignatureStrings.Namespace); return tokenStream; } throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.UnsupportedInputTypeForTransform, input.GetType()))); } // this transform is not allowed as the last one in a chain public override byte[] ProcessAndDigest(object input, SignatureResourcePool resourcePool, string digestAlgorithm, DictionaryManager dictionaryManager) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.UnsupportedLastTransform))); } public override void ReadFrom(XmlDictionaryReader reader, DictionaryManager dictionaryManager) { reader.MoveToContent(); string algorithm = XmlHelper.ReadEmptyElementAndRequiredAttribute(reader, dictionaryManager.XmlSignatureDictionary.Transform, dictionaryManager.XmlSignatureDictionary.Namespace, dictionaryManager.XmlSignatureDictionary.Algorithm, out this.prefix); if (algorithm != this.Algorithm) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new CryptographicException(SR.GetString(SR.AlgorithmMismatchForTransform))); } } public override void WriteTo(XmlDictionaryWriter writer, DictionaryManager dictionaryManager) { writer.WriteStartElement(this.prefix, dictionaryManager.XmlSignatureDictionary.Transform, dictionaryManager.XmlSignatureDictionary.Namespace); writer.WriteAttributeString(dictionaryManager.XmlSignatureDictionary.Algorithm, null, this.Algorithm); writer.WriteEndElement(); // Transform } } } // 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
- TypedDataSetSchemaImporterExtension.cs
- IdentityModelDictionary.cs
- ChoiceConverter.cs
- SamlSubject.cs
- MexHttpsBindingCollectionElement.cs
- HotSpotCollection.cs
- DefaultObjectMappingItemCollection.cs
- MailSettingsSection.cs
- DummyDataSource.cs
- GestureRecognitionResult.cs
- BitmapMetadataEnumerator.cs
- DataSetSchema.cs
- ReflectionTypeLoadException.cs
- GridViewAutomationPeer.cs
- ConfigPathUtility.cs
- TitleStyle.cs
- DrawingAttributesDefaultValueFactory.cs
- CallContext.cs
- DataGridTable.cs
- Classification.cs
- MatrixTransform.cs
- OleDbReferenceCollection.cs
- AuthenticationSection.cs
- XpsStructure.cs
- DesignTimeVisibleAttribute.cs
- Stroke2.cs
- DrawingVisualDrawingContext.cs
- ProofTokenCryptoHandle.cs
- VariableDesigner.xaml.cs
- SchemaTableOptionalColumn.cs
- TypeGeneratedEventArgs.cs
- KeyGesture.cs
- SqlCacheDependencyDatabaseCollection.cs
- BuildProvider.cs
- SelectionService.cs
- DoWorkEventArgs.cs
- EncoderBestFitFallback.cs
- SqlMethodCallConverter.cs
- OdbcErrorCollection.cs
- XmlSchemaParticle.cs
- WindowsRebar.cs
- TimelineCollection.cs
- LocalizabilityAttribute.cs
- EntityViewGenerationAttribute.cs
- MaterialCollection.cs
- ToolStripTextBox.cs
- PageStatePersister.cs
- AliasedSlot.cs
- PassportAuthenticationModule.cs
- Pair.cs
- WindowsFormsHost.cs
- DropShadowBitmapEffect.cs
- ExpressionQuoter.cs
- RtfFormatStack.cs
- TemplatePropertyEntry.cs
- WebPartCatalogCloseVerb.cs
- PackageDigitalSignatureManager.cs
- MasterPageCodeDomTreeGenerator.cs
- MarkupExtensionSerializer.cs
- LocalizableResourceBuilder.cs
- SmtpFailedRecipientsException.cs
- Aggregates.cs
- TargetControlTypeAttribute.cs
- Scene3D.cs
- TypeSystem.cs
- ExitEventArgs.cs
- BindingExpression.cs
- MarkupExtensionParser.cs
- Tokenizer.cs
- DodSequenceMerge.cs
- ListControl.cs
- InputLanguageEventArgs.cs
- XmlSchemaType.cs
- QuadraticBezierSegment.cs
- sitestring.cs
- ModelTreeEnumerator.cs
- InstanceData.cs
- DataRelationPropertyDescriptor.cs
- TailCallAnalyzer.cs
- UnsafeMethods.cs
- PathGeometry.cs
- CellCreator.cs
- DataGridLengthConverter.cs
- CompositeClientFormatter.cs
- AutomationPattern.cs
- HtmlValidatorAdapter.cs
- UnknownBitmapDecoder.cs
- AddInSegmentDirectoryNotFoundException.cs
- AccessDataSource.cs
- DataTableTypeConverter.cs
- SystemDropShadowChrome.cs
- ChannelSinkStacks.cs
- SqlMethodAttribute.cs
- DependencySource.cs
- GiveFeedbackEvent.cs
- SafeFileMappingHandle.cs
- COM2ExtendedBrowsingHandler.cs
- BaseTemplateParser.cs
- HtmlInputHidden.cs
- CompositeControl.cs