After a successful connect, one has to authenticate oneself. This method is based on DSA (it uses DSA to sign a challenge sent by the server).
If the authentication phase is complete,
true will be returned. If the server does not accept the request (or if further authentication steps are needed),
false is returned and one can retry either by using this or any other authentication method (use the
getRemainingAuthMethods method to get a list of the remaining possible methods).
String holding the username.
String containing the DSA private key of the user in OpenSSH key format (PEM, you can't miss the "-----BEGIN DSA PRIVATE KEY-----" tag). The string may contain linefeeds.
|password||If the PEM string is 3DES encrypted ("DES-EDE3-CBC"), then you must specify the password. Otherwise, this argument will be ignored and can be set to |
- whether the connection is now authenticated.
- You should use one of the authenticateWithPublicKey() methods, this method is just a wrapper for it and will disappear in future builds.
Definition at line 167 of file Connection.java.
if (tm == null)
throw new IllegalStateException("Connection is not established!");
throw new IllegalStateException("Connection is already authenticated!");
if (am == null)
am = new AuthenticationManager(tm);
if (cm == null)
cm = new ChannelManager(tm);
if (user == null)
throw new IllegalArgumentException("user argument is null");
if (pem == null)
throw new IllegalArgumentException("pem argument is null");
authenticated = am.authenticatePublicKey(user, pem.toCharArray(), password, getOrCreateSecureRND());