Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / EnvelopedSignatureTransform.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ActionFrame.cs
- Aggregates.cs
- InternalsVisibleToAttribute.cs
- EmbossBitmapEffect.cs
- _FixedSizeReader.cs
- TransactionBridgeSection.cs
- HttpCookie.cs
- Span.cs
- XmlSchemaAttributeGroupRef.cs
- DeflateEmulationStream.cs
- SecurityIdentifierElement.cs
- Graphics.cs
- KeyPullup.cs
- NavigationFailedEventArgs.cs
- ContextQuery.cs
- TargetControlTypeCache.cs
- SpnegoTokenAuthenticator.cs
- TextEffect.cs
- httpserverutility.cs
- ResXResourceSet.cs
- EarlyBoundInfo.cs
- EventData.cs
- PropertyValueEditor.cs
- HttpCachePolicyWrapper.cs
- PropertyCollection.cs
- AsyncCompletedEventArgs.cs
- ToolboxDataAttribute.cs
- HttpApplicationFactory.cs
- SafeNativeMethods.cs
- Resources.Designer.cs
- HyperLinkDesigner.cs
- SafeNativeMethods.cs
- TransformGroup.cs
- DesignerCategoryAttribute.cs
- NameValueSectionHandler.cs
- ColumnMapProcessor.cs
- dbenumerator.cs
- _NtlmClient.cs
- FlowNode.cs
- SQLBytes.cs
- DefaultHttpHandler.cs
- WebPartsSection.cs
- XmlAtomicValue.cs
- CombinedHttpChannel.cs
- StringConverter.cs
- BaseParaClient.cs
- PngBitmapDecoder.cs
- ProcessThread.cs
- SimpleHandlerFactory.cs
- ObjectAnimationBase.cs
- CompositeFontInfo.cs
- XmlElementAttribute.cs
- LateBoundBitmapDecoder.cs
- WebPartDisplayModeCancelEventArgs.cs
- FileInfo.cs
- SqlDataSourceEnumerator.cs
- SettingsPropertyValue.cs
- UseLicense.cs
- TreeNodeBinding.cs
- DispatcherExceptionEventArgs.cs
- ToolboxItemCollection.cs
- ConfigurationStrings.cs
- FastPropertyAccessor.cs
- WebUtil.cs
- NavigatorInput.cs
- SelectionGlyph.cs
- AssemblyCache.cs
- Schema.cs
- CodeSnippetTypeMember.cs
- PlanCompilerUtil.cs
- Evidence.cs
- FunctionQuery.cs
- NoClickablePointException.cs
- AppearanceEditorPart.cs
- Utils.cs
- ScrollViewer.cs
- ApplicationHost.cs
- DataGridColumnCollectionEditor.cs
- FormViewRow.cs
- RegexInterpreter.cs
- MatrixKeyFrameCollection.cs
- SimpleMailWebEventProvider.cs
- _SslState.cs
- EventPrivateKey.cs
- DynamicPropertyHolder.cs
- SystemKeyConverter.cs
- AddDataControlFieldDialog.cs
- TreeWalker.cs
- SerializationException.cs
- _Connection.cs
- CalendarDataBindingHandler.cs
- ExternalException.cs
- QuaternionAnimationUsingKeyFrames.cs
- RelationshipDetailsRow.cs
- EventBookmark.cs
- ActiveXMessageFormatter.cs
- HttpCacheVary.cs
- UIElementPropertyUndoUnit.cs
- StorageModelBuildProvider.cs
- FontWeights.cs