474,021 Members | 3,337 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML digital signatures

AK
Hello,

Is it possible to sign resources pointed to from an xml doc and the
element that contains those urls at the same time?

This is the xml:

<osfm:assets name="">
<osfm:asset media-type="text/xml" name="META-INF/
Container.xml" />
<osfm:asset media-type="text/xml" name="META-INF/Manifest.xml" /
>
<osfm:asset media-type="text/xml" name="META-INF/Metadata.xml" /
>
</osfm:assets>

So, after hashing those three files I would also like to hash the
osfm:assets element, but I can't find a way to do that without
creating a new SignedXml object, which then means I've got two
signatures. Does anyone know if I can add the element here as well?

This is the code so far:

public void hashAssets(XmlD ocument Doc, RSA Key)
{
// Create a SignedXml object
SignedXml signedXml = new SignedXml(Doc);

// Add the key
signedXml.Signi ngKey = Key;

// Get urls to assets with signed = true
assetUris = getAssetUris();

foreach (string assetUri in assetUris)
{
// Create a reference to be signed
Reference reference = new Reference();
reference.Uri = assetUri;

//// Add an enveloped transformation to the reference
//XmlDsigEnvelope dSignatureTrans form env = new
XmlDsigEnvelope dSignatureTrans form();
//reference.AddTr ansform(env);

// Add the reference to the SignedXml object
signedXml.AddRe ference(referen ce);
}

// This is where I would like to hash the xml element
XmlElement assetElement = Doc.GetElements ByTagName("osfm :assets")[0]
as XmlElement;

// Compute the signature
signedXml.Compu teSignature();

// Get the XML representation of the signature and save it to an
XmlElement object
XmlElement xmlDigitalSigna ture = signedXml.GetXm l();

// Append the element to the XML document
Doc.DocumentEle ment.AppendChil d(Doc.ImportNod e(xmlDigitalSig nature,
true));
}
Many thanks,

Annelie
Nov 5 '08 #1
0 1124

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
7664
by: Guangxi Wu | last post by:
Hi all, Happy New Year. I am using SignedXML and an X509 certificate to digitally sign a SOAP message body and put the signature in the SOAP header for a B2B business application. Can you suggest which type of digital certificates from VeriSign is for this purpose? I checked VeriSign's web site but didn't find it obvious to decide.
5
4844
by: John Campbell | last post by:
Hi everyone I've been doing my best to understand the specifics of implimentating XML Digital Signatures, but I seem to be missing a fundamental concept. Let me start with a description of the problem I am trying to solve. In my application, people send an XML file that contains data for loans. The application then takes that data and performs various calculations returning the results in an XML file that combines both the initial data and...
0
1151
by: Bradley Ward | last post by:
I have been searching and searching online for code examples of using both ..net framework and also WSE 2.0 classes to digitally sign a SOAP document and then verify the document. I got a few hits on this site. One of them referenced an online tutorial for the WSE package that deals with digital signatures, but the link was old and no longer any good. Is there an online tutorial for using WSE to do digital signatures of XML documents,...
0
1312
by: dixie | last post by:
My application developed in A2k has recently been run on an Access 2003 system and when it starts up there is a message that suggests that the macros need digital signatures. How do I create macros with digital signatures? dixie
2
3695
by: Martin Høst Normark | last post by:
Hi everyone Has anyone got the least experience in integrating the Digital Signature with an ASP.NET Web Application? Here in Denmark, as I supose in many other countries, they're promoting the digital signature. A lot of people already has one, to do their taxes, and much more. I have to use for a business-to-business e-commerce solution, where it's vital that the right user is being logged on, and not give his username and password...
6
11586
by: Matt Frame | last post by:
I have a client that has asked us to get a digital signature certificate and start digitally signing all files we pass between each other. I have heard of the subject and know about the certs but I have no idea how to do something like this with VB.Net. Has anyone done something like this or know where I can find out information how to perform the process of signing a document when sending it then checking one on receipt? Your help is...
1
2912
by: karflips33 | last post by:
Is it possible to automate the signing of Word 2003 docs with Digital Signatures? My problem with the code approach using ActiveDocument.Signatures.Add
6
2187
by: simon | last post by:
I created an access database and digitally signed it. I then gave a copy of this Database to a friend. A few months later he wanted me to make some changes to it so i took an up-to-date copy from him and opened it on my computer..... but it tells me the "Visual basic project has been protected with a password". All web links tell me to open the visual basic editor and select TOOLS - DIGITAL SIGNATURES.... but the option is not there. if i...
1
1958
by: ckpoll2 | last post by:
Hi, I have a rookie question for you. I have a database where people create a form that has to be signed. Rather than print off a hard copy, I'd like the spot for the signature to have a digital signature where it says "Digitally signed by Person X." Is this possible at all? I really don't understand digital signatures, so please forgive the the trivial nature of my problem. Thanks, Charlie
5
2029
by: troy_lee | last post by:
We have an application developed by one developer. He compiled the database into an application and digitally signed the application. He doesn't know if he used selfcert of makecert to make the key. The problem is I am creating additional forms now for the database on a different machine. Whenever we try and incorporate the forms I develop into the application, the application fails on some users' machines. We suspect it is because I am...
0
10487
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10296
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
12044
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11554
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
11073
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7791
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6590
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4896
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3914
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.