[xmlsec] encrypting/signing parts of xml

Varun Sekhri varunsekhri at yahoo.co.uk
Sun Jul 25 18:31:47 PDT 2004

Hello Aleksey,
I followed the code and encryption and decryption
works just as I wanted :).
I was doing the same procedure for signatures.
my sample xml file is given below.
i read the code and also executed the utility with two
different options
1. xmlsec1 --sign --output out1.xml --node-xpath
//daily-values[1] --privkey-pem rsakey.pem

2. xmlsec1 --sign --output out1.xml --node-xpath
//daily-values[2] --privkey-pem rsakey.pem

My both runs gave me exact same answer, as i checked
the digest values and ny diff utility. As i read the
code, the first command shld give me an error because
in the code
should be NULL.
While the second command should work.

In any case, even if the API xmlSecFindNode finds the
xmlnode, still the results should be different.

Please correct me where am I wrong.
One more question
When I execute commmand 
xmlSecDSigCtxSign(dsigCtx, signNode), signNode is
always the template, So this means that the API
calculates the digest of the parent node of the
template and then signs it.


<?xml version="1.0"?>
<?xml-stylesheet type="text/css"

	<sodium units="mg">2400</sodium>
	<carb units="g">30444440</carb>
	<fiber units="g">25</fiber>
	<protein units="g">50</protein>

	<carb units="g">300</carb>
	<fiber units="g">111111125</fiber>
	<protein units="g">50</protein>
      <Reference URI="">
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />


--- Aleksey Sanin <aleksey at aleksey.com> wrote: > Take
a look inside xmlsec command line utility:
> apps/xmlsec.c
> It has an option "--node-xpath" that does exactly
> what you need.
> Just follow the code to find out the c code that
> does it.
> Aleksey

___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun!  http://www.allnewmessenger.com

More information about the xmlsec mailing list