I have an XML like this:
<raiz>
<nro_orden>123</nro_orden>
<datos>Dadada</datos>
</raiz>
I need to sign it with this format:
<raiz>
<Signature>
(...)
<nro_orden>123</nro_orden>
<datos>Dadada</datos>
</Signature>
</raiz>
I have tried two ways (using enveloping and enveloped method). But with first method I get the signature elements in top of the data:
<Signature>
(...)
<Object Id="20150924105053">
<raiz>
<nro_orden>123</nro_orden>
<datos>Dadada</datos>
</raiz>
</Object>
</Signature>
And with second method (enveloped) I get the signature elements in the bottom of the data:
<raiz>
<nro_orden>123</nro_orden>
<datos>Dadada</datos>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
(...)
</Signature>
</raiz>
I just need that the root element () wraps the whole XML (including signature). I know that after an XML is signed, there's no way to modify something or the signing gets corrupt. So, please if you have an idea to my problem let me know.
Thank you in advance for taking the time.