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



Reply via email to