[xmlsec] How to sign an XML document using multiple RSA keys?

Li, Yunhong yunhong.li at intel.com
Tue Jun 8 16:06:03 PDT 2004


 

Hi, All:

 

I have a simple question. I have an XML document like following.

 

<?xml version="1.0" encoding="UTF-8">
<Root>
  <Data Id="1234">
    The data I want to sign
  </Data>
</Root>

 

I would like to sign <Data> node with different keys like,
rsa_private_key1.pem and rsa_private_key2.pem. How do I do that with the
xmlsec app (xmlsec1)?

 

I create a template with two <Signature> nodes in the same XML document.
"xmlsec1" always signs the first <Signature> node.

 

<?xml version="1.0" encoding="UTF-8">
<Root>
  <Data Id="1234">
    The data I want to sign
  </Data>

 

        <Signature>

        . . .

    <Reference URI="#1234"> . . . </Reference>

        . . .

        </Signature>

 

        <Signature>

        . . .

    <Reference URI="#1234"> . . . </Reference>

        . . .

  </Signature>
</Root>

 

I tried "xmlsec1 -sign -private-pem rsa_private_key1.pem template.xml >
tmp.xml", and then "xmlsec1 -sign -private-pem rsa_private_key2.pem
tmp.xml". I did not have any luck.

 

I am not sure that I did it right. Any help would be appreciated.

 

Thanks.

--Yunhong

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.aleksey.com/pipermail/xmlsec/attachments/20040608/99c6573d/attachment-0002.htm


More information about the xmlsec mailing list