private static EncryptionConfiguration getEncryptionConfiguration(final RegisteredService registeredService) {
        val encryptionSecret = getRegisteredServiceJwtEncryptionSecret(registeredService);
        if (StringUtils.isNotBlank(encryptionSecret)) {
            val encryptionAlgorithm = determineEncryptionAlgorithm(registeredService);
            val encryptionMethod = determineEncryptionMethod(registeredService);
            if (JWEAlgorithm.Family.RSA.contains(encryptionAlgorithm)) {
                val publicKey = getRsaPublicKey(encryptionSecret);

                val signingSecret = getRegisteredServiceJwtSigningSecret(registeredService);
                val privateKey = StringUtils.isNotBlank(signingSecret) ? getRsaPrivateKey(signingSecret) : null;

                val config = new RSAEncryptionConfiguration();
                config.setAlgorithm(encryptionAlgorithm);
                config.setMethod(encryptionMethod);
                config.setPublicKey(publicKey);
                config.setPrivateKey(privateKey);
                return config;
            }
            val encSecretBytes = getSecretBytes(encryptionSecret, areSecretsBase64Encoded(registeredService));
            return new SecretEncryptionConfiguration(encSecretBytes, encryptionAlgorithm, encryptionMethod);
        }
        return null;
    }
Create a JWT authenticator.

@return the jwt authenticator
support/cas-server-support-token-authentication/src/main/java/org/apereo/cas/token/authentication/TokenAuthenticationSecurity.java