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
- LiteralControl.cs
- SafeNativeMethods.cs
- DesignerForm.cs
- _SafeNetHandles.cs
- TypefaceMap.cs
- MaskedTextBox.cs
- ToolstripProfessionalRenderer.cs
- PreviewKeyDownEventArgs.cs
- FixedPageStructure.cs
- PathFigureCollectionConverter.cs
- DataGridViewBindingCompleteEventArgs.cs
- FamilyTypefaceCollection.cs
- WebPartTransformerAttribute.cs
- DataObjectMethodAttribute.cs
- ToolStripManager.cs
- ContractTypeNameCollection.cs
- TreeViewImageKeyConverter.cs
- TimeIntervalCollection.cs
- BufferedGenericXmlSecurityToken.cs
- OleDbError.cs
- HostingEnvironment.cs
- XmlPreloadedResolver.cs
- TrackingMemoryStreamFactory.cs
- BindingsCollection.cs
- IImplicitResourceProvider.cs
- MemberAssignment.cs
- LicenseProviderAttribute.cs
- ServiceModelReg.cs
- ButtonAutomationPeer.cs
- counter.cs
- RecognizerBase.cs
- DllNotFoundException.cs
- DesignerAttribute.cs
- MachineKey.cs
- TextEncodedRawTextWriter.cs
- ProjectionCamera.cs
- HotCommands.cs
- DecimalKeyFrameCollection.cs
- RequiredAttributeAttribute.cs
- Compiler.cs
- HtmlInputControl.cs
- DigestTraceRecordHelper.cs
- SelectionRange.cs
- CrossContextChannel.cs
- ExpressionTextBox.xaml.cs
- InfoCardUIAgent.cs
- RedirectionProxy.cs
- CurrentTimeZone.cs
- ToolStripControlHost.cs
- BuilderPropertyEntry.cs
- Point3D.cs
- CheckBoxFlatAdapter.cs
- XmlILAnnotation.cs
- objectresult_tresulttype.cs
- GradientBrush.cs
- StyleModeStack.cs
- Win32.cs
- CustomWebEventKey.cs
- XmlQueryCardinality.cs
- RotateTransform.cs
- SqlProviderServices.cs
- ObjectFullSpanRewriter.cs
- WindowsAuthenticationModule.cs
- MissingMemberException.cs
- Messages.cs
- ItemsControl.cs
- CachedFontFace.cs
- IPAddressCollection.cs
- Screen.cs
- ToolStripHighContrastRenderer.cs
- OdbcTransaction.cs
- OleDbFactory.cs
- SerialReceived.cs
- InvariantComparer.cs
- TitleStyle.cs
- PeerName.cs
- MemberDomainMap.cs
- UInt16Converter.cs
- MemoryFailPoint.cs
- WindowsFormsSynchronizationContext.cs
- ExtensionElement.cs
- XmlIncludeAttribute.cs
- Policy.cs
- DataControlHelper.cs
- XmlDownloadManager.cs
- AddingNewEventArgs.cs
- DataBindingHandlerAttribute.cs
- TableAutomationPeer.cs
- SmtpReplyReaderFactory.cs
- TextEditor.cs
- MaskDesignerDialog.cs
- JavaScriptString.cs
- GridViewColumn.cs
- WSFederationHttpBinding.cs
- CategoryEditor.cs
- XmlSignatureManifest.cs
- XmlSchemaSimpleContent.cs
- HttpModule.cs
- TransformValueSerializer.cs
- Marshal.cs