title: JSCH addIdentity public key argument doesn't make a difference
body: <pre><code>public class FTP {
    public static void main(String args[]){
      JSch jsch = new JSch();
      jsch.setKnownHosts("./known_hosts"); 
  
      Path privateKeyPath = Paths.get("./id_dsa");
      byte[] privateKey = Files.readAllBytes(privateKeyPath);
  
      Path publicKeyPath = Paths.get("./id_dsa.pub");
      byte[] publicKey = Files.readAllBytes(publicKeyPath);
  
      // Either of the lines below work... Why?
      // jsch.addIdentity("", privateKey, publicKey, null);
      // or 
      jsch.addIdentity("", privateKey, null, null);
  
      Session session = jsch.getSession("USER", "myHost.com", 22);
  
      session.connect();
  
    }
  }
  </code></pre>
  
  <p>Setting <code>publicKey</code> to <code>null</code>, doesn't make a difference, I can connect either way. Why is that?</p>
  
  <p>It looks like the <code>publicKey</code> isn't being used, so why pass it to <code>addIdentity</code> in the first place?</p>