mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-08 16:18:05 +03:00
.
This commit is contained in:
@@ -476,8 +476,8 @@ public class SSHClient
|
|||||||
throws IOException {
|
throws IOException {
|
||||||
final File loc = new File(location);
|
final File loc = new File(location);
|
||||||
final FileKeyProvider.Format format = KeyProviderUtil.detectKeyFileFormat(loc);
|
final FileKeyProvider.Format format = KeyProviderUtil.detectKeyFileFormat(loc);
|
||||||
final FileKeyProvider fkp = Factory.Named.Util.create(trans.getConfig().getFileKeyProviderFactories(), format
|
final FileKeyProvider fkp =
|
||||||
.toString());
|
Factory.Named.Util.create(trans.getConfig().getFileKeyProviderFactories(), format.toString());
|
||||||
if (fkp == null)
|
if (fkp == null)
|
||||||
throw new SSHException("No provider available for " + format + " key file");
|
throw new SSHException("No provider available for " + format + " key file");
|
||||||
fkp.init(loc, passwordFinder);
|
fkp.init(loc, passwordFinder);
|
||||||
@@ -520,8 +520,8 @@ public class SSHClient
|
|||||||
public KeyProvider loadKeys(String privateKey, String publicKey, PasswordFinder passwordFinder)
|
public KeyProvider loadKeys(String privateKey, String publicKey, PasswordFinder passwordFinder)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
final FileKeyProvider.Format format = KeyProviderUtil.detectKeyFileFormat(privateKey, publicKey != null);
|
final FileKeyProvider.Format format = KeyProviderUtil.detectKeyFileFormat(privateKey, publicKey != null);
|
||||||
final FileKeyProvider fkp = Factory.Named.Util.create(trans.getConfig().getFileKeyProviderFactories(), format
|
final FileKeyProvider fkp =
|
||||||
.toString());
|
Factory.Named.Util.create(trans.getConfig().getFileKeyProviderFactories(), format.toString());
|
||||||
if (fkp == null)
|
if (fkp == null)
|
||||||
throw new SSHException("No provider available for " + format + " key file");
|
throw new SSHException("No provider available for " + format + " key file");
|
||||||
fkp.init(privateKey, publicKey, passwordFinder);
|
fkp.init(privateKey, publicKey, passwordFinder);
|
||||||
|
|||||||
Reference in New Issue
Block a user