Class SAMLMessageSecuritySupport


  • public final class SAMLMessageSecuritySupport
    extends Object
    A support class for SAML security-related message handler operations.
    • Constructor Detail

      • SAMLMessageSecuritySupport

        private SAMLMessageSecuritySupport()
        Constructor.
    • Method Detail

      • signMessage

        public static void signMessage​(@Nonnull
                                       org.opensaml.messaging.context.MessageContext messageContext)
                                throws org.opensaml.security.SecurityException,
                                       org.opensaml.core.xml.io.MarshallingException,
                                       org.opensaml.xmlsec.signature.support.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:
        org.opensaml.security.SecurityException - if there is a problem preparing the signature
        org.opensaml.core.xml.io.MarshallingException - if there is a problem marshalling the SAMLObject
        org.opensaml.xmlsec.signature.support.SignatureException - if there is a problem with the signature operation
      • getContextSigningParameters

        @Nullable
        public static org.opensaml.xmlsec.SignatureSigningParameters getContextSigningParameters​(@Nonnull
                                                                                                 org.opensaml.messaging.context.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