.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Problems with XmlDsigEnvelopedSignatureTransform and multiple signatures

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :.NET Framework

 I'm having a lot of problems using XmlDsigEnvelopedSignatureTransform when signing an XML document multiple times. For example, I have a simple document and I add a signature to it, then, when I check the document, the signature is valid and everything is fine. But when I add a second signature to the previously signed XML then the problems begin: the second signature is valid, the first one not! This seems like if the XmlDsigEnvelopedSignatureTransform is not removing the already existing Signature nodes (as from W3C specifications) from the document before signing and when verifying, so the second signature broke the first one. This behavior is also specified in the MSDN documentation:

The XmlDsigEnvelopedSignatureTransform class removes the <Signature> element from an XML document before the digest is computed. With this transform, you can sign and verify all elements of an XML document except the XML digital signature elements. 

To confirm this, I've tested the example found in the official documentation and the results are like I imagined, the Signature element is not removed:

View Complete Post

More Related Resource Links

Problems with multiple validation rules



I've added some custom validation rules programatically like this:



            BindingOperations.GetBinding(txtTitulo, TextBox.TextProperty).ValidationRules.Clear();

            BindingOperations.GetBinding(txtTitulo, TextBox.TextProperty).ValidationRules.Add(new ReglaDatoRequerido(Idioma.RecursoIdiomaLocal(this, "msjErrorDatoRequerido")));

            BindingOperations.GetBinding(txtTitulo, TextBox.TextProperty).ValidationRules.Add(new ReglaRangoDatos(Idioma.RecursoIdiomaLocal(this, "msjErrorDatoRequerido"), 1, 5, false));

these are the rules:
public abstract class ReglaValidacionBase : ValidationRule
        /// <summary>
        /// Mensaje de error.
        /// </summary>
        public string MensajeError { get; set; }

   public class ReglaDatoRequerido : ReglaValidacionBase
        public ReglaDatoRequerido(st

Problems with multiple calls from the same client


Hi all!

I have a service with the following binding configuration (identical on server and client), running under IIS (Win 7 x64):

 <binding name="Printec.TMS.DCS.WindowsTcpBinding" maxReceivedMessageSize="6553600" 
  maxConnections="2000" listenBacklog="2000" closeTimeout="00:10:00" 
  sendTimeout="00:10:00" receiveTimeout="00:10:00" openTimeout="00:10:00">
 <readerQuotas maxDepth="200" maxStringContentLength="6553600" maxArrayLength="6553600" />
 <reliableSession enabled="false" />
 <security mode="None" />

Here is the service behaviour:

<behavior name="ServiceBehavior">
 <dataContractSerializer maxItemsInObjectGraph="

Verifying multiple signatures of a SignedXml



I need to add multiple signatures to an XML document.

With X509Certificate2 and SignedXML objects, I sign my XML using certificate A (first) and B (second).

When I try to verify, the second signatures is OK, but the first one is not verified.

If I don't add the second signature, the first one is OK.

I found this thread


I tried to add <signatures> element as suggested. I remove the second signature before verifying the first one, but the first one is not OK.

My code below. Any suggestion ?


// _signingKey and _signingKey_2 (AsymmetricAlgorithm) are loaded starting from certificates

XmlDocument _xmlDocument = new XmlDocument();
_xmlDocument.InnerXml = "<ROOT><DETAIL>my details</DETAIL><Signatures></Signatures></ROOT>";

SignedXml _signedXmlDocument = new SignedXml(_xmlDocument);

_signedXmlDocument.SigningKey = _

problems with trace.writeline not writing output messages on multiple instance/thread service



I've come across something strange and can't quite figure out what could be going wrong. I have a windows service which processes queue items in a threadpool (default 5 threads).

So, during testing, i "debug, start new instance" and spin up about 4-5 instances of the service, and on average there is about 25 threads going at same time.

My trace code:
Trace.WriteLineIf(traceOutput.TraceVerbose, string.Format("processing Item for {0}", item.id));


this seems to work for a while and writes the trace code to the output window, but after a while, the trace output just stops being output to the window.. has anyone else experienced this before or could know what might be going wrong?




Obtaining multiple signatures on a protected Word template.


Hello - I asked this question on the Microsoft Word forum but was directed to this one:

Does anyone have experience using the signature feature in a Microsoft Word form template that is protected?  I'd like to be able to obtain multiple signatures while routing the form electronically.  So far I have found that once the first signature is obtained it saves the form in a "read only" format - so it can't go any further to add another signature.

Or, is anyone familiar with the workflow in SharePoint - would I be able to route the form for signatures using SharePoint workflow?

Thank you!

Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Top .NET Performance Problems and how to avoid them

Every time I work with one of our .NET customers to help them with managing their application performance I come across the same problems as seen with other clients before: lots of ADO.NET queries, many hidden exceptions in core or 3rd party .NET libraries, slow 3rd party components, inefficient custom code

Adding Multiple Columns and Rows in GridView without using a Database

This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

GridView Multiple Filter AJAX Control

This AJAX control enables the user to filter data within any column inside a GridView. The user can add multiple filters and can delete existing ones too.

Multiple Column Dropdownlist for the ASP.NET DataGrid

Based on my previous control "Multiple Column DropDownList for ASP.NET", I received many emails asking for the same control to be used in the DataGrid for web applications. Here we go.. This control can be used as the regular MS DropDownList in the DataGrid and also as a regular dropdownlist. It has all the properties, like DataTextField, DataValueField, DataSource, SelectedIndex etc. The download file contains the samples both in VB.NET and C#. In this sample, I have used the Northwind database of SQL Server.

ASP.NET Multiple Selection DropDownList with AJAX HoverMenuExtender

Recently, I was looking for a multiple selection dropdownlist control for my new project. After spending some time researching for it, I decided to put together all my finding in one web user control. This web user control consists of an ASP.NET AJAX HoverMenuExtender, JavaScript, StyleSheet and CheckBoxListExCtrl . The final product will work with or without a MasterPage and you can drag and drop more than one instances of the control on to the page.

jquery autocomplete multiple values


i got some samples and i did autocomplete using jquery , its working well for single input values

but i need to pass multiples values after one by one in the textbox. Is it possible to pass multiple

values in the textbox for autocomplete in jquery in asp.net?


Gmail style multiple Sign-in type combo...is it possible in asp.net?


I am developing a multi-company application and want my users to give the functionality like the following to switch companies.


Is this possible? then how?

Please help


Multiple Instances of User Control


I have a user control that I place on a page severl times.  When I make a selection on a ddl in one one control the SelectedIndexChanged event fires for all the control on the page for that ddl.  So I get duplication of an insert that I do.  Is there a way to make sure these events are isolated so this doesn't happen.


>>>How to update multiple rows of gidview by one click



I want to add multiple rows of a gridview if the data for multiple fields are same.

Idea for this is that a user may search a record with some parameter e.g. Sector, plot.

For example 15 records being displayed in gridview.

There should be checkbox before every row and if user wants to update Plot and Flat No that is same for 10 rows out of 15 so he will check the rows and update.

For this a dialog box should appear asking for the parameter i.e. Plot and Flat or something else next time may be it will be City or country. Moreover, there is already an Edit button to update records, when user click it another page open for the record to be updated and whatever he wants to update, it updates.

Hope everone understand the scenario.

I don't want to disturb the already provided Edit functionality and want to provide same record to be updated.

Any idea in this regard would be appreciated.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend