XmlSignature using xpath as a reference URI
Hi,
I would like to use the xpath expression while creating the reference uri element , for example this is how my code looks
Reference ref = fac.newReference("#(//*[@authenticate='true'])", fac.newDigestMethod(DigestMethod.SHA1, null), Collections.nCopies(1,fac.newTransform(Transform.ENVELOPED, (TransformParameterSpec) null)), null, null);
//identifying the cannonicalization method
CanonicalizationMethod cm = fac.newCanonicalizationMethod(CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS,(C14NMethodParameterSpec) null);
//identifying the signaturemethod
SignatureMethod sm = fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null);
//putting all the above info into a signed object
signedinfo = fac.newSignedInfo(cm, sm, Collections.nCopies(1,ref), null);
For example here i have used the following expression "#(//*[@authenticate='true'] , but when i run it gives a error saying not RFC 2395 compliant . So can someone tellme how to specify the xpath expression while contructung the reference URI.
Also i would like to know hwo to give instruction as to where to place the signedInfo element in the output document.
thanking you in advance
sane_techie