docs: public static Header decode(String header) {
      // verify to json with JAX-RS standard
      JsonObject json;
      try {
        json = Json.createReader(new ByteArrayInputStream(Base64.getUrlDecoder().decode(header))).readObject();
      } catch (JsonException e) {
        throw new DecodeException("Failed convert to JsonObject", e);
      } catch (IllegalArgumentException e) {
        throw new DecodeException("The header is not in valid Base64 scheme", e);
      }
  
      // validate the typ parameter
      String type = json.containsKey("typ") ? json.getString("typ") : null;
      if (type != null && !DEFAULT_TYPE.equals(type))
        throw new DecodeException("The header type '" + type + "' is not support.");
  
      // validate the alg parameter
      String algorithm = json.containsKey("alg") ? json.getString("alg") : null;
      if (algorithm != null && !Algorithm.HS256.name().equals(algorithm))
        throw new DecodeException("The header algorithm '" + algorithm + "' is not support.");
  
      // construct a header instance
      if (DEFAULT_TYPE.equals(type) && Algorithm.HS256.name().equals(algorithm)) {
        // optimise the default standard header to always the same instance
        return Header.DEFAULT;
      } else {
        // create a whole new instance
        Header h = new Header();
        h.type = type;
        h.algorithm = (algorithm != null ? Algorithm.valueOf(algorithm) : null);
        return h;
      }
    }