Class SignMessageDigestIssuer

java.lang.Object
se.swedenconnect.opensaml.sweid.saml2.signservice.SignMessageDigestIssuer

public class SignMessageDigestIssuer extends Object
Utility bean that may be used by Identity Providers to issue a signMessageDigest attribute.
Author:
Martin Lindström (martin@idsec.se)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    SHA-256 is the default digest method.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.opensaml.saml.saml2.core.Attribute
    create(Message message)
    Creates a signMessageDigest attribute using the default digest method.
    org.opensaml.saml.saml2.core.Attribute
    create(Message message, org.opensaml.saml.saml2.metadata.EntityDescriptor recipient)
    Creates a signMessageDigest attribute using the preferred digest method of the recipient, or the default digest method if none is specified in the recipient metadata.
    Gets the default digest method to use.
    static String
    getDigestPreference(org.opensaml.saml.saml2.metadata.EntityDescriptor metadata)
    The recipient may specify the digest algorithm it prefers by including the <alg:DigestMethod> element in its metadata.
    void
    setDefaultDigestMethod(String defaultDigestMethod)
    Assigns the default digest method to use.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_DIGEST_METHOD

      public static final String DEFAULT_DIGEST_METHOD
      SHA-256 is the default digest method.
      See Also:
  • Constructor Details

    • SignMessageDigestIssuer

      public SignMessageDigestIssuer()
  • Method Details

    • create

      public org.opensaml.saml.saml2.core.Attribute create(Message message)
      Creates a signMessageDigest attribute using the default digest method.
      Parameters:
      message - the sign message
      Returns:
      a signMessageDigest attribute
    • create

      public org.opensaml.saml.saml2.core.Attribute create(Message message, org.opensaml.saml.saml2.metadata.EntityDescriptor recipient)
      Creates a signMessageDigest attribute using the preferred digest method of the recipient, or the default digest method if none is specified in the recipient metadata.
      Parameters:
      message - the sign message
      recipient - the recipient metadata (may be null)
      Returns:
      a signMessageDigest attribute
    • getDigestPreference

      public static String getDigestPreference(org.opensaml.saml.saml2.metadata.EntityDescriptor metadata)
      The recipient may specify the digest algorithm it prefers by including the <alg:DigestMethod> element in its metadata.
      Parameters:
      metadata - the recipient's metadata
      Returns:
      the preferred digest algorithm, or null if none is specified
    • getDefaultDigestMethod

      public String getDefaultDigestMethod()
      Gets the default digest method to use.
      Returns:
      the algorithm URI for the default digest method
    • setDefaultDigestMethod

      public void setDefaultDigestMethod(String defaultDigestMethod)
      Assigns the default digest method to use.
      Parameters:
      defaultDigestMethod - the algorithm URI for the default digest method