You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by Hariprasath <ha...@gmail.com> on 2012/08/28 12:01:40 UTC

XPATH Transform

Hi,
              Im trying to add XPATH transform in my digital signature and 
couldn't make it work using the addTransform() method in the transform class. 
The error im getting is posted below.

Original Exception was 
org.apache.xml.security.transforms.TransformationException: Cannot find ds:XPath 
in Transform
	at 
org.apache.xml.security.signature.Reference.getContentsAfterTransformation(Refer
ence.java:447)
	at 
org.apache.xml.security.signature.Reference.dereferenceURIandPerformTransforms(R
eference.java:600)
	... 5 more
Caused by: org.apache.xml.security.transforms.TransformationException: Cannot 
find ds:XPath in Transform
	at 
org.apache.xml.security.transforms.implementations.TransformXPath.enginePerformT
ransform(TransformXPath.java:93)
	at 
org.apache.xml.security.transforms.Transform.performTransform(Transform.java:304
)
	at 
org.apache.xml.security.transforms.Transforms.performTransforms(Transforms.java:
277)
	at 
org.apache.xml.security.signature.Reference.getContentsAfterTransformation(Refer
ence.java:431)
	... 6 more


Can you please let me know how can i add a XPATH tranform to address a part of 
the document that is signed?

Thanks
Hariprasath


Re: XPATH Transform

Posted by Hariprasath <ha...@gmail.com>.
Hariprasath <hariprasath.mohankumar <at> gmail.com> writes:

> 
> Sorry i didn't update it here. the issue was with the Xpath expression that i 
used. because of that the signature verification was failing. Now its resolved. 


Thanks
Hariprasath
> Colm O hEigeartaigh <coheigea <at> apache.org> writes:
> 
> > Thanks for the reply
> Now i'm able to create <ds:XPath> element in my signature. But validation of 
the 
> signature fails by saying that the digest value doesn't match any idea why it 
is 
> happening?
> 
> Thanks
> Hariprasath
> 
> > 
> > Here is an example:https://svn.apache.org/repos/asf/santuario/xml-security-
> 
java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignat
> ureTest.javaColm.On Tue, Aug 28, 2012 at 11:01 AM, Hariprasath 
> <hariprasath.mohankumar <at> gmail.com> wrote:Hi,
> >               Im trying to add XPATH transform in my digital signature and
> > couldn't make it work using the addTransform() method in the transform 
class.
> > The error im getting is posted below.
> > Original Exception was
> > org.apache.xml.security.transforms.TransformationException: Cannot find 
> ds:XPath
> > in Transform
> >         at
> > 
> 
org.apache.xml.security.signature.Reference.getContentsAfterTransformation(Refer
> > ence.java:447)
> >         at
> > 
> 
org.apache.xml.security.signature.Reference.dereferenceURIandPerformTransforms(R
> > eference.java:600)
> >         ... 5 more
> > Caused by: org.apache.xml.security.transforms.TransformationException: 
Cannot
> > find ds:XPath in Transform
> >         at
> > 
> 
org.apache.xml.security.transforms.implementations.TransformXPath.enginePerformT
> > ransform(TransformXPath.java:93)
> >         at
> > 
> 
org.apache.xml.security.transforms.Transform.performTransform(Transform.java:304
> > )
> >         at
> > 
> 
org.apache.xml.security.transforms.Transforms.performTransforms(Transforms.java:
> > 277)
> >         at
> > 
> 
org.apache.xml.security.signature.Reference.getContentsAfterTransformation(Refer
> > ence.java:431)
> >         ... 6 more
> > Can you please let me know how can i add a XPATH tranform to address a part 
of
> > the document that is signed?
> > ThanksHariprasath
> > 
> > 
> > -- Colm O hEigeartaighTalend Community Coderhttp://coders.talend.com
> > 
> 
> 




Re: XPATH Transform

Posted by Hariprasath <ha...@gmail.com>.

Colm O hEigeartaigh <coheigea <at> apache.org> writes:

> Thanks for the reply
Now i'm able to create <ds:XPath> element in my signature. But validation of the 
signature fails by saying that the digest value doesn't match any idea why it is 
happening?

Thanks
Hariprasath

> 
> Here is an example:https://svn.apache.org/repos/asf/santuario/xml-security-
java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignat
ureTest.javaColm.On Tue, Aug 28, 2012 at 11:01 AM, Hariprasath 
<hariprasath.mohankumar <at> gmail.com> wrote:Hi,
>               Im trying to add XPATH transform in my digital signature and
> couldn't make it work using the addTransform() method in the transform class.
> The error im getting is posted below.
> Original Exception was
> org.apache.xml.security.transforms.TransformationException: Cannot find 
ds:XPath
> in Transform
>         at
> 
org.apache.xml.security.signature.Reference.getContentsAfterTransformation(Refer
> ence.java:447)
>         at
> 
org.apache.xml.security.signature.Reference.dereferenceURIandPerformTransforms(R
> eference.java:600)
>         ... 5 more
> Caused by: org.apache.xml.security.transforms.TransformationException: Cannot
> find ds:XPath in Transform
>         at
> 
org.apache.xml.security.transforms.implementations.TransformXPath.enginePerformT
> ransform(TransformXPath.java:93)
>         at
> 
org.apache.xml.security.transforms.Transform.performTransform(Transform.java:304
> )
>         at
> 
org.apache.xml.security.transforms.Transforms.performTransforms(Transforms.java:
> 277)
>         at
> 
org.apache.xml.security.signature.Reference.getContentsAfterTransformation(Refer
> ence.java:431)
>         ... 6 more
> Can you please let me know how can i add a XPATH tranform to address a part of
> the document that is signed?
> ThanksHariprasath
> 
> 
> -- Colm O hEigeartaighTalend Community Coderhttp://coders.talend.com
> 





Re: XPATH Transform

Posted by Colm O hEigeartaigh <co...@apache.org>.
Here is an example:

https://svn.apache.org/repos/asf/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/dom/signature/CreateSignatureTest.java

Colm.

On Tue, Aug 28, 2012 at 11:01 AM, Hariprasath <
hariprasath.mohankumar@gmail.com> wrote:

> Hi,
>               Im trying to add XPATH transform in my digital signature and
> couldn't make it work using the addTransform() method in the transform
> class.
> The error im getting is posted below.
>
> Original Exception was
> org.apache.xml.security.transforms.TransformationException: Cannot find
> ds:XPath
> in Transform
>         at
>
> org.apache.xml.security.signature.Reference.getContentsAfterTransformation(Refer
> ence.java:447)
>         at
>
> org.apache.xml.security.signature.Reference.dereferenceURIandPerformTransforms(R
> eference.java:600)
>         ... 5 more
> Caused by: org.apache.xml.security.transforms.TransformationException:
> Cannot
> find ds:XPath in Transform
>         at
>
> org.apache.xml.security.transforms.implementations.TransformXPath.enginePerformT
> ransform(TransformXPath.java:93)
>         at
>
> org.apache.xml.security.transforms.Transform.performTransform(Transform.java:304
> )
>         at
>
> org.apache.xml.security.transforms.Transforms.performTransforms(Transforms.java:
> 277)
>         at
>
> org.apache.xml.security.signature.Reference.getContentsAfterTransformation(Refer
> ence.java:431)
>         ... 6 more
>
>
> Can you please let me know how can i add a XPATH tranform to address a
> part of
> the document that is signed?
>
> Thanks
> Hariprasath
>
>


-- 
Colm O hEigeartaigh

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