private static void configureJwtSigning(final int signingSecretSize, final String signingAlgorithm, final JwtGenerator g) {
        if (signingSecretSize <= 0 || StringUtils.isBlank(signingAlgorithm)) {
            LOGGER.info("No signing algorithm or size specified, so the generated JWT will not be encrypted");
            return;
        }

        val signingSecret = RandomUtils.randomAlphanumeric(signingSecretSize);
        LOGGER.info("==== Signing Secret ====\n[{}]\n", signingSecret);

        val acceptedSigningAlgs = Arrays.stream(JWSAlgorithm.class.getDeclaredFields())
            .filter(f -> f.getType().equals(JWSAlgorithm.class))
            .map(Unchecked.function(f -> {
                f.setAccessible(true);
                return ((Algorithm) f.get(null)).getName();
            }))
            .collect(Collectors.joining(","));
        LOGGER.debug("Signing algorithm: [{}]. Available algorithms are [{}]", signingAlgorithm, acceptedSigningAlgs);

        g.setSignatureConfiguration(new SecretSignatureConfiguration(signingSecret, JWSAlgorithm.parse(signingAlgorithm)));
    }
Generate.

@param signingSecretSize    the signing secret size
@param encryptionSecretSize the encryption secret size
@param signingAlgorithm     the signing algorithm
@param encryptionAlgorithm  the encryption algorithm
@param encryptionMethod     the encryption algorithm
@param subject              the subject
support/cas-server-support-shell-core/src/main/java/org/apereo/cas/shell/commands/jwt/GenerateJwtCommand.java