From b4261695b2687ed43821ada65abe14d87604ba74 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Wed, 21 Nov 2007 22:31:46 +0000 Subject: Added preferences, touch entropy, fixes to SoftFont. --- .../main/java/com/trilead/ssh2/auth/AuthenticationManager.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/src/main/java/com/trilead/ssh2') diff --git a/lib/src/main/java/com/trilead/ssh2/auth/AuthenticationManager.java b/lib/src/main/java/com/trilead/ssh2/auth/AuthenticationManager.java index 894a31f..99d62ca 100644 --- a/lib/src/main/java/com/trilead/ssh2/auth/AuthenticationManager.java +++ b/lib/src/main/java/com/trilead/ssh2/auth/AuthenticationManager.java @@ -160,6 +160,14 @@ public class AuthenticationManager implements MessageHandler public boolean authenticatePublicKey(String user, char[] PEMPrivateKey, String password, SecureRandom rnd) throws IOException + { + Object key = PEMDecoder.decode(PEMPrivateKey, password); + + return authenticatePublicKey(user, key, rnd); + } + + public boolean authenticatePublicKey(String user, Object key, SecureRandom rnd) + throws IOException { try { @@ -168,8 +176,6 @@ public class AuthenticationManager implements MessageHandler if (methodPossible("publickey") == false) throw new IOException("Authentication method publickey not supported by the server at this stage."); - Object key = PEMDecoder.decode(PEMPrivateKey, password); - if (key instanceof DSAPrivateKey) { DSAPrivateKey pk = (DSAPrivateKey) key; -- cgit v1.2.3