aboutsummaryrefslogtreecommitdiffstats
path: root/lib/src/main/java/com/trilead/ssh2/Connection.java
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src/main/java/com/trilead/ssh2/Connection.java')
-rw-r--r--lib/src/main/java/com/trilead/ssh2/Connection.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/src/main/java/com/trilead/ssh2/Connection.java b/lib/src/main/java/com/trilead/ssh2/Connection.java
index 98e5fdd..c1e8711 100644
--- a/lib/src/main/java/com/trilead/ssh2/Connection.java
+++ b/lib/src/main/java/com/trilead/ssh2/Connection.java
@@ -7,7 +7,10 @@ import java.io.FileReader;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketTimeoutException;
+import java.security.KeyPair;
import java.security.SecureRandom;
+import java.security.Security;
+import java.util.Set;
import java.util.Vector;
import com.trilead.ssh2.auth.AuthenticationManager;
@@ -473,7 +476,7 @@ public class Connection
* @return whether the connection is now authenticated.
* @throws IOException
*/
- public synchronized boolean authenticateWithPublicKey(String user, Object key)
+ public synchronized boolean authenticateWithPublicKey(String user, KeyPair pair)
throws IOException
{
if (tm == null)
@@ -491,10 +494,10 @@ public class Connection
if (user == null)
throw new IllegalArgumentException("user argument is null");
- if (key == null)
- throw new IllegalArgumentException("Key argument is null");
+ if (pair == null)
+ throw new IllegalArgumentException("Key pair argument is null");
- authenticated = am.authenticatePublicKey(user, key, getOrCreateSecureRND());
+ authenticated = am.authenticatePublicKey(user, pair, getOrCreateSecureRND());
return authenticated;
}