Skip to Content.
Sympa Menu

mace-opensaml-users - adding custom ContentReference to a signature

Subject: OpenSAML user discussion

List archive

adding custom ContentReference to a signature


Chronological Thread 
  • From: "Jason Countryman" <>
  • To:
  • Subject: adding custom ContentReference to a signature
  • Date: Fri, 9 Apr 2010 14:02:26 -0400

Hello,

I'm trying to add a custom SAMLObjectContentReference to my signature.  Here is the code I am using to generate the content reference:


SAMLObjectContentReference contentReference = new SAMLObjectContentReference(assertion);
contentReference.setDigestAlgorithm(SignatureConstants.ALGO_ID_DIGEST_SHA1);
contentReference.getTransforms().add(SignatureConstants.TRANSFORM_ENVELOPED_SIGNATURE);
contentReference.getTransforms().add(SignatureConstants.TRANSFORM_C14N_EXCL_OMIT_COMMENTS); 
signature.getContentReferences().add(contentReference);

When I run this code, the following error occurs when marshalling the assertion:

java.lang.ArrayIndexOutOfBoundsException: 3
at org.apache.xml.security.transforms.Transforms.item(Unknown Source)
at org.opensaml.common.impl.SAMLObjectContentReference.createReference(SAMLObjectContentReference.java:143)
at org.opensaml.xml.signature.impl.SignatureMarshaller.createSignatureElement(SignatureMarshaller.java:114)
at org.opensaml.xml.signature.impl.SignatureMarshaller.marshall(SignatureMarshaller.java:69)
at org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshallChildElements(AbstractXMLObjectMarshaller.java:316)
at org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshallInto(AbstractXMLObjectMarshaller.java:224)
at org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:130)
at org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:86)

There should only be 2 transforms, where is it getting the index of 3?

Thanks,
Jason
______________________________
Jason T. Countryman
Programmer
Community Computer Service

This message has been scanned for viruses and dangerous content by MailScanner, SpamAssassin & ClamAV.

This message and any attachments may contain information that is protected by law as privileged and confidential, and
is transmitted for the sole use of the intended recipient(s). If you are not the intended recipient, you are hereby notified
that any use, dissemination, copying or retention of this e-mail or the information contained herein is strictly prohibited.
If you received this e-mail in error, please immediately notify the sender by e-mail, and permanently delete this e-mail.



Archive powered by MHonArc 2.6.16.

Top of Page