Signing Assertion with SHA256

Brent Putman putmanb at georgetown.edu
Mon Jan 13 12:32:53 EST 2014


On 1/13/14 11:20 AM, Yang, Gang CTR (US) wrote:
>
> However, I'm having a hard time to find the OpenSAML API to set the digest method for the reference. In my code, I first obtain the org.opensaml.xml.signature.Signature, which allows me to set only the signature algorithm and canonicalization algorithm. Then after associating the signature object with the SAML object, I call Singer.sigObject(Signature) to sign the SAML object, where I don't seem to have a chance to set the digest method for the references. Can some one provide a pointer or help?


The Reference(s) in the signature are determined by the list of
ContentReference(s) that are exposed on the OpenSAML Signature class.

After you add the Signature instance to the SAML instance being signed
(e.g. Assertion), there will be one ContentReference instance in that
list (b/c the Assertion's AbstractSignableSAMLObject superclass
auto-adds it when Signarure#setSignature is called).  The
ContentReference concrete type will be SAMLObjectContentReference.  That
content reference subtype has methods to get and set the DigestMethod
algorithm that will be used.


More information about the dev mailing list