<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">You can ignore the question above about signature value and digest value being empty. I found the errors of my way. I had backward between signature and timestamp when I marshal those 2 objects.</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">The only question I have left is there away to tell the signature object to don't break the signature value block into multiple line?</div><div class="gmail_default" style="font-family:georgia,serif">At the end of each line, it has "
" by default. I was wondering if that would affect the validation anyhow.</div><div class="gmail_default" style="font-family:georgia,serif">This is my signature value looks like<br><div class="gmail_default"><ds:SignatureValue></div><div class="gmail_default">clwPq0HLw9AGxYqEE4/wi+wGoBTIGiUl8TbiTin8y9Z5OkvZEDgiLDRt6C0B0ZMUmgpI3+ZoEW6e
</div><div class="gmail_default">Wpd+GEttEbmw7+IQYjH1OcVBQoLy2R/IGuAclb1Xir9yFncdkN9t20h7nsYURM8UkfkN4izmQ3yo
</div><div class="gmail_default">PwsYKmdan4zD0eIm/LMWHOZjmBay2G75i1epXogBXmjnrE77Vwl+4lScU4F458aTOdJA61cYa6qh
</div><div class="gmail_default">sThcFeZ/kXG5cgm6r+yhgleRfCuCvLML/zJU/P+rb3hkXw8z7f9VBAHmBUvZFys/9Otur0WqVrYA
</div><div class="gmail_default">0loxXHgJ4ukqdKGFX/9b1tQrNRr3iIUAhgc96jqxGYKKTqYRv8P9rD9y835EZXLfm4tbP9LXBALT
</div><div class="gmail_default">IVlo4DP8aDGbVymDxGomwjOzofwVN4i1oVC6/MUdTMqw62Za7EQ27OLRpzyhy34T62MrQgWYevut
</div><div class="gmail_default">DHDFY6cJJ4blJxZUmko9Pt04VzH+bRL5zsDxUFpmc/+xUr1Ulthk1QiaZ4n75fe+I5pBa/IZu1TC
</div><div class="gmail_default">7BJ+5a04qz+Ii5s6QRXgPVXP9ICd1Wfk+sUmS23Y3KujVixprMHgweOGG7e88DlHsI2FSPHNFGSz
</div><div class="gmail_default">9Qs0bcDdJ5ACfA/IzTIW0NE/6Enkjt4KynwBj9pW3ETEfBIlgO5f4UDRR538Whb1LWx0F1BXqB0=</div><div class="gmail_default"></ds:SignatureValue></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 31, 2018 at 11:21 AM Binh Pham <<a href="mailto:btpham@gmail.com">btpham@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">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. </div><div class="gmail_default" style="font-family:georgia,serif">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)</div><div class="gmail_default" style="font-family:georgia,serif">I added the signature to Security before calling signObject and tried to marshal the Security but the signature value is still empty.</div><div class="gmail_default" style="font-family:georgia,serif">Please let me know where I can retrieve the signature.</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 30, 2018 at 9:11 PM Binh Pham <<a href="mailto:btpham@gmail.com" target="_blank">btpham@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">It throws the exception "Unable to compute signature, Signature XMLObject does not have the XMLSignature created during marshalling." when I call Signer.signObject(signature);</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">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.</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif"><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 30, 2018 at 5:36 PM Brent Putman <<a href="mailto:putmanb@georgetown.edu" target="_blank">putmanb@georgetown.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<br>
<div class="m_-7802906362795257791m_2130550466983860654m_5220714613770372805moz-cite-prefix">On 10/30/18 1:41 PM, Binh Pham wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div class="gmail_default" style="font-family:georgia,serif">Thank
you so much for helping thus far. I still have some more
questions.</div>
<div class="gmail_default" style="font-family:georgia,serif"><br>
</div>
<div class="gmail_default" style="font-family:georgia,serif">I
would add the timestamp id to
DocumentInternalIDContentReference like so:<br>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">DocumentInternalIDContentReference
reference = new
DocumentInternalIDContentReference(timestamp.getWSUId());</div>
<div class="gmail_default">reference.getTransforms().add(SignatureConstants.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);</div>
<div class="gmail_default">reference.setDigestAlgorithm(SignatureConstants.ALGO_ID_DIGEST_SHA1);</div>
<div class="gmail_default">Signature signature =
getSignature(credential);</div>
<div class="gmail_default">signature.getContentReferences().add(reference);</div>
</div>
</div>
</div>
</blockquote>
<br>
Offhand, structurally speaking that looks correct to me. <br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div class="gmail_default" style="font-family:georgia,serif">
<div class="gmail_default"><br>
</div>
<div class="gmail_default">Then call
Signer.signObject(signature);?</div>
</div>
</div>
</div>
<br>
</blockquote>
<br>
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.<br>
<br>
</div>
</blockquote></div>
</blockquote></div>
</blockquote></div>