Logo Search packages:      
Sourcecode: jenkins-trilead-ssh2 version File versions  Download package

synchronized boolean com::trilead::ssh2::Connection::authenticateWithDSA ( String  user,
String  pem,
String  password 
) throws IOException [inline]

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).

Parameters:
userA String holding the username.
pemA 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.
passwordIf 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 null.
Returns:
whether the connection is now authenticated.
Exceptions:
IOException
Deprecated:
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!");

            if (authenticated)
                  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());

            return authenticated;
      }

Generated by  Doxygen 1.6.0   Back to index