You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by Charles Brown <c_...@hotmail.com> on 2012/12/01 19:44:35 UTC

RE: Newbie question on java samples.


Okay, I went through code again. As far as I understand we are signing three documents in the code. First is enveloped signature and other two are external documents which are signed with detached signature. Let me know if I am correct.
Charles.
From: c_brown1999@hotmail.com
To: dev@santuario.apache.org
Subject: RE: Newbie question on java samples.
Date: Fri, 30 Nov 2012 22:20:36 +0530





Thanks for reply.
One document is already created using dom tree in the code ( from line 76 to 104 ). Are we signing this document which created in code or external documents?
Thanks 
Charles.
Date: Wed, 28 Nov 2012 13:51:36 +0000
Subject: Re: Newbie question on java samples.
From: coheigea@apache.org
To: dev@santuario.apache.org


I'm not sure what the cause of your confusion is exactly. In the sample code when it is calling "sig.addDocument(URI)" it is signing the XML document available at that URI. The Javaworld tutorial you linked to does not sign any external resource.


I'm not sure what to recommend in terms of helping to better understand the library. I guess continue going through the rest of the samples and then take a look at the unit tests in the source code for more in-depth testing. I guess we could do with some tutorials on the webpage...


Colm.

On Sat, Nov 24, 2012 at 8:45 PM, Charles Brown <c_...@hotmail.com> wrote:





Hello,
I am very new here and I started learning Apache Santuario. I went through java samples. The first java sample I have chosen for learning is CreateSignature.java. 
I could understand following code at line 142 to 151

{            //Add in 2 external URIs. This is a detached Reference.            //            // When sign() is called, two network connections are made. -- well,
            // not really, as we use the OfflineResolver which acts as a proxy for            // these two resouces ;-))            //            sig.addDocument("http://www.w3.org/TR/xml-stylesheet");
            sig.addDocument("http://www.nue.et-inf.uni-siegen.de/index.html");        }


Why following is required? I went through one very old tutorial at JavaWorld, I did not find this in that tutorial.  The link for this JavaWorld tutorial is http://www.javaworld.com/javaworld/jw-12-2002/jw-1220-xmlsecurity.html?page=6

  sig.addDocument("http://www.w3.org/TR/xml-stylesheet"); sig.addDocument("http://www.nue.et-inf.uni-siegen.de/index.html");

Also, I will be happy if I get proper direction to learning Santuario. Which Samples should I try to learn next.
Thank you. 		 	   		  


-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com