You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by Stefano Del Sal <st...@insiel.it> on 2006/01/27 15:49:22 UTC
TRANSFORM_XPATH2FILTER question
I'm trying to sign a document using the transform TRANSFORM_XPATH2FILTER,
but I get a bad signature if I try to use ONLY the filter
XPath2FilterContainer.SUBTRACT
1) Ex:
String filters[][] = {
{XPath2FilterContainer.SUBTRACT, "//NotToBeSigned"}
};
transforms.addTransform(
Transforms.TRANSFORM_XPATH2FILTER,
XPath2FilterContainer.newInstances(doc, filters)
);
With this filter I always get the same DigestValue element inside SignedInfo,
even with different xml sources.
But, if I try to add the filter XPath2FilterContainer.INTERSECT
including all nodes, then I get the right DigestValue and signature
2) Ex:
String filters[][] = { { XPath2FilterContainer.INTERSECT, "*" },{
XPath2FilterContainer.SUBTRACT, "//NotToBeSigned"} };
transforms.addTransform(Transforms.TRANSFORM_XPATH2FILTER,
XPath2FilterContainer.newInstances(doc, filters));
The second example works both with the 1.3 and 1.2 releases, while the first
one does not work with 1.3 release.
Is this a bug of the new version or do I always have to use both filters?
Thanks
Stefano Del Sal
Re: TRANSFORM_XPATH2FILTER question
Posted by Raul Benito <ra...@apache.org>.
Hi Stefeno,
I think you have hit a bug in the changes I do for xpath between 1.2
and 1.3, do you mind to open a bug report in bugzilla?
Please, attach a test case that shos the bug(This increase the speed
of fix a lot...).
Regards,
On 1/27/06, Berin Lautenbach <be...@wingsofhermes.org> wrote:
>
> Stefano Del Sal wrote:
> > I'm trying to sign a document using the transform TRANSFORM_XPATH2FILTER,
> > but I get a bad signature if I try to use ONLY the filter
> > XPath2FilterContainer.SUBTRACT
> >
> > 1) Ex:
> > String filters[][] = {
> > {XPath2FilterContainer.SUBTRACT, "//NotToBeSigned"}
> > };
> > transforms.addTransform(
> > Transforms.TRANSFORM_XPATH2FILTER,
> > XPath2FilterContainer.newInstances(doc, filters)
> > );
>
> I'm assuming that the input nodeset is everything in the document?
> (E.g. URI=""). If that's the case then this is a bug. Adding a union
> (as in your second example) should not change the input node set for the
> subtraction filter.
>
> Unfortunately I'm not close enough to this code to fix it quickly.
>
> Raul - do you know if anything changed in this area with the
> optimisation work?
>
> Cheers,
> Berin
>
--
http://r-bg.com
Re: TRANSFORM_XPATH2FILTER question
Posted by Berin Lautenbach <be...@wingsofhermes.org>.
Stefano Del Sal wrote:
> I'm trying to sign a document using the transform TRANSFORM_XPATH2FILTER,
> but I get a bad signature if I try to use ONLY the filter
> XPath2FilterContainer.SUBTRACT
>
> 1) Ex:
> String filters[][] = {
> {XPath2FilterContainer.SUBTRACT, "//NotToBeSigned"}
> };
> transforms.addTransform(
> Transforms.TRANSFORM_XPATH2FILTER,
> XPath2FilterContainer.newInstances(doc, filters)
> );
I'm assuming that the input nodeset is everything in the document?
(E.g. URI=""). If that's the case then this is a bug. Adding a union
(as in your second example) should not change the input node set for the
subtraction filter.
Unfortunately I'm not close enough to this code to fix it quickly.
Raul - do you know if anything changed in this area with the
optimisation work?
Cheers,
Berin