newbie question. Simple example of XML Digital Signature?

  I've been digging around looking for the .Net 2.0 method of signing an 
XML document.

  can anyone point me to a simple example, I didn't find much in MSDN

thanks
mike
0
7/2/2007 10:29:16 PM
dotnet.xml 7266 articles. 0 followers. Follow

4 Replies
747 Views

Similar Articles

[PageSpeed] 29

http://msdn.microsoft.com/msdnmag/issues/04/11/XMLSignatures/default.aspx


-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)

> I've been digging around looking for the .Net 2.0 method of signing
> an XML document.
> 
> can anyone point me to a simple example, I didn't find much in MSDN
> 
> thanks
> mike


0
dbaier (1)
7/3/2007 6:20:57 AM
On Jul 2, 3:29 pm, Michael Howes <mho...@xfortebio.com> wrote:
>   I've been digging around looking for the .Net 2.0 method of signing an
> XML document.
>
>   can anyone point me to a simple example, I didn't find much in MSDN
>
> thanks
> mike

Here are few usefull links

http://www.w3.org/TR/xmldsig-core/
http://www.xml.com/pub/a/2001/08/08/xmldsig.html

- Pramod Anchuparayil

0
7/3/2007 7:15:47 PM
> http://msdn.microsoft.com/msdnmag/issues/04/11/XMLSignatures/default.aspx
> 
> 

  thanks, that did help some

  and I found this article on codeproject
  http://www.codeproject.com/dotnet/xmldsiglic.asp

  the thing I'm having a hard time understanding right now is how to 
store both the public and private keys with my application (not on the 
machine) and get them into a RSACryptoServiceProvider class

  I have both keys in seperate XML format but don't know how to put them 
in one xml file. I have these two xml snippets.

  <RSAKeyValue><Modulus>thekeyjibberishhereforkey 
one</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>

<RSAKeyValue><Modulus>thekeyjibberishhereforkeytwo</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>

  if I add one of the files as a resource in the DLL and read in the 
resource and then try and use it like this;

RSACryptoServiceProvider csp = new RSACryptoServiceProvider();
csp.FromXmlString(xmlkey);

when I later call ComputerSignature() on my SignedXml object I get the 
error "Object only contains public part of key and needs to also contain 
private".

  What format does the XML have to be in to read the public and private 
key from the same file?
  Or if it can be done with two xml files how do I set those two keys on 
the RSACryptoServiceProvider?

thanks
mike
0
7/3/2007 11:38:42 PM
> http://msdn.microsoft.com/msdnmag/issues/04/11/XMLSignatures/default.aspx
> 
> 

  thanks, that did help some

  and I found this article on codeproject
  http://www.codeproject.com/dotnet/xmldsiglic.asp

  the thing I'm having a hard time understanding right now is how to
store both the public and private keys with my application (not on the
machine) and get them into a RSACryptoServiceProvider class

  I have both keys in seperate XML format but don't know how to put them
in one xml file. I have these two xml snippets.

  <RSAKeyValue><Modulus>thekeyjibberishhereforkey
one</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>

<RSAKeyValue><Modulus>thekeyjibberishhereforkeytwo</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>

  if I add one of the files as a resource in the DLL and read in the
resource and then try and use it like this;

RSACryptoServiceProvider csp = new RSACryptoServiceProvider();
csp.FromXmlString(xmlkey);

when I later call ComputerSignature() on my SignedXml object I get the
error "Object only contains public part of key and needs to also contain
private".

  What format does the XML have to be in to read the public and private
key from the same file?
  Or if it can be done with two xml files how do I set those two keys on
the RSACryptoServiceProvider?

thanks
mike
0
7/5/2007 5:57:32 PM
Reply:

Similar Artilces:

