docs: @Override
  	public Map<String, String> convert(String token) {
  		Map<String, String> headers;
  
  		int headerEndIndex = token.indexOf('.');
  		if (headerEndIndex == -1) {
  			throw new InvalidTokenException("Invalid JWT. Missing JOSE Header.");
  		}
  
  		byte[] decodedHeader;
  
  		try {
  			decodedHeader = Codecs.b64UrlDecode(token.substring(0, headerEndIndex));
  		} catch (IllegalArgumentException ex) {
  			throw new InvalidTokenException("Invalid JWT. Malformed JOSE Header.", ex);
  		}
  
  		JsonParser parser = null;
  
  		try {
  			parser = this.factory.createParser(decodedHeader);
  			headers = new HashMap<String, String>();
  			if (parser.nextToken() == JsonToken.START_OBJECT) {
  				while (parser.nextToken() == JsonToken.FIELD_NAME) {
  					String headerName = parser.getCurrentName();
  					parser.nextToken();
  					String headerValue = parser.getValueAsString();
  					headers.put(headerName, headerValue);
  				}
  			}
  
  		} catch (IOException ex) {
  			throw new InvalidTokenException("An I/O error occurred while reading the JWT: " + ex.getMessage(), ex);
  		} finally {
  			try {
  				if (parser != null) parser.close();
  			} catch (IOException ex) { }
  		}
  
  		return headers;
  	}