try {
JSch sch = new JSch();
ConnectorFactory cf = ConnectorFactory.getDefault();
Connector con = cf.createConnector();
IdentityRepository irepo = new RemoteIdentityRepository(con);
sch.setIdentityRepository(irepo);
String knownHosts = knownHosts();
sch.setKnownHosts(knownHosts);