code: private Boolean supportsMessageProtection(String url, Map<String, String> challengeMap) {
  
          if (!"true".equals(challengeMap.get("supportspop"))) {
              return false;
          }
  
          // Message protection is enabled only for subset of keys operations.
          if (!url.toLowerCase().contains("/keys/")) {
              return false;
          }
  
          String[] tokens = url.split("\\?")[0].split("/");
          return supportedMethods.contains(tokens[tokens.length - 1]);
      }
docs: Checks if resource supports message protection.
  
  @param url
  resource url.
  @param challengeMap
  the challenge map.
  @return true if message protection is supported.