test ed25519 public key
This commit is contained in:
parent
6a8226af8c
commit
1af5f2c928
1 changed files with 2 additions and 1 deletions
|
@ -39,7 +39,7 @@ public class SFTPFileSystemTest {
|
|||
env.put("username", "joerg");
|
||||
URI uri = URI.create("sftp://xbib.org");
|
||||
SshClient sshClient = ClientBuilder.builder().build();
|
||||
Path privateKey = Paths.get("/Users/joerg/.ssh/id_ed25519");
|
||||
Path privateKey = Paths.get(System.getProperty("user.home") + "/.ssh/id_ed25519");
|
||||
KeyPairProvider keyPairProvider = new FileKeyPairProvider(privateKey);
|
||||
keyPairProvider.loadKeys(null).forEach(sshClient::addPublicKeyIdentity);
|
||||
for (String keyType : keyPairProvider.getKeyTypes(null)) {
|
||||
|
@ -50,6 +50,7 @@ public class SFTPFileSystemTest {
|
|||
sshClient.setNioWorkers(1);
|
||||
sshClient.start();
|
||||
SftpFileSystem fileSystem = new SftpFileSystemProvider(sshClient).newFileSystem(uri, env);
|
||||
fileSystem.close();
|
||||
// ...
|
||||
sshClient.stop();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue