mace-opensaml-users - Re: Should I be able to sign response and assertion with same key?
Subject: OpenSAML user discussion
List archive
- From: Brent Putman <>
- To:
- Subject: Re: Should I be able to sign response and assertion with same key?
- Date: Tue, 15 May 2007 18:12:59 -0400
You can certainly sign them with the same *key*, but you can't reuse the
same Signature object. You need to create a new Signature object for
each SignableXMLObject that will be signed, and set all the parameters
on each Signature appropriately. The library error you're seeing occurs
because an XMLObject can not be the child of two different parents.
This library issue aside, you probably wouldn't want to do this anyway.
It is likely that the Reference element(s) in the two signatures (as
signified by the the ContentReference object(s) that you add to the
Signature object) would need to be different, since they likely point to
different things that are being signed. As far as I know, this would
definitely be the case in any SAML signing one might want to do.
--Brent
Mike Klein wrote:
> I know at a minimum it is assertions most important to sign but I
> thought I should sign enclosing response as well...but I get error when
> doing this.
>
> Signature sig = SAMLUtil.getSignature(response);
> assertion.setSignature(sig);
> String signedEncodedResponse = SAMLUtil.marshall(response, sig,
> true);
>
> As soon as I set signature on assertion I get following:
>
> java.lang.IllegalArgumentException:
> org.opensaml.xml.signature.impl.SignatureImpl cannot be added - it is
> already the child of another SAML Object
> at
> org.opensaml.xml.AbstractXMLObject.prepareForAssignment(AbstractXMLObject.java:370)
>
> How should I be going about this? Is perhaps signing just broken in this
> sense?
>
- Re: Problems signing response...XMLObject does not have the XMLSignature created during marshalling, (continued)
- Re: Problems signing response...XMLObject does not have the XMLSignature created during marshalling, Mike Klein, 05/13/2007
- Re: Problems signing response...XMLObject does not have the XMLSignature created during marshalling, Brent Putman, 05/13/2007
- Re: Problems signing response...XMLObject does not have the XMLSignature created during marshalling, Mike Klein, 05/13/2007
- Re: Problems signing response...XMLObject does not have the XMLSignature created during marshalling, Brent Putman, 05/13/2007
- Re: Problems signing response...XMLObject does not have the XMLSignature created during marshalling, Mike Klein, 05/13/2007
- Re: Problems signing response...XMLObject does not have the XMLSignature created during marshalling, Mike Klein, 05/14/2007
- Re: Problems signing response...XMLObject does not have the XMLSignature created during marshalling, Brent Putman, 05/14/2007
- Re: Problems signing response...XMLObject does not have the XMLSignature created during marshalling, Mike Klein, 05/14/2007
- Re: Problems signing response...XMLObject does not have the XMLSignature created during marshalling, Mike Klein, 05/14/2007
- Should I be able to sign response and assertion with same key?, Mike Klein, 05/15/2007
- Re: Should I be able to sign response and assertion with same key?, Brent Putman, 05/15/2007
- Re: Problems signing response...XMLObject does not have the XMLSignature created during marshalling, Mike Klein, 05/14/2007
- Re: Problems signing response...XMLObject does not have the XMLSignature created during marshalling, Mike Klein, 05/13/2007
- Re: Problems signing response...XMLObject does not have the XMLSignature created during marshalling, Brent Putman, 05/13/2007
- Re: Problems signing response...XMLObject does not have the XMLSignature created during marshalling, Mike Klein, 05/13/2007
Archive powered by MHonArc 2.6.16.