public static String generateJsonWebKey(final int size) {
        val octetKey = OctJwkGenerator.generateJwk(size);
        val params = octetKey.toParams(JsonWebKey.OutputControlLevel.INCLUDE_SYMMETRIC);
        return params.get(JSON_WEB_KEY).toString();
    }
Generate octet json web key of given size .

@param size the size
@return the key
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/EncodingUtils.java