You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by David Yu <ts...@gmail.com> on 2012/05/17 09:55:00 UTC
Fail to verified the signature
Dear Santuario developers,
I failed to verify the digital signature of the attached XML using the java
code from Pro Apache XML. Could someone help me and provide me some
information why it does not work. I googled a lot but cannot find any
solution works for me.
My environment:
Java JDK 1.7.0_02
XMLSecurity 1.5.2
I get the exception:
org.apache.xml.security.signature.MissingResourceFailureException: The
Reference for URI #_c0c8397e-3669-42c6-a63f-0005ac294790 has no
XMLSignatureInput
Original Exception was
org.apache.xml.security.signature.ReferenceNotInitializedException: Cannot
resolve element with ID _c0c8397e-3669-42c6-a63f-0005ac294790
Original Exception was
org.apache.xml.security.signature.ReferenceNotInitializedException: Cannot
resolve element with ID _c0c8397e-3669-42c6-a63f-0005ac294790
Original Exception was
org.apache.xml.security.signature.ReferenceNotInitializedException: Cannot
resolve element with ID _c0c8397e-3669-42c6-a63f-0005ac294790
Original Exception was
org.apache.xml.security.utils.resolver.ResourceResolverException: Cannot
resolve element with ID _c0c8397e-3669-42c6-a63f-0005ac294790
Thank you
David
Re: Fail to verified the signature
Posted by Chendu <ja...@gmail.com>.
Thank you so much, this helped.
org.w3c.dom.Element assertionElement =
getElementById(doc.getDocumentElement(),id);
assertionElement.setIdAttributeNS(null, "ID", true);
DOMSignContext dsc = new DOMSignContext(keyPair.getPrivate(), assertionElement);
Re: Fail to verified the signature
Posted by David Yu <ts...@gmail.com>.
Thank you so much!
It really helps.
David
On Thu, May 17, 2012 at 2:00 AM, Colm O hEigeartaigh <co...@apache.org>wrote:
> Since the 1.5.0 release, the XML Security for Java project will not
> "search" for the Element that was signed. Instead you need to find the
> element that was signed and register the Id appropriately. For the
> example you have posted, you will need to find the SAML Assertion
> Element, and then register the Id via:
>
> assertionElement.setIdAttributeNS(null, "ID", true);
>
> See here for more information (section "Major changes to how Elements
> are resolved"):
>
> http://santuario.apache.org/java150releasenotes.html
>
> Colm.
>
> On Thu, May 17, 2012 at 8:55 AM, David Yu <ts...@gmail.com> wrote:
> > Dear Santuario developers,
> > I failed to verify the digital signature of the attached XML using the
> java
> > code from Pro Apache XML. Could someone help me and provide me some
> > information why it does not work. I googled a lot but cannot find any
> > solution works for me.
> > My environment:
> > Java JDK 1.7.0_02
> > XMLSecurity 1.5.2
> >
> > I get the exception:
> > org.apache.xml.security.signature.MissingResourceFailureException: The
> > Reference for URI #_c0c8397e-3669-42c6-a63f-0005ac294790 has no
> > XMLSignatureInput
> > Original Exception was
> > org.apache.xml.security.signature.ReferenceNotInitializedException:
> Cannot
> > resolve element with ID _c0c8397e-3669-42c6-a63f-0005ac294790
> > Original Exception was
> > org.apache.xml.security.signature.ReferenceNotInitializedException:
> Cannot
> > resolve element with ID _c0c8397e-3669-42c6-a63f-0005ac294790
> > Original Exception was
> > org.apache.xml.security.signature.ReferenceNotInitializedException:
> Cannot
> > resolve element with ID _c0c8397e-3669-42c6-a63f-0005ac294790
> > Original Exception was
> > org.apache.xml.security.utils.resolver.ResourceResolverException: Cannot
> > resolve element with ID _c0c8397e-3669-42c6-a63f-0005ac294790
> >
> > Thank you
> > David
> >
> >
>
>
>
> --
> Colm O hEigeartaigh
>
> Talend Community Coder
> http://coders.talend.com
>
Re: Fail to verified the signature
Posted by Colm O hEigeartaigh <co...@apache.org>.
Since the 1.5.0 release, the XML Security for Java project will not
"search" for the Element that was signed. Instead you need to find the
element that was signed and register the Id appropriately. For the
example you have posted, you will need to find the SAML Assertion
Element, and then register the Id via:
assertionElement.setIdAttributeNS(null, "ID", true);
See here for more information (section "Major changes to how Elements
are resolved"):
http://santuario.apache.org/java150releasenotes.html
Colm.
On Thu, May 17, 2012 at 8:55 AM, David Yu <ts...@gmail.com> wrote:
> Dear Santuario developers,
> I failed to verify the digital signature of the attached XML using the java
> code from Pro Apache XML. Could someone help me and provide me some
> information why it does not work. I googled a lot but cannot find any
> solution works for me.
> My environment:
> Java JDK 1.7.0_02
> XMLSecurity 1.5.2
>
> I get the exception:
> org.apache.xml.security.signature.MissingResourceFailureException: The
> Reference for URI #_c0c8397e-3669-42c6-a63f-0005ac294790 has no
> XMLSignatureInput
> Original Exception was
> org.apache.xml.security.signature.ReferenceNotInitializedException: Cannot
> resolve element with ID _c0c8397e-3669-42c6-a63f-0005ac294790
> Original Exception was
> org.apache.xml.security.signature.ReferenceNotInitializedException: Cannot
> resolve element with ID _c0c8397e-3669-42c6-a63f-0005ac294790
> Original Exception was
> org.apache.xml.security.signature.ReferenceNotInitializedException: Cannot
> resolve element with ID _c0c8397e-3669-42c6-a63f-0005ac294790
> Original Exception was
> org.apache.xml.security.utils.resolver.ResourceResolverException: Cannot
> resolve element with ID _c0c8397e-3669-42c6-a63f-0005ac294790
>
> Thank you
> David
>
>
--
Colm O hEigeartaigh
Talend Community Coder
http://coders.talend.com