public static String encodeBase64(final String data) {
        return Base64.encodeBase64String(data.getBytes(StandardCharsets.UTF_8));
    }
Base64-encode the given string as a string.

@param data the String to encode
@return the encoded string
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/EncodingUtils.java