Thanks very much for your reply. It actually answers
my next post too :-)

So, the way to do it is to use importNode() ?
However, I'm not really sure to understand the way it
works:

>         Document signedDoc =
> documentBuilder.newDocument();

Okay, we create the Document object for the signed
document.

>         XMLSignature sig = new
> XMLSignature(signedDoc, baseUri, signatureMethod);

We initialize the ds:Signature object.

>         signedDoc.appendChild(sig.getElement());

We add this so that the signed document includes the
ds:Signature.

>         ObjectContainer obj = new
> ObjectContainer(signedDoc);

We build a ds:Object object on the signed doc ?? there
I don't get it... shouldn't the object container
contain the document to sign (and not the signed
document).

> signedDoc.importNode(doc.getDocumentElement(),
> deepCopy);

Not so sure about this either: we add the document to
sign in the signed document. Why do we do this ? I
would have expected to import the ds:Object (which
contains the document to sign) but not the document to
sign directly.


>         sig.appendObject(obj);

We make sure the signature will sign the ds:Object.

>         sig.sign(privateKey);

At last, we sign.

Best regards,
Axelle.



        

        
                
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

Reply via email to