Package net.schmizz.sshj.userauth.keyprovider

Examples of net.schmizz.sshj.userauth.keyprovider.OpenSSHKeyFile$Factory


      }
      ssh.connect(hostAndPort.getHostText(), hostAndPort.getPortOrDefault(22));
      if (loginCredentials.getPassword() != null) {
         ssh.authPassword(loginCredentials.getUser(), loginCredentials.getPassword());
      } else {
         OpenSSHKeyFile key = new OpenSSHKeyFile();
         key.init(loginCredentials.getPrivateKey(), null);
         ssh.authPublickey(loginCredentials.getUser(), key);
      }
      return ssh;
   }
View Full Code Here


            client.setConnectTimeout(DEFAULT_CONNECT_TIMEOUT);
            client.setTimeout(timeoutInMillis);
        }
        client.connect(machine.getPublicDnsName(), machine.getSshPort());

        OpenSSHKeyFile key = new OpenSSHKeyFile();
        key.init(adminAccess.getPrivateKey(), adminAccess.getPublicKey());
        client.authPublickey(adminAccess.getUsername(), key);

        return client;
    }
View Full Code Here

      }
      ssh.connect(hostAndPort.getHostText(), hostAndPort.getPortOrDefault(22));
      if (loginCredentials.getOptionalPassword().isPresent()) {
         ssh.authPassword(loginCredentials.getUser(), loginCredentials.getOptionalPassword().get());
      } else if (loginCredentials.hasUnencryptedPrivateKey()) {
         OpenSSHKeyFile key = new OpenSSHKeyFile();
         key.init(loginCredentials.getOptionalPrivateKey().get(), null);
         ssh.authPublickey(loginCredentials.getUser(), key);
      } else if (agentConnector.isPresent()) {
         AgentProxy proxy = new AgentProxy(agentConnector.get());
         ssh.auth(loginCredentials.getUser(), getAuthMethods(proxy));
      }
View Full Code Here

TOP

Related Classes of net.schmizz.sshj.userauth.keyprovider.OpenSSHKeyFile$Factory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.