protected String generateSignature(final Credential signingCredential, final String algorithmURI, final String queryString)
        throws MessageEncodingException {

        LOGGER.debug(String.format("Generating signature with key type '%s', algorithm URI '%s' over query string '%s'",
            CredentialSupport.extractSigningKey(signingCredential).getAlgorithm(), algorithmURI, queryString));

        final String b64Signature;
        try {
            val rawSignature =
                XMLSigningUtil.signWithURI(signingCredential, algorithmURI, queryString.getBytes(StandardCharsets.UTF_8));
            b64Signature = Base64Support.encode(rawSignature, Base64Support.UNCHUNKED);
            LOGGER.debug("Generated digital signature value (base64-encoded) {}", b64Signature);
        } catch (final Exception e) {
            throw new MessageEncodingException("Unable to sign URL query string", e);
        }

        return b64Signature;
    }
Generates the signature over the query string.

@param signingCredential credential that will be used to sign query string
@param algorithmURI      algorithm URI of the signing credential
@param queryString       query string to be signed
@return base64 encoded signature of query string
@throws MessageEncodingException there is an error computing the signature
pac4j-saml/src/main/java/org/pac4j/saml/transport/Pac4jHTTPRedirectDeflateEncoder.java