473,569 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Canonical XML with SHA1

2 New Member
Hi
I am using C# (.NET) to do the following

I am trying to canonicalize the xml and signing the xml using sha1. Please read the scenario below

I have form with few fields, when I click save it will point to DLL file, then DLL file load the xml from the form and do the signing and giving me the value somthing like FGThHy509-sfjGHTmn+jgkjgk = and save output as an XML file. So far is fine. The calculated value will be saved between the <Dvalue type="sign">FGT hHy509-sfjGHTmn+jgkjgk =</Dvalue>

The code I am using to save the calculated value is

__strFileConten t = _strFileContent .Replace("<DVal ue Type=\"sign\"></DValue>","<DVal ue Type=\"sign\">" + _strKey +"</DigestValue>");

The above code only work if the same element (<Dvalue type="sign">) is present in the form.

Note: Sha1 -FGThHy509-sfjGHTmn+jgkjgk =----This value will change for a small change in the form.

My question:-

Question 1. How do I remove the element <DValue Type=\"sign\"></DValue> before the xml from form loaded to the DLL file or memory, then I can use the above said code

_strFileContent = _strFileContent .Replace("<DVal ue Type=\"sign\"></DValue>","<DVal ue Type=\"sign\">" + _strKey +"</DigestValue>");

OR OR OR OR

Question 2. If I remove the element <DValue Type=\"sign\"></DValue> permanantly from the form ,then WHAT CODE I USE to add the calculated (SHA1- FGThHy509-sfjGHTmn+jgkjgk =) with the element <DValue Type=\"sign\"></DValue> to the output xml file.


The reason I am trying to do the above is , SHA1 calculating digest value including this element <DValue Type=\"sign\"></DValue> . BUT I AM TRING TO CALCULATE SHA1 EXCLUDE THE ABOVE ELEMENT and at the same time it has to present in the form in order to use this code (__strFileConte nt.Replace("<DV alue Type=\"sign\"></DValue>","<DVal ue Type=\"sign\">" + _strKey +"</DigestValue>");


Please give your ideas. I am new and try to solve this with the code I found in the internet.But THERE MUST BE SIMPLE OPTION TO ACHIVE THE ABOVE.
Aug 14 '06 #1
0 2137

Sign in to post your reply or Sign up for a free account.

Similar topics

17
4196
by: Douglas Alan | last post by:
Is there a canonical way of iterating over the lines of a file that are null-separated rather than newline-separated? Sure, I can implement my own iterator using read() and split(), etc., but considering that using "find -print0" is so common, it seems like there should be a more cannonical way. |>oug
3
10012
by: deko | last post by:
I have a (Access 2003) contact management database where the user can double-click a contact's phone number in a form and have the Windows Phone Dialer dial the number. The problem is the number has to be in canonical format or dialing rules won't be applied (cf. MSKB Article 318575). I don't want to use an Input Mask because users like to...
6
4457
by: Chang | last post by:
How to get SHA1 or MD5 of a big file (+5MB - 20GB) as I can't read 20GB into memory. -- Chang.
1
1758
by: Juan R. | last post by:
Introduction I am developing the CanonML language (version 1.0) as a way to generate, store, and publish canonical science documents on the Internet. This language will be the basis for the next version 2.0 of the website of the Center for CANONICAL |SCIENCE). The current preliminary version -in proof stage- has been developed on XHTML 1.1 +...
1
1728
by: Juan R. | last post by:
The initial CanonMath program presented here http://canonicalscience.blogspot.com/2006/02/choosing-notationsyntax-for-canonmath.html] was discussed with several specialists, including father of XML-MAIDEN project (which provided many interesting ideas over original desing). The initial CanonMath program (was abandoned) was presented at the...
8
5602
by: sathyashrayan | last post by:
Dear group, For a log-in page I have created a mysql db and user registers with a user name and password. The password field is encrypted with $passwd = sha1($_REQUEST); I insert the $passwd in mysql_insert. The password gets encrypted and stored in mysql. Now I want to check if the user has entered the correct password when he logs...
2
3194
by: amygdala | last post by:
Hi, Does anybody now of a custom crypt function that implements sha1? The thing I like about crypt is that I don't have to worry about (re)generating salt when querying the database. Or are there perhaps other functions that implements this same functionality and generates a sha1 hash? Cheers.
1
2531
by: zzz | last post by:
Hi all, I was recently reading the book "Write Great code by ryndall Hyde" in this in chapter 8 the following are given. given n input variables there are two raised to two raised to n unique Boolean functions ex:- for 2 i/p variables there are 16 different functions. then he mentions about canonical forms. he says about sum of min...
2
4813
by: Jeffrey Walton | last post by:
Hi All, BMP Strings are a subset of Universal Strings.The BMP string uses approximately 65,000 code points from Universal String encoding. BMP Strings: ISO/IEC 10646, 2-octet canonical form, Universal String: ISO/ IEC 10646, 4-octet canonical form. An excellent discussion occured with respect to BMP Strings and .Net (see...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7679
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.