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: 3at org.apache.xml.security.transforms.Transforms.item(Unknown Source)
The distinction on that actually will have no effect and comments will never be signed in either case. The reasons why are esoteric, but just trust me on it.
-- Scott
On 4/9/2010 2:50 PM, Scott Cantor wrote:
>> But
>> unless you really care about the difference between the exclusive c14 with
>> vs. without comments, the defaults are exactly what you have above.
>>
> The distinction on that actually will have no effect and comments will never be signed in either case. The reasons why are esoteric, but just trust me on it.
>
Ok. Of course our xmltooling code doesn't preserve comments anyway, so
I guess the distinction is doubly moot.