Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XmlSignature using xpath as a reference URI

843811Feb 21 2006
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 21 2006
Added on Feb 21 2006
0 comments
192 views