Error :The root element of a W3C XML Schema should be <schema>
Hi, I am getting following error while validating xml file with schema using ReaderSettings in .NET 2.0 "Line: 0 - Position: 0 - The root element of a W3C XML Schema should be <schema> and its namespace should be 'http://www.w3.org/2001/XMLSchema'." First few lines of xsd file are as follows: <?xml version="1.0" encoding="utf-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.keaneaustralia.com/Nts" elementFormDefault="qualified" targetNamespace="http://schemas.kean...

Newbie trying to understand relationships
Hi Group, I'm using Access 2000. I'm trying to create relationships and whilst I think I understand the concept it seems applying the concept to my requirements is somewhat harder for me to understand. I work for an organisation who responds to calls from the public to fit equipment in their home. So I need a DB to hold: CustomerID Customer Details AppointmentID Appointment Date Appointment Time CustomerID And then a table that sets out item fitted? AppointmentID ItemID LocationID And a table for promotional/help leaflets left AppointmentID LeafletID I also have a table det...

Form Question 12-31-07
I have a command button on my form I use to look at the "Datasheet view" after closing the datasheet it doesn't return back to the form it returns me to the switchboard. Private Sub Command23_Click() On Error GoTo Err_Command23_Click DoCmd.OpenForm "frmScanlog", acFormDS Exit_Command23_Click: Exit Sub Err_Command23_Click: MsgBox Err.Description Resume Exit_Command23_Click End Sub Thanks for your help. I believe since the datasheet veiw of the form is just another way to see the form, when you click the cmd button it doesn't open a new insta...

spellcheck dots in email signature
How do I get rid of the dots that appear under some words in my email signature? Turn off Person Names Smart Tags. --=81 Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. =20 After furious head scratching, castle asked: | How do I get rid of the dots that appear under some words in my email | signature? ...

Form Customization with XML ?
Is it possible to edit the XML to allow a normally unallowed field into the searchable fields? I would like to add the Step Name to the Opportunities. I can see it in the Entity XML viewer when I edit the Advanced Find, but I cannot add it to the displayed columns. Thank you. ...

Mapping a CSV file to an Xml Schema
Hi all, I am getting a CSV file like this from our client: "C1","2","12344","Mr","John","Chan","05/07/1976"......... I need to validate **each filed value** against a set of rules ,for instance for "05/07/1976" ,I need to make sure that it's in the right format ,It's not later than today and lots of other rules ,Is there somebody who can help me how to that?Can I map it to some sort of xml schema or something? Thanks for your help. Ali-R "Ali-R" <AliR@microsft.com> wrote in messa...

question
got similar question here. In MFC SDI, how to display content of a 10 bit BYTE* iData Buffer (1024*512) on screen?. yimi wrote: > got similar question here. > In MFC SDI, how to display > content of a 10 bit BYTE* iData Buffer > (1024*512) on screen?. > You can make in into a bitmap with CreateDIBSection and paint the bitmap. Example at http://codeguru.earthweb.com/bitmap/DIBSectionLite.shtml -- Scott McPhillips [VC++ MVP] ...

