Search in sources :

Example 11 with SignableSAMLObject

use of org.opensaml.saml.common.SignableSAMLObject in project pac4j by pac4j.

the class Pac4jHTTPRedirectDeflateEncoder method removeSignature.

/**
 * Removes the signature from the protocol message.
 *
 * @param message current message context
 */
protected void removeSignature(SAMLObject message) {
    if (message instanceof SignableSAMLObject) {
        final SignableSAMLObject signableMessage = (SignableSAMLObject) message;
        if (signableMessage.isSigned()) {
            log.debug("Removing SAML protocol message signature");
            signableMessage.setSignature(null);
        }
    }
}
Also used : SignableSAMLObject(org.opensaml.saml.common.SignableSAMLObject)

Aggregations

SignableSAMLObject (org.opensaml.saml.common.SignableSAMLObject)11 WSSecurityException (org.apache.wss4j.common.ext.WSSecurityException)5 PrivateKey (java.security.PrivateKey)4 X509Certificate (java.security.cert.X509Certificate)4 CryptoType (org.apache.wss4j.common.crypto.CryptoType)4 BasicX509Credential (org.opensaml.security.x509.BasicX509Credential)4 X509KeyInfoGeneratorFactory (org.opensaml.xmlsec.keyinfo.impl.X509KeyInfoGeneratorFactory)4 KeyInfo (org.opensaml.xmlsec.signature.KeyInfo)4 Signature (org.opensaml.xmlsec.signature.Signature)4 IOException (java.io.IOException)2 UnauthorizedServiceException (org.apereo.cas.services.UnauthorizedServiceException)2 XMLObject (org.opensaml.core.xml.XMLObject)2 MessageContext (org.opensaml.messaging.context.MessageContext)2 LogoutSecurityException (ddf.security.samlp.LogoutSecurityException)1 SamlProtocol (ddf.security.samlp.SamlProtocol)1 EntityInformation (ddf.security.samlp.impl.EntityInformation)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 CallbackHandler (javax.security.auth.callback.CallbackHandler)1 NonNull (lombok.NonNull)1 SneakyThrows (lombok.SneakyThrows)1