Exemplo n.º 1
0
 /// <summary>
 /// Constructs the string with the command line parameters
 /// related to authentication
 /// </summary>
 /// <param name="auth">authentication parameters</param>
 /// <returns>The command line parameters</returns>
 internal static string GetAuthenticationParameters(SSHAuthentication auth)
 {
     switch (auth.AuthType)
     {
         case SSHAuthenticationType.UserNamePassword: return string.Format("-l {0} -pw \"{1}\"", auth.User, auth.Key);
         case SSHAuthenticationType.PrivateKey: return string.Format("-l {0} -i \"{1}\"", auth.User, auth.PrivateKeyFileLocation);
         default: throw new NotImplementedException("Unknown authentication type");
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Constructs the string with the command line parameters
        /// related to authentication
        /// </summary>
        /// <param name="auth">authentication parameters</param>
        /// <returns>The command line parameters</returns>
        internal static string GetAuthenticationParameters(SSHAuthentication auth)
        {
            switch (auth.AuthType)
            {
            case SSHAuthenticationType.UserNamePassword: return(string.Format("-l {0} -pw \"{1}\"", auth.User, auth.Key));

            case SSHAuthenticationType.PrivateKey: return(string.Format("-l {0} -i \"{1}\"", auth.User, auth.PrivateKeyFileLocation));

            default: throw new NotImplementedException("Unknown authentication type");
            }
        }