converting db need six digit w leading zeros,
I need to have a six digit value for an ID field. Old db has values ranging from one to four characters and need to front fill with zeros =right("000000"&a1,6) Assuming information is in cell a1 -- Wag more, bark less "eStreet4ever" wrote: > I need to have a six digit value for an ID field. Old db has values ranging > from one to four characters and need to front fill with zeros If this is just for display purpose then custom format the cells to 000000 The below will return the value as text and not numeric... =TEXT(A1,"000000&q...

Data Validation List Questions
I have a few questions. (Note I cannot use Macros as a solution, I know that would be easier but I can't) 1. Can you set a "default value" in a cell that is the first item in the Validation List? This would mean that although the user can pick from the list, The first item in the list automatically appears in the cell. 2. Can you replace the users selection with another from the list. Think of this one like an OPtion Button. Lets say the user selects "X" in the first cell. Later he selects "X" in the second cell. I need something (Not a macro) that...

Inverting the contents of a column question
In Excel I have a column that has a word in each cell from cells A1 to A20. How can I invert this column of words, for example into column B so that the contents of A1 fills B20 and A2 fills B19 etc. Thanks. hi enter the following formula in A1 =OFFSET($B$20,-(ROW(1:1)-1),0) and copy down -- Regards Frank Kabel Frankfurt, Germany "stuart" <stuart@discussions.microsoft.com> schrieb im Newsbeitrag news:C2F12AA8-E482-43AC-AA77-1EF4BFDCC082@microsoft.com... > In Excel I have a column that has a word in each cell from cells A1 to A20. How can I invert this column of words, fo...

Signature Issue.
Good day to all. Using MS Outlook 2K3. Have a signature (theme is Network Blitz, but it does the same regardless of which theme I use) that works and looks fine. However, when I create a new message, I get three blank lines above the Signature. There are no blank lines in the HTM sig doc. Any ideas? Wiley. ps looks like this FIRST BLANK LINE SECOND BLANK LINE THIRD BANK LINE Signature ...

Thanks and a question
Thanks to everyone who has replied to my questions about MSMoney; it is good to know that I have a place to ask questions. I am using the 2006 Premium trial version and so fa;, I like it. However, i've read here that some have had some issues with the later versions. Is 2006 all right for tracking investments? or are there pitfalls I should know about? IS MS going to come out with some fixes to the issues in their 2006 software? Is there anything I should know, or do, before I intall the full version? The paid for version will bring along what I've done in the trial version, righ...

Need help with xml and xsl design
Hi all This is what I have in mind and I will appreciate any suggestions. I am trying to create a xml help system for my application. The schema of the xml file will be <helpsystem> <help id="unique id"> <text>text data</text> <link href="optional tag which will hold a reference to a uri" helpanchor="this is also a optional attribute which will point to a helpid in the same document or a different document" helpanchorhtmlfile=" this attribute will only be present if the helpac...

License Question
Hello All, I have a Windows 2000 and Exchange 2000 Environment with Per Seat Licensing. Approximately 25 Servers and 300 Users. No Software Assurance. I have a limited budget to only upgrade to Exchange 2000. So I recommened Exchange 2003 Server 300 Cals, and 5 Exchange 2003 Server Licenses for the Backend and Front End Server. If I propose to re-install the OS of these 5 Servers ( From Windows 2000 Enterprise to Windows 2003 Standad, ) and add them as member servers for Exchange. Do I also need to buy Windows 2003 Cals as I am going to introduce Windows 2003 Servers in the Domain. Thanks ...

Exchange 5.5 Advance Properties, Directory name field question.
I have a user that has a username which is "asdf01", this username works throughout the domain while signed in at work. When the user is at home connected from her home pc. She goes to our email website to retieve her email. She is not able too.... When researching this users account I found that she has a second username "asdf02" in the Advance Properties tab, Directory Name. I'm not able to change this field, it is greyed with the users name. In the users active directory account, thier is no sign if this second username. My question is: What is this ...

Basic question concerning CListCtrl
Hi NG, My Dialog form contains a CListCtrl, an EditBox and a button ! But I have a problem when I click to my EditBox, my CListCtrl's selection desappear. Can someone help me? regards Salim thank you "CheckAbdoul" <636865636B6162646F756C406E6F7370616D2E6D7670732E6F7267> a �crit dans le message news: uzWFBuqVDHA.1052@TK2MSFTNGP09.phx.gbl... > Add the LVS_SHOWSELALWAYS style to your List control. > > -- > Cheers > Check Abdoul [ VC++ MVP ] > ----------------------------------- > > "Salim GOMRI" <salim.gomri@wanadoo.fr> wrote...

Simple question on combining workbooks.
I have two multi-sheet workbooks that I need to combine (the macros need to be combined too). How do I do this? I know it CAN be done, I just can't remember how. -- madbloke ------------------------------------------------------------------------ madbloke's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=14422 View this thread: http://www.excelforum.com/showthread.php?threadid=264637 Copying sheets an be done via the worksheet tab right-click menu, or by dragging the worksheet tabs between workbooks. You can also drag modules from one workbook to anothe...

Question regarding installing ESM tools
Hi everyone, Just wondering, I am running Exchange 2003 SP1. Our network is Native Mode Windows 2000. Since we moved to Exchange 2003 (from Exchange 5.5) i have had to go into the Exchange server's ADUC snap-in to create new users just for the ability to create a new mailbox with the user. I would like to be able to do this from any one of our DC's . I think this is possile if i install the ESM tools from the exchange CD on our DC's. 1) How safe is this to do considering our environment? and 2) Does it require a restart of the DC's? (which i imagine it does) thanks...

General multiple new user questions
I have to test for Excel 2000, the problem is I have experience on Excel 97 & Excel 2003. I need a quick source for information on built-in features, fundamentals, formatting, formulas & calculations, and entering data in general. Any help is greatly appreciated. It is much the same, there are a few differences, but nothing really major. Wouldn't just trying it suffice for your needs, and address each difference as you come across it? Here is one source of differences I found http://asp2.wlv.ac.uk/its/website/selfhelp/help/excel/MainDifferencesExcel2000andExcel2003.asp --...

Tax Question #2
If I sold a stock for a loss in 2004, do I have to claim that loss on my 2004 Income tax if I don't really need the loss? Can I save it for a later year? And if so, how long can you save such a loss? Thanks! Mark In microsoft.public.money, Poster Man wrote: >If I sold a stock for a loss in 2004, do I have to claim that loss on >my 2004 Income tax if I don't really need the loss? Can I save it for >a later year? And if so, how long can you save such a loss? US I assume. You cannot save the loss, except that the net loss amount over $3000 will be carried over until next ye...

insert signature image to excel
Dear all, Now I need to amend the ASP.Net program which manipulate the excel. I know how to write text to the excel cells from vb.net program. But how can I insert the signature image (jpg) from the file location to the excel cells named as signature? Appreciate your help!! Thanks, Raymond ...

WinCE 6.0 Audio Driver Question?
Hi, I got a strange problem. I have no idea for it. I have a IXP 425 platform installed a SM502 PCI module. The problem is in the audio dirver. The driver is not workable. BUT ... 1. The WAV1: is up. 2. If I call waveInOpen() API, return error. The error code is "No driver present" 3. waveInGetNumDevs() returns 0 waveOutGetNumDevs() returns 0 I don't know what's wrong. What makes you think WAV1 is up? Do you know for sure that it didn't go back down? Have you done a debug build? That can tell you a lot... -- Dean...

xml validation error for a schema which using XML Enveloped signat
Hi, I have written the following schema that contains the XML signature: ----------------------------------------------------------------------- <?xml version="1.0" encoding="utf-8" ?> <xs:schema targetNamespace="http://mycompany/integrity/v1.0" elementFormDefault="qualified" xmlns="http://mycompany/integrity/v1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://w...

Interesting question ???
I have a working SBS system (after a hd repair). I need to transfer the public folders to a new system (currently operational) as they have some exchange forms applications in them. So essentially, I need to mount the old pub* into the new system which is a new domain/server but with the same names, etc Is there anyway of getting the pf's onto the new box in their entirity, ie: folders, views, data. I can copy them to a pst but to the best of my knowledge it doesn't re-create the fields/etc. ...

Help with simple sales data base
Hi need help with a school project for one of my off spring ;) They are writing a simple sales database and have become stuck. Any help would be appreciated. We have an Orders table, Customers table (with a link to orders) and a product table. What we are trying to do is have an orders form where you select a customer (done that), and have a subreport pick out the products you are selling - however I cant figure out how to link products to orders as i may have many lines of products on one order and wish to show totals etc? Any pointers.... On 5 mrt, 21:47, CP <C...@di...