Class SignMessageDigestIssuer
java.lang.Object
se.swedenconnect.opensaml.sweid.saml2.signservice.SignMessageDigestIssuer
Utility bean that may be used by Identity Providers to issue a signMessageDigest attribute.
- Author:
- Martin Lindström (martin@idsec.se)
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.opensaml.saml.saml2.core.Attribute
Creates a signMessageDigest attribute using the default digest method.org.opensaml.saml.saml2.core.Attribute
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.
-
Field Details
-
DEFAULT_DIGEST_METHOD
SHA-256 is the default digest method.- See Also:
-
-
Constructor Details
-
SignMessageDigestIssuer
public SignMessageDigestIssuer()
-
-
Method Details
-
create
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 messagerecipient
- 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
Gets the default digest method to use.- Returns:
- the algorithm URI for the default digest method
-
setDefaultDigestMethod
Assigns the default digest method to use.- Parameters:
defaultDigestMethod
- the algorithm URI for the default digest method
-