    private void store_pubkey(File dbPath, String serverName, String pk)
    {
      ArrayList<String> lines = new ArrayList<String>();
      File vncDir = new File(FileUtils.getVncHomeDir());
      try {
        if (dbPath.exists()) {
          FileReader db = new FileReader(dbPath);
          BufferedReader dbBuf = new BufferedReader(db);
          String line;
          while ((line = dbBuf.readLine())!=null) {
            String fields[] = line.split("\\|");
            if (fields.length==6)
              if (!serverName.equals(fields[2]) && !pk.equals(fields[5]))
                lines.add(line);
          }
          dbBuf.close();
        }
      } catch (IOException e) {
        throw new AuthFailureException("Could not load known hosts database");
      }
      try {
        if (!dbPath.exists())
          dbPath.createNewFile();
        FileWriter fw = new FileWriter(dbPath.getAbsolutePath(), false);
        Iterator i = lines.iterator();
        while (i.hasNext())
          fw.write((String)i.next()+"\n");
        fw.write("|g0|"+serverName+"|*|0|"+pk+"\n");
        fw.close();
      } catch (IOException e) {
        vlog.error("Failed to store server certificate to known hosts database");
      }
    }
The software does not validate, or incorrectly validates, a certificate.