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
- UIElementAutomationPeer.cs
- Repeater.cs
- BypassElement.cs
- iisPickupDirectory.cs
- TTSEvent.cs
- SelectionItemProviderWrapper.cs
- BulletedList.cs
- FixedSOMPage.cs
- HttpHandlerAction.cs
- RectangleF.cs
- CommandID.cs
- ScriptManagerProxy.cs
- BrushMappingModeValidation.cs
- CannotUnloadAppDomainException.cs
- SizeConverter.cs
- OLEDB_Util.cs
- SamlAssertionKeyIdentifierClause.cs
- SecurityTokenRequirement.cs
- CapiSafeHandles.cs
- ToolStripContainer.cs
- Queue.cs
- EventLogEntry.cs
- UInt64Storage.cs
- CodeIdentifier.cs
- OdbcDataAdapter.cs
- HtmlShim.cs
- ContextMenuStripActionList.cs
- BitmapEffectGeneralTransform.cs
- FlowDocumentReader.cs
- ISFClipboardData.cs
- SubMenuStyleCollection.cs
- TransformedBitmap.cs
- SmtpReplyReader.cs
- COM2FontConverter.cs
- ExportFileRequest.cs
- HandlerMappingMemo.cs
- JsonSerializer.cs
- BuildProviderUtils.cs
- _SSPISessionCache.cs
- ReadContentAsBinaryHelper.cs
- CellTreeNode.cs
- XhtmlBasicImageAdapter.cs
- AnnouncementClient.cs
- ListMarkerSourceInfo.cs
- OuterGlowBitmapEffect.cs
- ActiveDocumentEvent.cs
- DataPointer.cs
- CharEnumerator.cs
- XPathDocumentNavigator.cs
- BitmapCodecInfo.cs
- ProjectionPlan.cs
- Parameter.cs
- MsmqMessage.cs
- CodeExpressionCollection.cs
- StreamWriter.cs
- SoapElementAttribute.cs
- DocumentGridContextMenu.cs
- CodeGeneratorAttribute.cs
- RefExpr.cs
- ImageCodecInfoPrivate.cs
- MultitargetUtil.cs
- Padding.cs
- Point3D.cs
- FtpRequestCacheValidator.cs
- COM2PropertyBuilderUITypeEditor.cs
- DesignerDataStoredProcedure.cs
- SharedUtils.cs
- OracleException.cs
- GenericWebPart.cs
- VisualTreeHelper.cs
- WsdlBuildProvider.cs
- RowSpanVector.cs
- TraceSection.cs
- InputScopeNameConverter.cs
- BinaryMethodMessage.cs
- ChtmlTextBoxAdapter.cs
- Tile.cs
- NullableFloatSumAggregationOperator.cs
- TextTreePropertyUndoUnit.cs
- AuthenticationService.cs
- TypeUtil.cs
- BufferAllocator.cs
- TreeView.cs
- UserControlParser.cs
- WindowsComboBox.cs
- QilReference.cs
- TransformationRules.cs
- DynamicQueryableWrapper.cs
- PersonalizationProviderHelper.cs
- RequestBringIntoViewEventArgs.cs
- WebBrowserProgressChangedEventHandler.cs
- JsonReader.cs
- XmlSchemaType.cs
- SourceFileInfo.cs
- XmlDataSourceNodeDescriptor.cs
- InvalidPropValue.cs
- TemplatingOptionsDialog.cs
- UserPreferenceChangedEventArgs.cs
- Utils.cs
- Gdiplus.cs