boolean confirmPublicCode(String rawPublicCode, String baseTag, String errorBaseTag) {
    String userEnteredPublicCode = "";
    while (true) {
      userEnteredPublicCode = mainWindow.getStringInput(baseTag, "", "", userEnteredPublicCode);
      if (userEnteredPublicCode == null) return false; // user hit cancel
      String normalizedPublicCode = MartusCrypto.removeNonDigits(userEnteredPublicCode);

      if (rawPublicCode.equals(normalizedPublicCode)) return true;

      mainWindow.notifyDlg(errorBaseTag);
    }
  }
  void processArgs(String[] args) {
    port = MirroringInterface.MARTUS_PORT_FOR_MIRRORING;

    for (int i = 0; i < args.length; i++) {
      String value = args[i].substring(args[i].indexOf("=") + 1);

      if (args[i].startsWith("--ip")) ip = value;

      if (args[i].startsWith("--port") && value != null) port = new Integer(value).intValue();

      if (args[i].startsWith("--public-code")) publicCode = MartusCrypto.removeNonDigits(value);

      if (args[i].startsWith("--output-file")) outputFileName = value;
    }

    if (ip == null || publicCode == null || outputFileName == null) {
      System.err.println(
          "Incorrect arguments: RetrievePublicKey --ip=1.2.3.4 [--port=5] --public-code=6.7.8.1.2 --output-file=pubkey.txt\n");
      System.exit(2);
    }
  }