470,833 Members | 1,350 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

Signing xml

Hello!

I'd like to sign part od XML document, i.e. object:

<object id="myId">
<content myattribute1="value1" myattribute2="value2" />
</object>

I tried to do it with xmlsec and envelped signature, but found, that
if I change number of spaces in indents:

<object>
<content myattribute1="value1" myattribute2="value2" />
</object>

verification fails. How can I avoid this ?

This is Signature part:

<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
<SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="">
<Transforms>
<Transform
Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue></DigestValue>
</Reference>
</SignedInfo>
<SignatureValue/>
<KeyInfo>
<KeyName/>
</KeyInfo>
</Signature>
JT.
Apr 5 '06 #1
1 1206
Jarek wrote:
I'd like to sign part od XML document, i.e. object:
I tried to do it with xmlsec and envelped signature, but found, that
if I change number of spaces in indents:
verification fails. How can I avoid this ?


You can't, as far as I know. XML Signatures are explicitly sensitive to
whitespace, since they've made no attempt to distinguish between
whitespace that is or is not significant to the document's meaning.
Canonicalization suppresses *some* possible non-meaningful differences,
but I don't think it will suppress this one.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Apr 5 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Todd Richardson | last post: by
3 posts views Thread by bob | last post: by
1 post views Thread by AVL | last post: by
reply views Thread by Daniel | last post: by
reply views Thread by Raffi Basmajian | last post: by
6 posts views Thread by raylopez99 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.