]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.cms.lib.sshd/src/org/argeo/cms/ssh/cli/SshShell.java
Simplify SSH in order to better support native image
[lgpl/argeo-commons.git] / org.argeo.cms.lib.sshd / src / org / argeo / cms / ssh / cli / SshShell.java
index a7283b3ad1d464b2e33745097c0668834f2ddc22..dffb440f1fb94b3fe56026244337e32ea61b6b20 100644 (file)
@@ -8,14 +8,12 @@ import java.security.KeyPair;
 import java.util.List;
 
 import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.MissingArgumentException;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.Options;
 import org.apache.sshd.agent.SshAgent;
 import org.apache.sshd.agent.SshAgentFactory;
 import org.apache.sshd.agent.local.LocalAgentFactory;
 import org.apache.sshd.agent.unix.UnixAgentFactory;
-import org.apache.sshd.client.config.keys.ClientIdentityLoader;
 import org.apache.sshd.common.NamedResource;
 import org.apache.sshd.common.config.keys.FilePasswordProvider;
 import org.argeo.api.cli.CommandArgsException;
@@ -84,7 +82,7 @@ public class SshShell implements DescribedCommand<String> {
                                                return keyPath;
                                        }
                                };
-                               KeyPair keyPair = ClientIdentityLoader.DEFAULT
+                               KeyPair keyPair = new DefaultClientIdentityLoader()
                                                .loadClientIdentities(null, namedResource, FilePasswordProvider.of(new String(keyPassword)))
                                                .iterator().next();
                                sshAgent.addIdentity(keyPair, "NO COMMENT");