Class SAMLMessageSecuritySupport
java.lang.Object
org.opensaml.saml.common.messaging.SAMLMessageSecuritySupport
public final class SAMLMessageSecuritySupport extends Object
A support class for SAML security-related message handler operations.
-
Constructor Summary
Constructors Modifier Constructor Description private
SAMLMessageSecuritySupport()
Constructor. -
Method Summary
Modifier and Type Method Description static boolean
checkURLScheme(String scheme)
Check whether the specified URL scheme is allowed.static SignatureSigningParameters
getContextSigningParameters(MessageContext messageContext)
Get the signing parameters from the message context.static void
signMessage(MessageContext messageContext)
Signs the SAML message represented in the message context if it is aSignableXMLObject
and the message context contains signing parameters as determined bygetContextSigningParameters(MessageContext)
.
-
Constructor Details
-
SAMLMessageSecuritySupport
private SAMLMessageSecuritySupport()Constructor.
-
-
Method Details
-
signMessage
public static void signMessage(@Nonnull MessageContext messageContext) throws SecurityException, MarshallingException, SignatureExceptionSigns the SAML message represented in the message context if it is aSignableXMLObject
and the message context contains signing parameters as determined bygetContextSigningParameters(MessageContext)
.- Parameters:
messageContext
- current message context- Throws:
SecurityException
- if there is a problem preparing the signatureMarshallingException
- if there is a problem marshalling the SAMLObjectSignatureException
- if there is a problem with the signature operation
-
getContextSigningParameters
@Nullable public static SignatureSigningParameters getContextSigningParameters(@Nonnull MessageContext messageContext)Get the signing parameters from the message context.- Parameters:
messageContext
- the message context- Returns:
- the signing parameters to use, may be null
-
checkURLScheme
Check whether the specified URL scheme is allowed.- Parameters:
scheme
- the URL scheme to check.- Returns:
- true if allowed, otherwise false
-