| | |
| | | import java.security.KeyPair; |
| | | import java.security.KeyPairGenerator; |
| | | import java.security.PublicKey; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | |
| | | import org.apache.sshd.ClientChannel; |
| | | import org.apache.sshd.ClientSession; |
| | | import org.apache.sshd.SshClient; |
| | | import org.apache.sshd.client.ServerKeyVerifier; |
| | | import org.apache.sshd.common.NamedFactory; |
| | | import org.apache.sshd.common.util.SecurityUtils; |
| | | import org.apache.sshd.client.UserAuth; |
| | | import org.apache.sshd.client.auth.UserAuthPublicKey; |
| | | import org.junit.After; |
| | | import org.junit.AfterClass; |
| | | import org.junit.Before; |
| | |
| | | return true; |
| | | } |
| | | }); |
| | | List<NamedFactory<UserAuth>> userAuthFactories = new ArrayList<>(); |
| | | userAuthFactories.add(new UserAuthPublicKey.Factory()); |
| | | client.setUserAuthFactories(userAuthFactories); |
| | | client.start(); |
| | | return client; |
| | | } |