Package org.opensaml.saml.common.messaging

# 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 a `SignableXMLObject` and the message context contains signing parameters as determined by `getContextSigningParameters(MessageContext)`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SAMLMessageSecuritySupport

private SAMLMessageSecuritySupport()
Constructor.

## Method Details

### signMessage

public static void signMessage(@Nonnull MessageContext messageContext) throws SecurityException, MarshallingException, SignatureException
Signs the SAML message represented in the message context if it is a `SignableXMLObject` and the message context contains signing parameters as determined by `getContextSigningParameters(MessageContext)`.

Parameters:
  `messageContext` - current message context
Throws:
  `SecurityException` - if there is a problem preparing the signature
  `MarshallingException` - if there is a problem marshalling the SAMLObject
  `SignatureException` - 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

public static boolean checkURLScheme(@Nonnull @NotEmpty String scheme)
Check whether the specified URL scheme is allowed.

Parameters:
  `scheme` - the URL scheme to check.
Returns:
  true if allowed, otherwise false