Base64URL header = new Base64URL(s.substring(0, firstDotPos));
JSONObject jsonObject;
try {
jsonObject = JSONObjectUtils.parseJSONObject(header.decodeToString());
} catch (ParseException e) {
throw new ParseException("Invalid plain/JWS/JWE header: " + e.getMessage(), 0);
}