public static void verifyNegotiatedQop(String requestedQopString, String negotiatedQop)
    throws IOException {
    // We use the SASL QOP names here, not the HBase names
    if (requestedQopString == null || requestedQopString.isEmpty()) {
      // None requested, nothing to check
      return;
    }
    List<String> requestedQops = Arrays.asList(requestedQopString.toLowerCase().split(","));
    if (negotiatedQop == null) {
      // Null negotiated QOP is equivalent to "auth" (for mechanisms without QOP support)
      negotiatedQop = QualityOfProtection.AUTHENTICATION.getSaslQop();
    }
    if (requestedQops.contains(negotiatedQop.toLowerCase())) {
      return;
    }
    throw new IOException("Could not negotiate requested SASL QOP. Requested:" + requestedQopString
      + " , negotiated:" + negotiatedQop);
  }
Initialize SASL properties for a given RPC protection level.
@param rpcProtection Value of 'hbase.rpc.protection' configuration.
@return Map with values for SASL properties.
hbase-client/src/main/java/org/apache/hadoop/hbase/security/SaslUtil.java