public static String decryptJwtValue(final Key givenKey, final String value) {
        try {
            val realKey = givenKey instanceof final IdentifiableKey idk ? idk.getKey() : givenKey;
            val jwe = new JsonWebEncryption();
            jwe.setKey(realKey);
            jwe.setCompactSerialization(value);
            LOGGER.trace("Decrypting value...");
            return jwe.getPayload();
        } catch (final Exception e) {
            if (LOGGER.isTraceEnabled()) {
                throw new DecryptionException(e);
            }
            throw new DecryptionException();
        }
    }
Decrypt value based on the key created.

@param givenKey the secret key encryption key
@param value    the value
@return the decrypted value
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/EncodingUtils.java