How to sign Timestamp

Binh Pham btpham at gmail.com
Tue Oct 30 21:11:06 EDT 2018


It throws the exception "Unable to compute signature, Signature XMLObject
does not have the XMLSignature created during marshalling." when I call
Signer.signObject(signature);

So the Timestamp will be a child of Security. The Security is not
a SignableXMLObject. I am wondering if I have to create a SignableXMLObject
class and add Timestamp as a child and try to sign from there. Please let
me know if me know if that would be the path to head down. Thanks again for
your help.



On Tue, Oct 30, 2018 at 5:36 PM Brent Putman <putmanb at georgetown.edu> wrote:

>
>
> On 10/30/18 1:41 PM, Binh Pham wrote:
>
> Thank you so much for helping thus far. I still have some more questions.
>
> I would add the timestamp id to DocumentInternalIDContentReference like so:
>
> DocumentInternalIDContentReference reference = new
> DocumentInternalIDContentReference(timestamp.getWSUId());
>
> reference.getTransforms().add(SignatureConstants.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);
> reference.setDigestAlgorithm(SignatureConstants.ALGO_ID_DIGEST_SHA1);
> Signature signature = getSignature(credential);
> signature.getContentReferences().add(reference);
>
>
> Offhand, structurally speaking that looks correct to me.
>
>
> Then call Signer.signObject(signature);?
>
>
> Yes.  Other than manually creating and adding the ContentReference,
> everything else should be conceptually the same as other XML signatures,
> such as the enveloped signature on Assertion.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20181030/9feeb401/attachment.html>


More information about the dev mailing list