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
- SystemResources.cs
- RequestFactory.cs
- MruCache.cs
- ObjectListField.cs
- Rotation3DAnimationBase.cs
- DataGridViewLayoutData.cs
- SafeTimerHandle.cs
- DataBoundControlHelper.cs
- ExponentialEase.cs
- Constants.cs
- XmlAnyAttributeAttribute.cs
- RadioButton.cs
- DbConnectionClosed.cs
- DockEditor.cs
- SoapIgnoreAttribute.cs
- PerspectiveCamera.cs
- HttpPostProtocolImporter.cs
- Attributes.cs
- RightsManagementResourceHelper.cs
- SettingsProviderCollection.cs
- HttpCacheVaryByContentEncodings.cs
- LoginCancelEventArgs.cs
- ErrorInfoXmlDocument.cs
- WebPartTransformerAttribute.cs
- SqlConnectionManager.cs
- SizeKeyFrameCollection.cs
- SymbolDocumentInfo.cs
- FormsAuthentication.cs
- RegexWriter.cs
- BrushValueSerializer.cs
- GroupBoxRenderer.cs
- SchemaSetCompiler.cs
- CommonObjectSecurity.cs
- EpmCustomContentDeSerializer.cs
- GcSettings.cs
- MetadataUtil.cs
- StringToken.cs
- ContentHostHelper.cs
- _ListenerAsyncResult.cs
- GregorianCalendarHelper.cs
- WebResponse.cs
- SiteMapPath.cs
- LogAppendAsyncResult.cs
- BaseDataBoundControl.cs
- ObjectDataProvider.cs
- ConstructorArgumentAttribute.cs
- GridViewRowPresenter.cs
- MatrixUtil.cs
- AttributeCollection.cs
- XsdValidatingReader.cs
- UriTemplateLiteralPathSegment.cs
- HttpResponseHeader.cs
- ObjectDataSourceChooseTypePanel.cs
- SiteOfOriginContainer.cs
- DataServiceQueryException.cs
- ActivityTypeDesigner.xaml.cs
- Stack.cs
- SelectingProviderEventArgs.cs
- RootNamespaceAttribute.cs
- ThreadInterruptedException.cs
- Vector3D.cs
- XPathNodeInfoAtom.cs
- PresentationAppDomainManager.cs
- ProfileManager.cs
- UniqueConstraint.cs
- EditCommandColumn.cs
- MetadataPropertyAttribute.cs
- KeyEvent.cs
- XmlEventCache.cs
- UnmanagedMemoryStreamWrapper.cs
- EncryptedPackageFilter.cs
- DebuggerAttributes.cs
- StandardToolWindows.cs
- DrawingImage.cs
- AutomationElementCollection.cs
- StringUtil.cs
- _NetworkingPerfCounters.cs
- Not.cs
- AsmxEndpointPickerExtension.cs
- DataListCommandEventArgs.cs
- FontStyleConverter.cs
- SwitchAttribute.cs
- DesignerSerializerAttribute.cs
- DPTypeDescriptorContext.cs
- DecimalKeyFrameCollection.cs
- DesignTimeTemplateParser.cs
- ValidatorCollection.cs
- RuleSetDialog.Designer.cs
- LinqDataSourceEditData.cs
- Permission.cs
- XmlStreamNodeWriter.cs
- SmtpReplyReaderFactory.cs
- MimeWriter.cs
- PopupControlService.cs
- DataGridViewCellCancelEventArgs.cs
- XsltLibrary.cs
- UrlAuthorizationModule.cs
- OdbcCommandBuilder.cs
- ClientSettingsSection.cs
- EventHandlersStore.cs