How to sign Timestamp

Binh Pham btpham at gmail.com
Wed Oct 31 11:21:15 EDT 2018


Thank you so much for your patience. I am getting close. I marshal the
Timestamp and Signature then I was able to sign it. I am trying to get the
signature value and digest value from the signature but I think I'm in the
wrong place.
After calling signObject(signature), I marshal the signature object.
However, the signature value and digest value are empty. I also marshal the
Timestamp after signing but nothing there. (I expect this since it's a
detach signature)
I added the signature to Security before calling signObject and tried to
marshal the Security but the signature value is still empty.
Please let me know where I can retrieve the signature.

On Tue, Oct 30, 2018 at 9:11 PM Binh Pham <btpham at gmail.com> wrote:

> 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/20181031/7fe8e6d0/attachment.html>


More information about the dev mailing list