Francisco Sepulveda wrote:
my point is ... let's suppose that i get the following XML document as input
<doc> <element id="123">
        </signature>
   </element>
</doc> so if i have to create an enveloped signature for the element "element" the result should be the following rigth? <doc> <element id="123">
        <signature>
            .....
            <reference URI="#123">
        </signature>
   </element>
</doc>

Yes.

Using the java API (javax.xml.crypto.dsig) i will have to construct the output xml document showed above with the signature ??? let say using a DocumentBuilderFactory instance and the createElement method or there is a transparent way for the programmer to put the signature element inside the element "element"?? just using the Reference, SignedInfo and the rest of the traditional classes...?

You do have to specify where you want the Signature element to be located. The implementation will do the rest of the work of creating the Signature element and inserting it in the document. Have you looked at the example (also in the XMLSec download) of creating an enveloped signature?

http://svn.apache.org/viewvc/xml/security/trunk/src_samples/javax/xml/crypto/dsig/samples/GenEnveloped.java?revision=375655&view=markup

--Sean

Reply via email to