String sshPublicKey = configurationProperties.getProperty(Constants.SSH_PUBLIC_KEY);
SSHSecurityContext sshSecurityContext = new SSHSecurityContext();
AuthenticationInfo authenticationInfo = null;
// we give higher preference to the password over keypair ssh authentication
if (sshPassword != null) {
authenticationInfo = new DefaultPasswordAuthenticationInfo(sshPassword);
} else {
authenticationInfo = new DefaultPublicKeyFileAuthentication(sshPublicKey, sshPrivateKey, sshPrivateKeyPass);
}
ServerInfo serverInfo = new ServerInfo(sshUserName, registeredHost.getType().getHostAddress());