diff --git a/ProxySU/MainWindow.xaml b/ProxySU/MainWindow.xaml index a43b939..f1e2a15 100644 --- a/ProxySU/MainWindow.xaml +++ b/ProxySU/MainWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:ProxySU" mc:Ignorable="d" - Title="ProxySU - v2.4.10" Height="675" Width="650"> + Title="ProxySU - v2.4.11" Height="675" Width="650"> @@ -665,6 +665,8 @@ + + diff --git a/ProxySU/MainWindow.xaml.cs b/ProxySU/MainWindow.xaml.cs index d3c1e7c..60653f1 100644 --- a/ProxySU/MainWindow.xaml.cs +++ b/ProxySU/MainWindow.xaml.cs @@ -268,21 +268,7 @@ namespace ProxySU } } - //判断目录是否存在,不存在则创建 - private static bool CheckDir(string folder) - { - try - { - if (!Directory.Exists(folder))//如果不存在就创建file文件夹 - Directory.CreateDirectory(folder);//创建该文件夹   - return true; - } - catch (Exception) - { - return false; - } - } - + //更新新版本提醒显示 Action updateNewVersionProxySUAction = new Action(UpdateNewVersionProxySU); private static void UpdateNewVersionProxySU(TextBlock TextBlockLastVersionProxySU, TextBlock TextBlockNewVersionReminder, Button ButtonUpgradeProxySU, string theLatestVersion) @@ -5011,6 +4997,50 @@ namespace ProxySU return random.Next(10001, 60000); } + //判断目录是否存在,不存在则创建 + private static bool CheckDir(string folder) + { + try + { + if (!Directory.Exists(folder))//如果不存在就创建file文件夹 + Directory.CreateDirectory(folder);//创建该文件夹   + return true; + } + catch (Exception) + { + return false; + } + } + + //目录已存在则生成序号递增,并返回所创建的目录路径。 + private string CreateConfigSaveDir(string upperDir, string configDir) + { + try + { + //string saveFileFolderFirst = configDir; + int num = 1; + //string saveFileFolder; + //saveFileFolder = EncodeURIComponent(configDir); + string saveFileFolder = configDir.Replace(":", "_"); + CheckDir(upperDir); + while (Directory.Exists(upperDir + @"\" + saveFileFolder) == true) + { + saveFileFolder = configDir + "_copy_" + num.ToString(); + num++; + } + CheckDir(upperDir + @"\" + saveFileFolder); + return upperDir + @"\" + saveFileFolder; + } + catch (Exception) + { + //string saveFileFolder = ""; + //return upperDir + @"\" + saveFileFolder; + return upperDir; + } + + } + + //上传配置文件 private void UploadConfig(ConnectionInfo connectionInfo, string uploadConfig, string upLoadPath) { @@ -5035,15 +5065,15 @@ namespace ProxySU } //下载配置文件 - private void DownloadConfig(ConnectionInfo connectionInfo, string downloadConfig, string downloadPath) + private void DownloadConfig(ConnectionInfo connectionInfo, string localConfigSavePathAndFileName, string remoteConfigPathAndFileName) { try { using (var sftpClient = new SftpClient(connectionInfo)) { sftpClient.Connect(); - FileStream createDownloadConfig = File.Open(downloadConfig, FileMode.Create); - sftpClient.DownloadFile(downloadPath, createDownloadConfig); + FileStream createDownloadConfig = File.Open(localConfigSavePathAndFileName, FileMode.Create); + sftpClient.DownloadFile(remoteConfigPathAndFileName, createDownloadConfig); createDownloadConfig.Close(); sftpClient.Disconnect(); @@ -8361,6 +8391,7 @@ namespace ProxySU } ReceiveConfigurationParameters[4] = TextBoxHost.Text;//传递主机地址 + ReceiveConfigurationParameters[2] = PasswordBoxHostPassword.Password;//传递当前账户密码 installationDegree = 0; TextBoxMonitorCommandResults.Text = ""; @@ -8443,7 +8474,7 @@ namespace ProxySU } SetUpProgressBarProcessing(10); - string hostPassword = "'" + PasswordBoxHostPassword.Password + "'"; + string hostPassword = "'" + ReceiveConfigurationParameters[2] + "'"; //MessageBox.Show(hostPassword); sshShellCommand = $"echo {hostPassword} | sudo -S id -u"; //MessageBox.Show(sshShellCommand); @@ -8499,6 +8530,10 @@ namespace ProxySU client.Disconnect(); + //***保存密码信息*** + currentStatus = Application.Current.FindResource("DisplayInstallInfo_EnableRootPasswordSavePasswordInfo").ToString(); + MainWindowsShowInfo(currentStatus); + string filePath = ReceiveConfigurationParameters[4].Replace(':', '_'); CheckDir(filePath); using (StreamWriter sw = new StreamWriter($"{filePath}\\host_password_info.txt")) @@ -8531,6 +8566,482 @@ namespace ProxySU } #endregion + + #region 启用Root证书密钥登录 + private void ButtonEnableRootCert_Click(object sender, RoutedEventArgs e) + { + //******"本功能需要当前登录的账户具有root或者sudo权限,是否为远程主机启用root证书密钥登录?"****** + string messageShow = Application.Current.FindResource("MessageBoxShow_ButtonEnableRootCert").ToString(); + MessageBoxResult messageBoxResult = MessageBox.Show(messageShow, "", MessageBoxButton.YesNo, MessageBoxImage.Question); + if (messageBoxResult == MessageBoxResult.Yes) + { + ConnectionInfo connectionInfo = GenerateConnectionInfo(); + if (connectionInfo == null) + { + //****** "远程主机连接信息有误,请检查!" ****** + MessageBox.Show(Application.Current.FindResource("MessageBoxShow_ErrorHostConnection").ToString()); + return; + } + + ReceiveConfigurationParameters[4] = TextBoxHost.Text;//传递主机地址 + ReceiveConfigurationParameters[2] = PasswordBoxHostPassword.Password; + + installationDegree = 0; + TextBoxMonitorCommandResults.Text = ""; + Thread thread = new Thread(() => EnableRootCert(connectionInfo)); + thread.SetApartmentState(ApartmentState.STA); + thread.Start(); + } + } + + //启用Root证书密钥登录进程 + private void EnableRootCert(ConnectionInfo connectionInfo) + { + functionResult = true; + getApt = false; + getDnf = false; + getYum = false; + onlyIpv6 = false; + + string filePath = String.Empty; + + //******"正在登录远程主机......"****** + SetUpProgressBarProcessing(1); + string currentStatus = Application.Current.FindResource("DisplayInstallInfo_Login").ToString(); + MainWindowsShowInfo(currentStatus); + + try + { + #region 主机指纹,暂未启用 + //byte[] expectedFingerPrint = new byte[] { + // 0x66, 0x31, 0xaf, 0x00, 0x54, 0xb9, 0x87, 0x31, + // 0xff, 0x58, 0x1c, 0x31, 0xb1, 0xa2, 0x4c, 0x6b + // }; + #endregion + using (var client = new SshClient(connectionInfo)) + + { + #region ssh登录验证主机指纹代码块,暂未启用 + // client.HostKeyReceived += (sender, e) => + // { + // if (expectedFingerPrint.Length == e.FingerPrint.Length) + // { + // for (var i = 0; i < expectedFingerPrint.Length; i++) + // { + // if (expectedFingerPrint[i] != e.FingerPrint[i]) + // { + // e.CanTrust = false; + // break; + // } + // } + // } + // else + // { + // e.CanTrust = false; + // } + // }; + #endregion + + client.Connect(); + if (client.IsConnected == true) + { + //******"主机登录成功"****** + SetUpProgressBarProcessing(5); + currentStatus = Application.Current.FindResource("DisplayInstallInfo_LoginSuccessful").ToString(); + MainWindowsShowInfo(currentStatus); + } + + //检测root权限 5--7 + //******"检测是否运行在root权限下..."******01 + SetUpProgressBarProcessing(5); + currentStatus = Application.Current.FindResource("DisplayInstallInfo_DetectionRootPermission").ToString(); + MainWindowsShowInfo(currentStatus); + + sshShellCommand = @"id -u"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + if (currentShellCommandResult.TrimEnd('\r', '\n').Equals("0") == true) + { + SetUpProgressBarProcessing(20); + + //***正在生成密钥......*** + currentStatus = Application.Current.FindResource("DisplayInstallInfo_EnableRootCertGenerateCert").ToString(); + MainWindowsShowInfo(currentStatus); + + sshShellCommand = @"rm -rf /tmp/rootuser.key /tmp/rootuser.key.pub"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"yes | ssh-keygen -b 2048 -t rsa -f /tmp/rootuser.key -q -N ''"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"yes | ssh-keygen -p -P '' -N '' -m PEM -f /tmp/rootuser.key"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"mkdir -p /root/.ssh"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"cat /tmp/rootuser.key.pub | tee -a /root/.ssh/authorized_keys"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"chmod 777 /tmp/rootuser.key"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + SetUpProgressBarProcessing(30); + //***正在下载密钥......*** + currentStatus = Application.Current.FindResource("DisplayInstallInfo_EnableRootCertDownloadCert").ToString(); + MainWindowsShowInfo(currentStatus); + + filePath = CreateConfigSaveDir(@"root_cert", ReceiveConfigurationParameters[4].Replace(':', '_')); + string localConfigSavePathAndFileName = $"{filePath}\\rootuser.key"; + string remoteConfigPathAndFileName = @"/tmp/rootuser.key"; + DownloadConfig(connectionInfo, localConfigSavePathAndFileName, remoteConfigPathAndFileName); + + localConfigSavePathAndFileName = $"{filePath}\\rootuser.key.pub"; + remoteConfigPathAndFileName = @"/tmp/rootuser.key.pub"; + DownloadConfig(connectionInfo, localConfigSavePathAndFileName, remoteConfigPathAndFileName); + + sshShellCommand = @"rm -rf /tmp/rootuser.key /tmp/rootuser.key.pub"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + SetUpProgressBarProcessing(50); + //***远程主机启用密钥登录......*** + currentStatus = Application.Current.FindResource("DisplayInstallInfo_EnableRootCertSetCertEnable").ToString(); + MainWindowsShowInfo(currentStatus); + + sshShellCommand = @"sed -i 's/PermitRootLogin /#PermitRootLogin /g' /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"sed -i 's/StrictModes /#StrictModes /g' /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + SetUpProgressBarProcessing(70); + sshShellCommand = @"sed -i 's/PubkeyAuthentication /#PubkeyAuthentication /g' /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"sed -i 's/#AuthorizedKeysFile /AuthorizedKeysFile /g' /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + SetUpProgressBarProcessing(80); + sshShellCommand = @"sed -i 's/#RSAAuthentication /RSAAuthentication /g' /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"echo 'PermitRootLogin yes' | tee -a /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + SetUpProgressBarProcessing(90); + sshShellCommand = @"echo 'StrictModes no' | tee -a /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"echo 'PubkeyAuthentication yes' | tee -a /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"systemctl restart sshd"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + } + else + { + SetUpProgressBarProcessing(10); + string hostPassword = "'" + ReceiveConfigurationParameters[2] + "'"; + //MessageBox.Show(hostPassword); + sshShellCommand = $"echo {hostPassword} | sudo -S id -u"; + //MessageBox.Show(sshShellCommand); + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + //MessageBox.Show(currentShellCommandResult); + if (currentShellCommandResult.TrimEnd('\r', '\n').Equals("0") == false) + { + //******"当前账户无法获取sudo权限,设置失败!"****** + currentStatus = Application.Current.FindResource("MessageBoxShow_NoSudoToAccount").ToString(); + MainWindowsShowInfo(currentStatus); + MessageBox.Show(currentStatus); + client.Disconnect(); + return; + } + + SetUpProgressBarProcessing(20); + string cmdPre = $"echo {hostPassword} | sudo -S id -u" + ';'; + //***正在生成密钥......*** + currentStatus = Application.Current.FindResource("DisplayInstallInfo_EnableRootCertGenerateCert").ToString(); + MainWindowsShowInfo(currentStatus); + + sshShellCommand = cmdPre + @"sudo rm -rf /tmp/rootuser.key /tmp/rootuser.key.pub"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = cmdPre + @"yes | sudo ssh-keygen -b 2048 -t rsa -f /tmp/rootuser.key -q -N ''"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = cmdPre + @"yes | sudo ssh-keygen -p -P '' -N '' -m PEM -f /tmp/rootuser.key"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = cmdPre + @"sudo mkdir -p /root/.ssh"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = cmdPre + @"cat /tmp/rootuser.key.pub | sudo tee -a /root/.ssh/authorized_keys"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = cmdPre + @"sudo chmod 777 /tmp/rootuser.key"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + SetUpProgressBarProcessing(30); + //***正在下载密钥......*** + currentStatus = Application.Current.FindResource("DisplayInstallInfo_EnableRootCertDownloadCert").ToString(); + MainWindowsShowInfo(currentStatus); + + filePath = CreateConfigSaveDir(@"root_cert", ReceiveConfigurationParameters[4].Replace(':', '_')); + string localConfigSavePathAndFileName = $"{filePath}\\rootuser.key"; + string remoteConfigPathAndFileName = @"/tmp/rootuser.key"; + DownloadConfig(connectionInfo, localConfigSavePathAndFileName, remoteConfigPathAndFileName); + + localConfigSavePathAndFileName = $"{filePath}\\rootuser.key.pub"; + remoteConfigPathAndFileName = @"/tmp/rootuser.key.pub"; + DownloadConfig(connectionInfo, localConfigSavePathAndFileName, remoteConfigPathAndFileName); + + sshShellCommand = cmdPre + @"sudo rm -rf /tmp/rootuser.key /tmp/rootuser.key.pub"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + SetUpProgressBarProcessing(50); + //***远程主机启用密钥登录......*** + currentStatus = Application.Current.FindResource("DisplayInstallInfo_EnableRootCertSetCertEnable").ToString(); + MainWindowsShowInfo(currentStatus); + + //string cmdPre = $"echo {hostPassword} | sudo -S id -u" + ';'; + sshShellCommand = cmdPre + @"sudo sed -i 's/PermitRootLogin /#PermitRootLogin /g' /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = cmdPre + @"sudo sed -i 's/StrictModes /#StrictModes /g' /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + SetUpProgressBarProcessing(70); + sshShellCommand = cmdPre + @"sudo sed -i 's/PubkeyAuthentication /#PubkeyAuthentication /g' /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = cmdPre + @"sudo sed -i 's/#AuthorizedKeysFile /AuthorizedKeysFile /g' /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + SetUpProgressBarProcessing(80); + sshShellCommand = cmdPre + @"sudo sed -i 's/#RSAAuthentication /RSAAuthentication /g' /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = cmdPre + @"echo 'PermitRootLogin yes' | sudo tee -a /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + SetUpProgressBarProcessing(90); + sshShellCommand = cmdPre + @"echo 'StrictModes no' | sudo tee -a /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = cmdPre + @"echo 'PubkeyAuthentication yes' | sudo tee -a /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = cmdPre + @"sudo systemctl restart sshd"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + } + client.Disconnect(); + + SetUpProgressBarProcessing(100); + //******"远程主机root账户证书密钥登录已启用,密钥文件rootuser.key保存在随后打开的文件夹中!"****** + currentStatus = Application.Current.FindResource("MessageBoxShow_ButtonEnableRootCertSuccess").ToString(); + MainWindowsShowInfo(currentStatus); + MessageBox.Show(currentStatus); + System.Diagnostics.Process.Start("explorer.exe", filePath); + + return; + } + } + catch (Exception ex1)//例外处理 + #region 例外处理 + { + ProcessException(ex1.Message); + + //****** "主机登录失败!" ****** + currentStatus = Application.Current.FindResource("DisplayInstallInfo_LoginFailed").ToString(); + MainWindowsShowInfo(currentStatus); + } + #endregion + + } + + + #endregion + + //root禁止密码登录 + private void ButtonRootProhibitsPasswordLogin_Click(object sender, RoutedEventArgs e) + { + //******"本功能需要远程主机已经开启了其他登录方式,如密钥方式等,否则将可能造成远程主机无法连接,是否禁止远程主机的root账户密码登录方式?"****** + string messageShow = Application.Current.FindResource("MessageBoxShow_ButtonRootProhibitsPasswordLogin").ToString(); + MessageBoxResult messageBoxResult = MessageBox.Show(messageShow, "", MessageBoxButton.YesNo, MessageBoxImage.Question); + if (messageBoxResult == MessageBoxResult.Yes) + { + ConnectionInfo connectionInfo = GenerateConnectionInfo(); + if (connectionInfo == null) + { + //****** "远程主机连接信息有误,请检查!" ****** + MessageBox.Show(Application.Current.FindResource("MessageBoxShow_ErrorHostConnection").ToString()); + return; + } + + ReceiveConfigurationParameters[4] = TextBoxHost.Text;//传递主机地址 + ReceiveConfigurationParameters[2] = PasswordBoxHostPassword.Password;//传递主机密码 + + installationDegree = 0; + TextBoxMonitorCommandResults.Text = ""; + Thread thread = new Thread(() => RootProhibitsPasswordLogin(connectionInfo)); + thread.SetApartmentState(ApartmentState.STA); + thread.Start(); + } + } + + //禁止root密码登录进程 + private void RootProhibitsPasswordLogin(ConnectionInfo connectionInfo) + { + functionResult = true; + getApt = false; + getDnf = false; + getYum = false; + onlyIpv6 = false; + + string filePath = String.Empty; + + //******"正在登录远程主机......"****** + SetUpProgressBarProcessing(1); + string currentStatus = Application.Current.FindResource("DisplayInstallInfo_Login").ToString(); + MainWindowsShowInfo(currentStatus); + + try + { + #region 主机指纹,暂未启用 + //byte[] expectedFingerPrint = new byte[] { + // 0x66, 0x31, 0xaf, 0x00, 0x54, 0xb9, 0x87, 0x31, + // 0xff, 0x58, 0x1c, 0x31, 0xb1, 0xa2, 0x4c, 0x6b + // }; + #endregion + using (var client = new SshClient(connectionInfo)) + + { + #region ssh登录验证主机指纹代码块,暂未启用 + // client.HostKeyReceived += (sender, e) => + // { + // if (expectedFingerPrint.Length == e.FingerPrint.Length) + // { + // for (var i = 0; i < expectedFingerPrint.Length; i++) + // { + // if (expectedFingerPrint[i] != e.FingerPrint[i]) + // { + // e.CanTrust = false; + // break; + // } + // } + // } + // else + // { + // e.CanTrust = false; + // } + // }; + #endregion + + client.Connect(); + if (client.IsConnected == true) + { + //******"主机登录成功"****** + SetUpProgressBarProcessing(5); + currentStatus = Application.Current.FindResource("DisplayInstallInfo_LoginSuccessful").ToString(); + MainWindowsShowInfo(currentStatus); + } + + //检测root权限 5--7 + //******"检测是否运行在root权限下..."******01 + SetUpProgressBarProcessing(5); + currentStatus = Application.Current.FindResource("DisplayInstallInfo_DetectionRootPermission").ToString(); + MainWindowsShowInfo(currentStatus); + + sshShellCommand = @"id -u"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + if (currentShellCommandResult.TrimEnd('\r', '\n').Equals("0") == true) + { + SetUpProgressBarProcessing(20); + + //***正在关闭root账户密码登录方式......*** + currentStatus = Application.Current.FindResource("DisplayInstallInfo_SetRootProhibitsPasswordLogin").ToString(); + MainWindowsShowInfo(currentStatus); + + sshShellCommand = @"sed -i 's/PasswordAuthentication /#PasswordAuthentication /g' /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"sed -i 's/PermitEmptyPasswords /#PermitEmptyPasswords /g' /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"echo 'PasswordAuthentication no' | tee -a /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"echo 'PermitEmptyPasswords no' | tee -a /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = @"systemctl restart sshd"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + } + else + { + SetUpProgressBarProcessing(10); + string hostPassword = "'" + ReceiveConfigurationParameters[2] + "'"; + //MessageBox.Show(hostPassword); + sshShellCommand = $"echo {hostPassword} | sudo -S id -u"; + //MessageBox.Show(sshShellCommand); + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + //MessageBox.Show(currentShellCommandResult); + if (currentShellCommandResult.TrimEnd('\r', '\n').Equals("0") == false) + { + //******"当前账户无法获取sudo权限,设置失败!"****** + currentStatus = Application.Current.FindResource("MessageBoxShow_NoSudoToAccount").ToString(); + MainWindowsShowInfo(currentStatus); + MessageBox.Show(currentStatus); + client.Disconnect(); + return; + } + + SetUpProgressBarProcessing(20); + string cmdPre = $"echo {hostPassword} | sudo -S id -u" + ';'; + + //***正在关闭root账户密码登录方式......*** + currentStatus = Application.Current.FindResource("DisplayInstallInfo_SetRootProhibitsPasswordLogin").ToString(); + MainWindowsShowInfo(currentStatus); + + sshShellCommand = cmdPre + @"sudo sed -i 's/PasswordAuthentication /#PasswordAuthentication /g' /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = cmdPre + @"sudo sed -i 's/PermitEmptyPasswords /#PermitEmptyPasswords /g' /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = cmdPre + @"echo 'PasswordAuthentication no' | sudo tee -a /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = cmdPre + @"echo 'PermitEmptyPasswords no' | sudo tee -a /etc/ssh/sshd_config"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + sshShellCommand = cmdPre + @"sudo systemctl restart sshd"; + currentShellCommandResult = MainWindowsShowCmd(client, sshShellCommand); + + } + client.Disconnect(); + + SetUpProgressBarProcessing(100); + //******"远程主机root账户密码登录方式已关闭!"****** + currentStatus = Application.Current.FindResource("MessageBoxShow_RootProhibitsPasswordLoginOK").ToString(); + MainWindowsShowInfo(currentStatus); + MessageBox.Show(currentStatus); + + return; + } + } + catch (Exception ex1)//例外处理 + #region 例外处理 + { + ProcessException(ex1.Message); + + //****** "主机登录失败!" ****** + currentStatus = Application.Current.FindResource("DisplayInstallInfo_LoginFailed").ToString(); + MainWindowsShowInfo(currentStatus); + } + #endregion + } } } diff --git a/ProxySU/Properties/AssemblyInfo.cs b/ProxySU/Properties/AssemblyInfo.cs index b5e86b5..0234378 100644 --- a/ProxySU/Properties/AssemblyInfo.cs +++ b/ProxySU/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Windows; // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.4.10.0")] -[assembly: AssemblyFileVersion("2.4.10.0")] +[assembly: AssemblyVersion("2.4.11.0")] +[assembly: AssemblyFileVersion("2.4.11.0")] diff --git a/ProxySU/Translations/ProxySU.en-US.xaml b/ProxySU/Translations/ProxySU.en-US.xaml index 9c2fea1..1c13f9b 100644 --- a/ProxySU/Translations/ProxySU.en-US.xaml +++ b/ProxySU/Translations/ProxySU.en-US.xaml @@ -64,6 +64,7 @@ Making domain name: Recommended https ports 443, 2053, 2083, 2087, 2096, 8443 The secret key will be randomly generated by the server. + SS install SS plug-in library @@ -93,16 +94,29 @@ Plugin program: Plugin options: Use the compilation method, it will take a little longer, please be patient... + Proofreading Time Release 80/443 Enable BBR Uninstall Proxy + Enable Root password login + root prohibits password login + Enable Root certificate key login Only the proxy software installed by ProxySU and related configurations are supported. Please make sure that important configurations have been backed up. Uninstalling agents installed using other methods or scripts is not supported. Are you sure you want to uninstall the agent software on the remote host? This function requires that the currently logged-in account has sudo permissions. Is the root account enabled and password set for the remote host? + This function requires that the currently logged-in account has root or sudo authority. Is root certificate key login enabled for the remote host? + This function requires that the remote host has enabled other login methods, such as key mode, etc., otherwise the remote host may not be able to connect. Is the root account password login method of the remote host prohibited? + is closing the root account password login method..... + The remote host root account password login method is closed! + The root account certificate key login of the remote host has been enabled, and the key file rootuser.key is saved in the subsequent opened folder! The current account already has root privileges, no need to set it up! The current account cannot obtain sudo permission, the setting failed! Generate a 20-digit random password! + Save password information! + Generating a key... + The key is being downloaded... + The remote host enables key login....... The remote host Root account password login is enabled, and the password is saved in the folder opened afterwards! Start uninstall...... Detected installed diff --git a/ProxySU/Translations/ProxySU.zh-CN.xaml b/ProxySU/Translations/ProxySU.zh-CN.xaml index 84848cf..5a7acc8 100644 --- a/ProxySU/Translations/ProxySU.zh-CN.xaml +++ b/ProxySU/Translations/ProxySU.zh-CN.xaml @@ -101,11 +101,22 @@ 启用BBR 卸载代理 启用Root密码登录 + 启用Root证书密钥登录 + root禁止密码登录 仅支持卸载由ProxySU安装的代理软件及相关配置,请确保重要配置已备份。不支持卸载使用其他方法或脚本安装的代理。确定要卸载远程主机上的代理软件吗? 本功能需要当前登录的账户具有sudo权限,是否为远程主机启用root账户并设置密码? + 本功能需要当前登录的账户具有root或者sudo权限,是否为远程主机启用root证书密钥登录? + 本功能需要远程主机已经开启了其他登录方式,如密钥方式等,否则将可能造成远程主机无法连接,是否禁止远程主机的root账户密码登录方式? + 正在关闭root账户密码登录方式..... + 远程主机root账户密码登录方式已关闭! + 远程主机root账户证书密钥登录已启用,密钥文件rootuser.key保存在随后打开的文件夹中! 当前账户已经具有root权限,无需再设置! 当前账户无法获取sudo权限,设置失败! 生成20位随机密码! + 保存密码信息! + 正在生成密钥...... + 正在下载密钥...... + 远程主机启用密钥登录....... 远程主机Root账户密码登录已启用,密码保存在随后打开的文件夹中! 开始卸载 检测到已安装 diff --git a/ProxySU/Translations/ProxySU.zh-TW.xaml b/ProxySU/Translations/ProxySU.zh-TW.xaml index cb36320..697bd8e 100644 --- a/ProxySU/Translations/ProxySU.zh-TW.xaml +++ b/ProxySU/Translations/ProxySU.zh-TW.xaml @@ -100,11 +100,23 @@ 釋放80/443端口 啟用BBR 卸載代理 + 啟用Root密碼登錄 + root禁止密碼登錄 + 啟用Root證書密鑰登錄 僅支持卸載由ProxySU安裝的代理軟件及相關配置,請確保重要配置已備份。不支持卸載使用其他方法或腳本安裝的代理。確定要卸載遠程主機上的代理軟件嗎? 本功能需要當前登錄的賬戶具有sudo權限,是否為遠程主機啟用root賬戶並設置密碼? + 本功能需要當前登錄的賬戶具有root或者sudo權限,是否為遠程主機啟用root證書密鑰登錄? + 本功能需要遠程主機已經開啟了其他登錄方式,如密鑰方式等,否則將可能造成遠程主機無法連接,是否禁止遠程主機的root賬戶密碼登錄方式? + 正在關閉root賬戶密碼登錄方式..... + 遠程主機root賬戶密碼登錄方式已關閉! + 遠程主機root賬戶證書密鑰登錄已啟用,密鑰文件rootuser.key保存在隨後打開的文件夾中! 當前賬戶已經具有root權限,無需再設置! 當前賬戶無法獲取sudo權限,設置失敗! 生成20位隨機密碼! + 保存密碼信息! + 正在生成密鑰...... + 正在下載密鑰...... + 遠程主機啟用密鑰登錄....... 遠程主機Root賬戶密碼登錄已啟用,密碼保存在隨後打開的文件夾中! 開始卸載...... 檢測到已安裝 diff --git a/ProxySU/bin/Beta/Beta.zip b/ProxySU/bin/Beta/Beta.zip index 31ed79e..d2b310b 100644 Binary files a/ProxySU/bin/Beta/Beta.zip and b/ProxySU/bin/Beta/Beta.zip differ diff --git a/ssh.net/net40/README.md b/ssh.net/net40/README.md deleted file mode 100644 index 7bcb27b..0000000 --- a/ssh.net/net40/README.md +++ /dev/null @@ -1 +0,0 @@ -forked from https://github.com/sshnet/SSH.NET \ No newline at end of file diff --git a/ssh.net/net40/Renci.SshNet.dll b/ssh.net/net40/Renci.SshNet.dll index 4e2d603..dbfbb95 100644 Binary files a/ssh.net/net40/Renci.SshNet.dll and b/ssh.net/net40/Renci.SshNet.dll differ diff --git a/ssh.net/net40/Renci.SshNet.xml b/ssh.net/net40/Renci.SshNet.xml index 244078a..a60b08d 100644 --- a/ssh.net/net40/Renci.SshNet.xml +++ b/ssh.net/net40/Renci.SshNet.xml @@ -76,9 +76,27 @@ The value to send. The write failed. + + + Receives data from a bound . + + + The number of bytes to receive. + Specifies the amount of time after which the call will time out. + + The bytes received. + + + If no data is available for reading, the method will + block until data is available or the time-out value is exceeded. If the time-out value is exceeded, the + call will throw a . + If you are in non-blocking mode, and there is no data available in the in the protocol stack buffer, the + method will complete immediately and throw a . + + - Receives data from a bound into a receive buffer. + Receives data from a bound into a receive buffer. An array of type that is the storage location for the received data. @@ -90,7 +108,7 @@ If no data is available for reading, the method will - block until data is available or the time-out value was exceeded. If the time-out value was exceeded, the + block until data is available or the time-out value is exceeded. If the time-out value is exceeded, the call will throw a . If you are in non-blocking mode, and there is no data available in the in the protocol stack buffer, the method will complete immediately and throw a . @@ -357,314 +375,27 @@ the timer will not be started. - + - Represents SSH channel. + Creates a with the specified due time and interval. - - - - Occurs when is received. - - - - - Occurs when an exception is thrown when processing channel messages. - - - - - Occurs when is received. - - - - - Occurs when is received. - - - - - Occurs when is received. - - - - - Gets the local channel number. - - - The local channel number. - - - - - Gets the maximum size of a data packet that we can receive using the channel. - - - The maximum size of a packet. - - - - This is the maximum size (in bytes) we support for the data (payload) of a - SSH_MSG_CHANNEL_DATA message we receive. - - - We currently do not enforce this limit. - - - - - - Gets the maximum size of a data packet that can be sent using the channel. - - - The maximum size of data that can be sent using a - on the current channel. - - The channel has not been opened, or the open has not yet been confirmed. - - - - Gets a value indicating whether this channel is open. - - - true if this channel is open; otherwise, false. - - - - - Sends a SSH_MSG_CHANNEL_DATA message with the specified payload. - - The payload to send. - - - - Sends a SSH_MSG_CHANNEL_DATA message with the specified payload. - - An array of containing the payload to send. - The zero-based offset in at which to begin taking data from. - The number of bytes of to send. - - - When the size of the data to send exceeds the maximum packet size or the remote window - size does not allow the full data to be sent, then this method will send the data in - multiple chunks and will wait for the remote window size to be adjusted when it's zero. - - - This is done to support SSH servers will a small window size that do not agressively - increase their window size. We need to take into account that there may be SSH servers - that only increase their window size when it has reached zero. - - - - - - Sends a SSH_MSG_CHANNEL_EOF message to the remote server. - - The channel is closed. - - - - A "direct-tcpip" SSH channel. - - - - - Occurs when an exception is thrown while processing channel messages. - - - - - Gets a value indicating whether this channel is open. - - - true if this channel is open; otherwise, false. - - - - - Gets the local channel number. - - - The local channel number. - - - - - Opens a channel for a locally forwarded TCP/IP port. - - The name of the remote host to forward to. - The port of the remote hosts to forward to. - The forwarded port for which the channel is opened. - The socket to receive requests from, and send responses from the remote host to. - - - - Binds the channel to the remote host. - - - - - A "forwarded-tcpip" SSH channel. - - - - - Occurs when an exception is thrown while processing channel messages. - - - - - Binds the channel to the specified endpoint. - - The endpoint to connect to. - The forwarded port for which the channel is opened. - - - - Session SSH channel. - - - - - Opens the channel. - - - - - Sends the pseudo terminal request. - - The environment variable. - The columns. - The rows. - The width. - The height. - The terminal mode values. + The amount of time to delay before the keep-alive message is first sent. Specify negative one (-1) milliseconds to prevent the timer from starting. Specify zero (0) to start the timer immediately. + The time interval between attempts to send a keep-alive message. Specify negative one (-1) milliseconds to disable periodic signaling. - true if request was successful; otherwise false. + A with the specified due time and interval. - + - Sends the X11 forwarding request. + Disposes the SSH session, and assigns null to . - if set to true the it is single connection. - The protocol. - The cookie. - The screen number. - - true if request was successful; otherwise false. - - + - Sends the environment variable request. - - Name of the variable. - The variable value. - - true if request was successful; otherwise false. - - - - - Sends the shell request. + Returns a value indicating whether the SSH session is established. - true if request was successful; otherwise false. - - - - - Sends the exec request. - - The command. - - true if request was successful; otherwise false. - - - - - Sends the exec request. - - Length of the break. - - true if request was successful; otherwise false. - - - - - Sends the subsystem request. - - The subsystem. - - true if request was successful; otherwise false. - - - - - Sends the window change request. - - The columns. - The rows. - The width. - The height. - - true if request was successful; otherwise false. - - - - - Sends the local flow request. - - if set to true [client can do]. - - true if request was successful; otherwise false. - - - - - Sends the signal request. - - Name of the signal. - - true if request was successful; otherwise false. - - - - - Sends the exit status request. - - The exit status. - - true if request was successful; otherwise false. - - - - - Sends the exit signal request. - - Name of the signal. - if set to true [core dumped]. - The error message. - The language. - - true if request was successful; otherwise false. - - - - - Sends eow@openssh.com request. - - - true if request was successful; otherwise false. - - - - - Sends keepalive@openssh.com request. - - - true if request was successful; otherwise false. + true if the SSH session is established; otherwise, false. @@ -1497,6 +1228,316 @@ Does nothing when is null. + + + Represents SSH channel. + + + + + Occurs when is received. + + + + + Occurs when an exception is thrown when processing channel messages. + + + + + Occurs when is received. + + + + + Occurs when is received. + + + + + Occurs when is received. + + + + + Gets the local channel number. + + + The local channel number. + + + + + Gets the maximum size of a data packet that we can receive using the channel. + + + The maximum size of a packet. + + + + This is the maximum size (in bytes) we support for the data (payload) of a + SSH_MSG_CHANNEL_DATA message we receive. + + + We currently do not enforce this limit. + + + + + + Gets the maximum size of a data packet that can be sent using the channel. + + + The maximum size of data that can be sent using a + on the current channel. + + The channel has not been opened, or the open has not yet been confirmed. + + + + Gets a value indicating whether this channel is open. + + + true if this channel is open; otherwise, false. + + + + + Sends a SSH_MSG_CHANNEL_DATA message with the specified payload. + + The payload to send. + + + + Sends a SSH_MSG_CHANNEL_DATA message with the specified payload. + + An array of containing the payload to send. + The zero-based offset in at which to begin taking data from. + The number of bytes of to send. + + + When the size of the data to send exceeds the maximum packet size or the remote window + size does not allow the full data to be sent, then this method will send the data in + multiple chunks and will wait for the remote window size to be adjusted when it's zero. + + + This is done to support SSH servers will a small window size that do not agressively + increase their window size. We need to take into account that there may be SSH servers + that only increase their window size when it has reached zero. + + + + + + Sends a SSH_MSG_CHANNEL_EOF message to the remote server. + + The channel is closed. + + + + A "direct-tcpip" SSH channel. + + + + + Occurs when an exception is thrown while processing channel messages. + + + + + Gets a value indicating whether this channel is open. + + + true if this channel is open; otherwise, false. + + + + + Gets the local channel number. + + + The local channel number. + + + + + Opens a channel for a locally forwarded TCP/IP port. + + The name of the remote host to forward to. + The port of the remote hosts to forward to. + The forwarded port for which the channel is opened. + The socket to receive requests from, and send responses from the remote host to. + + + + Binds the channel to the remote host. + + + + + A "forwarded-tcpip" SSH channel. + + + + + Occurs when an exception is thrown while processing channel messages. + + + + + Binds the channel to the specified endpoint. + + The endpoint to connect to. + The forwarded port for which the channel is opened. + + + + Session SSH channel. + + + + + Opens the channel. + + + + + Sends the pseudo terminal request. + + The environment variable. + The columns. + The rows. + The width. + The height. + The terminal mode values. + + true if request was successful; otherwise false. + + + + + Sends the X11 forwarding request. + + if set to true the it is single connection. + The protocol. + The cookie. + The screen number. + + true if request was successful; otherwise false. + + + + + Sends the environment variable request. + + Name of the variable. + The variable value. + + true if request was successful; otherwise false. + + + + + Sends the shell request. + + + true if request was successful; otherwise false. + + + + + Sends the exec request. + + The command. + + true if request was successful; otherwise false. + + + + + Sends the exec request. + + Length of the break. + + true if request was successful; otherwise false. + + + + + Sends the subsystem request. + + The subsystem. + + true if request was successful; otherwise false. + + + + + Sends the window change request. + + The columns. + The rows. + The width. + The height. + + true if request was successful; otherwise false. + + + + + Sends the local flow request. + + if set to true [client can do]. + + true if request was successful; otherwise false. + + + + + Sends the signal request. + + Name of the signal. + + true if request was successful; otherwise false. + + + + + Sends the exit status request. + + The exit status. + + true if request was successful; otherwise false. + + + + + Sends the exit signal request. + + Name of the signal. + if set to true [core dumped]. + The error message. + The language. + + true if request was successful; otherwise false. + + + + + Sends eow@openssh.com request. + + + true if request was successful; otherwise false. + + + + + Sends keepalive@openssh.com request. + + + true if request was successful; otherwise false. + + Initializes a new instance. @@ -1509,6 +1550,127 @@ The window size of the remote party. The maximum size of a data packet that we can send to the remote party. + + + Holds information about key size and cipher to use + + + + + Gets the size of the key. + + + The size of the key. + + + + + Gets the cipher. + + + + + Initializes a new instance of the class. + + Size of the key. + The cipher. + + + + Initializes a new instance. + + The number of times an authentication attempt with any given can result in before it is disregarded. + is less than one. + + + + Gets the number of times an authentication attempt with any given can + result in before it is disregarded. + + + The number of times an authentication attempt with any given can result + in before it is disregarded. + + + + + Attempts to authentication for a given using the + of the specified . + + A to use for authenticating. + The for which to perform authentication. + + + + Records if a given has been tried, and how many times this resulted + in . + + + When there's no entry for a given , then it was never tried. + + + + + Holds the list of authentications methods that failed. + + + + + Records a authentication attempt for the specified + . + + An for which to record the result of an authentication attempt. + + + + Records a authentication attempt for the specified + . + + An for which to record the result of an authentication attempt. + + + + Returns the number of times an authentication attempt with the specified + has resulted in . + + An . + + The number of times an authentication attempt with the specified + has resulted in . + + + + + Returns a list of supported authentication methods that match one of the specified allowed authentication + methods. + + A list of allowed authentication methods. + + A list of supported authentication methods that match one of the specified allowed authentication methods. + + + The authentication methods are returned in the order in which they were specified in the list that was + used to initialize the current instance. + + + + + Returns the authentication methods from the specified list that have not yet failed. + + A list of authentication methods. + + The authentication methods from that have not yet failed. + + + + This method first returns the authentication methods that have not yet been executed, and only then + returns those for which an authentication attempt resulted in a . + + + Any that has failed is skipped. + + + Provides additional information for asynchronous command execution @@ -1565,31 +1727,6 @@ otherwise, false. - - - Holds information about key size and cipher to use - - - - - Gets the size of the key. - - - The size of the key. - - - - - Gets the cipher. - - - - - Initializes a new instance of the class. - - Size of the key. - The cipher. - Base class to encapsulates the results of an asynchronous operation. @@ -3264,6 +3401,340 @@ Request information. + + + Base class for DER encoded data. + + + + + Gets a value indicating whether end of data is reached. + + + true if end of data is reached; otherwise, false. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + DER encoded data. + its a construct + + + + Encodes written data as DER byte array. + + DER Encoded array. + + + + Reads next mpint data type from internal buffer. + + mpint read. + + + + Reads next int data type from internal buffer. + + int read. + + + + Reads next octetstring data type from internal buffer. + + data read. + + + + Reads next bitstring data type from internal buffer. + + data read. + + + + Reads next object data type from internal buffer. + + data read. + + + + Writes BOOLEAN data into internal buffer. + + UInt32 data to write. + + + + Writes UInt32 data into internal buffer. + + UInt32 data to write. + + + + Writes INTEGER data into internal buffer. + + BigInteger data to write. + + + + Writes OCTETSTRING data into internal buffer. + + The data. + + + + Writes BITSTRING data into internal buffer. + + The data. + + + + Writes OBJECTIDENTIFIER data into internal buffer. + + The identifier. + + + + Writes OBJECTIDENTIFIER data into internal buffer. + + The bytes. + + + + Writes NULL data into internal buffer. + + + + + Writes DerData data into internal buffer. + + DerData data to write. + + + + Gets Data Length + + length + + + + Write Byte data into internal buffer. + + + + + Reads Byte data into internal buffer. + + data read + + + + Reads lengths Bytes data into internal buffer. + + data read + amount of data to read. + + + + Provides data for the ErrorOccured events. + + + + + Gets the System.Exception that represents the error that occurred. + + + + + Initializes a new instance of the class. + + An System.Exception that represents the error that occurred. + + + + Collection of different extension method + + + + + Determines whether the specified value is null or white space. + + The value. + + true if is null or white space; otherwise, false. + + + + + Initializes a new instance of the structure using the SSH BigNum2 Format + + + + + Reverses the sequence of the elements in the entire one-dimensional . + + The one-dimensional to reverse. + + The with its elements reversed. + + + + + Prints out + + The bytes. + + + + Creates an instance of the specified type using that type's default constructor. + + The type to create. + Type of the instance to create. + A reference to the newly created object. + + + + Returns a specified number of contiguous bytes from a given offset. + + The array to return a number of bytes from. + The zero-based offset in at which to begin taking bytes. + The number of bytes to take from . + + A array that contains the specified number of bytes at the specified offset + of the input array. + + is null. + + When is zero and equals the length of , + then is returned. + + + + + Returns a specified number of contiguous bytes from the start of the specified byte array. + + The array to return a number of bytes from. + The number of bytes to take from . + + A array that contains the specified number of bytes at the start of the input array. + + is null. + + When equals the length of , then + is returned. + + + + + Trims the leading zero from a byte array. + + The value. + + without leading zeros. + + + + + Pads with leading zeros if needed. + + The data. + The length to pad to. + + + + Provides data for the HostKeyReceived event. + + + + + Gets or sets a value indicating whether host key can be trusted. + + + true if host key can be trusted; otherwise, false. + + + + + Gets the host key. + + + + + Gets the host key name. + + + + + Gets the finger print. + + + + + Gets the length of the key in bits. + + + The length of the key in bits. + + + + + Initializes a new instance of the class. + + The host. + + + + The exception that is thrown when there is something wrong with the server capabilities. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner exception. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Describes object identifier for DER encoding + + + + + Gets the object identifier. + + + + + Initializes a new instance of the class. + + The identifiers. + Provides convenience methods for conversion to and from both Big Endian and Little Endian. @@ -3381,324 +3852,6 @@ The buffer. Converted . - - - Gets the file name part of a given POSIX path. - - The POSIX path to get the file name for. - - The file name part of . - - is null. - - - If contains no forward slash, then - is returned. - - - If path has a trailing slash, but return a zero-length string. - - - - - - The exception that is thrown when a proxy connection cannot be established. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner exception. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Provides data for the HostKeyReceived event. - - - - - Gets or sets a value indicating whether host key can be trusted. - - - true if host key can be trusted; otherwise, false. - - - - - Gets the host key. - - - - - Gets the host key name. - - - - - Gets the finger print. - - - - - Gets the length of the key in bits. - - - The length of the key in bits. - - - - - Initializes a new instance of the class. - - The host. - - - - Base class for DER encoded data. - - - - - Gets a value indicating whether end of data is reached. - - - true if end of data is reached; otherwise, false. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - DER encoded data. - - - - Encodes written data as DER byte array. - - DER Encoded array. - - - - Reads next mpint data type from internal buffer. - - mpint read. - - - - Reads next int data type from internal buffer. - - int read. - - - - Writes BOOLEAN data into internal buffer. - - UInt32 data to write. - - - - Writes UInt32 data into internal buffer. - - UInt32 data to write. - - - - Writes INTEGER data into internal buffer. - - BigInteger data to write. - - - - Writes OCTETSTRING data into internal buffer. - - The data. - - - - Writes OBJECTIDENTIFIER data into internal buffer. - - The identifier. - - - - Writes NULL data into internal buffer. - - - - - Writes DerData data into internal buffer. - - DerData data to write. - - - - Provides data for the ErrorOccured events. - - - - - Gets the System.Exception that represents the error that occurred. - - - - - Initializes a new instance of the class. - - An System.Exception that represents the error that occurred. - - - - Collection of different extension method - - - - - Determines whether the specified value is null or white space. - - The value. - - true if is null or white space; otherwise, false. - - - - - Reverses the sequence of the elements in the entire one-dimensional . - - The one-dimensional to reverse. - - The with its elements reversed. - - - - - Prints out - - The bytes. - - - - Creates an instance of the specified type using that type's default constructor. - - The type to create. - Type of the instance to create. - A reference to the newly created object. - - - - Returns a specified number of contiguous bytes from a given offset. - - The array to return a number of bytes from. - The zero-based offset in at which to begin taking bytes. - The number of bytes to take from . - - A array that contains the specified number of bytes at the specified offset - of the input array. - - is null. - - When is zero and equals the length of , - then is returned. - - - - - Returns a specified number of contiguous bytes from the start of the specified byte array. - - The array to return a number of bytes from. - The number of bytes to take from . - - A array that contains the specified number of bytes at the start of the input array. - - is null. - - When equals the length of , then - is returned. - - - - - Trims the leading zero from a byte array. - - The value. - - without leading zeros. - - - - - The exception that is thrown when there is something wrong with the server capabilities. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner exception. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Describes object identifier for DER encoding - - - - - Gets the object identifier. - - - - - Initializes a new instance of the class. - - The identifiers. - PipeStream is a thread-safe read/write data stream for use between two threads in a @@ -3918,6 +4071,68 @@ is null. is not within and . + + + Gets the file name part of a given POSIX path. + + The POSIX path to get the file name for. + + The file name part of . + + is null. + + + If contains no forward slash, then + is returned. + + + If path has a trailing slash, return a zero-length string. + + + + + + Gets the directory name part of a given POSIX path. + + The POSIX path to get the directory name for. + + The directory part of the specified , or . if + does not contain any directory information. + + is null. + + + + The exception that is thrown when a proxy connection cannot be established. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner exception. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + Provides data for the Downloading event. @@ -4499,6 +4714,156 @@ extension-pair data to write. + + + Specialized for reading and writing data SSH data. + + + + + Initializes a new instance of the class with an expandable capacity initialized + as specified. + + The initial size of the internal array in bytes. + + + + Initializes a new non-resizable instance of the class based on the specified byte array. + + The array of unsigned bytes from which to create the current stream. + is null. + + + + Initializes a new non-resizable instance of the class based on the specified byte array. + + The array of unsigned bytes from which to create the current stream. + The zero-based offset in at which to begin reading SSH data. + The number of bytes to load. + is null. + + + + Gets a value indicating whether all data from the SSH data stream has been read. + + + true if this instance is end of data; otherwise, false. + + + + + Writes an to the SSH data stream. + + data to write. + + + + Writes an to the SSH data stream. + + data to write. + + + + Writes a into the SSH data stream. + + The to write. + + + + Writes bytes array data into the SSH data stream. + + Byte array data to write. + is null. + + + + Reads a byte array from the SSH data stream. + + + The byte array read from the SSH data stream. + + + + + Writes a buffer preceded by its length into the SSH data stream. + + The data to write. + is null. + + + + Writes a buffer preceded by its length into the SSH data stream. + + An array of bytes. This method write bytes from buffer to the current SSH data stream. + The zero-based byte offset in at which to begin writing bytes to the SSH data stream. + The number of bytes to be written to the current SSH data stream. + is null. + The sum of and is greater than the buffer length. + or is negative. + + + + Writes string data to the SSH data stream using the specified encoding. + + The string data to write. + The character encoding to use. + is null. + is null. + + + + Reads a from the SSH datastream. + + + The read from the SSH data stream. + + + + + Reads the next data type from the SSH data stream. + + + The read from the SSH data stream. + + + + + Reads the next data type from the SSH data stream. + + + The read from the SSH data stream. + + + + + Reads the next data type from the SSH data stream. + + + The read from the SSH data stream. + + + + + Reads next specified number of bytes data type from internal buffer. + + Number of bytes to read. + + An array of bytes that was read from the internal buffer. + + is greater than the internal buffer size. + + + + Writes the stream contents to a byte array, regardless of the . + + + This method returns the contents of the as a byte array. + + + If the current instance was constructed on a provided byte array, a copy of the section of the array + to which this instance has access is returned. + + The exception that is thrown when SSH exception occurs. @@ -4755,6 +5120,11 @@ Ring bell on input queue full. + + + Terminal input and output is assumed to be encoded in UTF-8. + + Enable signals INTR, QUIT, [D]SUSP. @@ -4880,252 +5250,6 @@ Specifies the output baud rate in bits per second. - - - Specialized for reading and writing data SSH data. - - - - - Initializes a new instance of the class with an expandable capacity initialized - as specified. - - The initial size of the internal array in bytes. - - - - Initializes a new non-resizable instance of the class based on the specified byte array. - - The array of unsigned bytes from which to create the current stream. - is null. - - - - Initializes a new non-resizable instance of the class based on the specified byte array. - - The array of unsigned bytes from which to create the current stream. - The zero-based offset in at which to begin reading SSH data. - The number of bytes to load. - is null. - - - - Gets a value indicating whether all data from the SSH data stream has been read. - - - true if this instance is end of data; otherwise, false. - - - - - Writes an to the SSH data stream. - - data to write. - - - - Writes an to the SSH data stream. - - data to write. - - - - Writes a into the SSH data stream. - - The to write. - - - - Writes bytes array data into the SSH data stream. - - Byte array data to write. - is null. - - - - Reads a byte array from the SSH data stream. - - - The byte array read from the SSH data stream. - - - - - Writes a buffer preceded by its length into the SSH data stream. - - The data to write. - is null. - - - - Writes a buffer preceded by its length into the SSH data stream. - - An array of bytes. This method write bytes from buffer to the current SSH data stream. - The zero-based byte offset in at which to begin writing bytes to the SSH data stream. - The number of bytes to be written to the current SSH data stream. - is null. - The sum of and is greater than the buffer length. - or is negative. - - - - Writes string data to the SSH data stream using the specified encoding. - - The string data to write. - The character encoding to use. - is null. - is null. - - - - Reads a from the SSH datastream. - - - The read from the SSH data stream. - - - - - Reads the next data type from the SSH data stream. - - - The read from the SSH data stream. - - - - - Reads the next data type from the SSH data stream. - - - The read from the SSH data stream. - - - - - Reads the next data type from the SSH data stream. - - - The read from the SSH data stream. - - - - - Reads next specified number of bytes data type from internal buffer. - - Number of bytes to read. - - An array of bytes that was read from the internal buffer. - - is greater than the internal buffer size. - - - - Writes the stream contents to a byte array, regardless of the . - - - This method returns the contents of the as a byte array. - - - If the current instance was constructed on a provided byte array, a copy of the section of the array - to which this instance has access is returned. - - - - - Initializes a new instance. - - The number of times an authentication attempt with any given can result in before it is disregarded. - is less than one. - - - - Gets the number of times an authentication attempt with any given can - result in before it is disregarded. - - - The number of times an authentication attempt with any given can result - in before it is disregarded. - - - - - Attempts to authentication for a given using the - of the specified . - - A to use for authenticating. - The for which to perform authentication. - - - - Records if a given has been tried, and how many times this resulted - in . - - - When there's no entry for a given , then it was never tried. - - - - - Holds the list of authentications methods that failed. - - - - - Records a authentication attempt for the specified - . - - An for which to record the result of an authentication attempt. - - - - Records a authentication attempt for the specified - . - - An for which to record the result of an authentication attempt. - - - - Returns the number of times an authentication attempt with the specified - has resulted in . - - An . - - The number of times an authentication attempt with the specified - has resulted in . - - - - - Returns a list of supported authentication methods that match one of the specified allowed authentication - methods. - - A list of allowed authentication methods. - - A list of supported authentication methods that match one of the specified allowed authentication methods. - - - The authentication methods are returned in the order in which they were specified in the list that was - used to initialize the current instance. - - - - - Returns the authentication methods from the specified list that have not yet failed. - - A list of authentication methods. - - The authentication methods from that have not yet failed. - - - - This method first returns the authentication methods that have not yet been executed, and only then - returns those for which an authentication attempt resulted in a . - - - Any that has failed is skipped. - - - Specifies compression modes @@ -5286,6 +5410,22 @@ client instances. + + + The default connection timeout. + + + 30 seconds. + + + + + The default channel close timeout. + + + 1 second. + + Gets supported key exchange algorithms for this connection. @@ -5389,6 +5529,18 @@ + + + Gets or sets the timeout to use when waiting for a server to acknowledge closing a channel. + + + The channel close timeout. The default value is 1 second. + + + If a server does not send a SSH_MSG_CHANNEL_CLOSE message before the specified timeout + elapses, the channel will be closed immediately. + + Gets or sets the character encoding. @@ -5538,6 +5690,522 @@ The session in which the banner message was received. The banner message.{ + + + Specifies behavior for expected expression + + + + + Gets the expected regular expression. + + + + + Gets the action to perform when expected expression is found. + + + + + Initializes a new instance of the class. + + The expect regular expression. + The action to perform. + or is null. + + + + Initializes a new instance of the class. + + The expect expression. + The action to perform. + or is null. + + + + Provides additional information for asynchronous command execution + + + + + Initializes a new instance of the class. + + The async callback. + The state. + + + + Base class for port forwarding functionality. + + + + + Gets or sets the session. + + + The session. + + + + + The event occurs as the forwarded port is being stopped. + + + + + The event occurs as the forwarded port is being stopped. + + + + + Gets a value indicating whether port forwarding is started. + + + true if port forwarding is started; otherwise, false. + + + + + Occurs when an exception is thrown. + + + + + Occurs when a port forwarding request is received. + + + + + Starts port forwarding. + + + + + Stops port forwarding. + + + + + Starts port forwarding. + + + + + Stops port forwarding, and waits for the specified timeout until all pending + requests are processed. + + The maximum amount of time to wait for pending requests to finish processing. + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Ensures the current instance is not disposed. + + The current instance is disposed. + + + + Raises event. + + The exception. + + + + Raises event. + + Request originator host. + Request originator port. + + + + Raises the event. + + + + + Handles session ErrorOccured event. + + The source of the event. + The instance containing the event data. + + + + Provides functionality for forwarding connections from the client to destination servers via the SSH server, + also known as dynamic port forwarding. + + + + + Gets the bound host. + + + + + Gets the bound port. + + + + + Gets a value indicating whether port forwarding is started. + + + true if port forwarding is started; otherwise, false. + + + + + Initializes a new instance of the class. + + The port. + + + + Initializes a new instance of the class. + + The host. + The port. + + + + Starts local port forwarding. + + + + + Stops local port forwarding, and waits for the specified timeout until all pending + requests are processed. + + The maximum amount of time to wait for pending requests to finish processing. + + + + Ensures the current instance is not disposed. + + The current instance is disposed. + + + + Interrupts the listener, and unsubscribes from events. + + + + + Waits for pending channels to close. + + The maximum time to wait for the pending channels to close. + + + + Holds a value indicating whether the current instance is disposed. + + + true if the current instance is disposed; otherwise, false. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + + + + Initializes the . + + + + When the port is started for the first time, a is created with an initial count + of 1. + + + On subsequent (re)starts, we'll dispose the current and create a new one with + initial count of 1. + + + + + + Reads a null terminated string from a socket. + + The to read from. + The timeout to apply to individual reads. + + The read, or null when the socket was closed. + + + + + Provides functionality for local port forwarding + + + + + Gets the bound host. + + + + + Gets the bound port. + + + + + Gets the forwarded host. + + + + + Gets the forwarded port. + + + + + Gets a value indicating whether port forwarding is started. + + + true if port forwarding is started; otherwise, false. + + + + + Initializes a new instance of the class. + + The bound port. + The host. + The port. + is greater than . + is null. + is greater than . + + + + + + + Initializes a new instance of the class. + + The bound host. + The host. + The port. + is null. + is null. + is greater than . + + + + Initializes a new instance of the class. + + The bound host. + The bound port. + The host. + The port. + is null. + is null. + is greater than . + is greater than . + + + + Starts local port forwarding. + + + + + Stops local port forwarding, and waits for the specified timeout until all pending + requests are processed. + + The maximum amount of time to wait for pending requests to finish processing. + + + + Ensures the current instance is not disposed. + + The current instance is disposed. + + + + Interrupts the listener, and unsubscribes from events. + + + + + Waits for pending channels to close. + + The maximum time to wait for the pending channels to close. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + + + + Initializes the . + + + + When the port is started for the first time, a is created with an initial count + of 1. + + + On subsequent (re)starts, we'll dispose the current and create a new one with + initial count of 1. + + + + + + Provides functionality for remote port forwarding + + + + + Gets a value indicating whether port forwarding is started. + + + true if port forwarding is started; otherwise, false. + + + + + Gets the bound host. + + + + + Gets the bound host. + + + + + Gets the bound port. + + + + + Gets the forwarded host. + + + + + Gets the forwarded host. + + + + + Gets the forwarded port. + + + + + Initializes a new instance of the class. + + The bound host address. + The bound port. + The host address. + The port. + is null. + is null. + is greater than . + is greater than . + + + + Initializes a new instance of the class. + + The bound port. + The host. + The port. + + + + + + + Initializes a new instance of the class. + + The bound host. + The bound port. + The host. + The port. + + + + Starts remote port forwarding. + + + + + Stops remote port forwarding. + + The maximum amount of time to wait for the port to stop. + + + + Ensures the current instance is not disposed. + + The current instance is disposed. + + + + Initializes the . + + + + When the port is started for the first time, a is created with an initial count + of 1. + + + On subsequent (re)starts, we'll dispose the current and create a new one with + initial count of 1. + + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + Returns a value indicating whether has been changed to . @@ -5651,6 +6319,18 @@ Represents remote connection information. + + + Gets or sets the timeout to used when waiting for a server to acknowledge closing a channel. + + + The channel close timeout. The default value is 1 second. + + + If a server does not send a SSH2_MSG_CHANNEL_CLOSE message before the specified timeout + elapses, the channel will be closed immediately. + + Gets the supported channel requests for this connection. @@ -5961,6 +6641,29 @@ session is disconnected. + + + Waits for the specified to receive a signal, using a + to specify the time interval. + + The that should be signaled. + A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. + When this method returns , contains the . + + A . + + + + + Waits for the specified to receive a signal, using a + to specify the time interval. + + The that should be signaled. + A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. + + A . + + Occurs when message received @@ -6173,6 +6876,683 @@ A array that is composed of system objects and the specified elements. + + + Provides functionality to perform keyboard interactive authentication. + + + + + Gets authentication method name + + + + + Occurs when server prompts for more authentication information. + + + + + Initializes a new instance of the class. + + The username. + is whitespace or null. + + + + Authenticates the specified session. + + The session to authenticate. + Result of authentication process. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + + + + Provides connection information when keyboard interactive authentication method is used + + + + + + + + Occurs when server prompts for more authentication information. + + + + + + + + Initializes a new instance of the class. + + The host. + The username. + + + + Initializes a new instance of the class. + + The host. + The port. + The username. + + + + Initializes a new instance of the class. + + Connection host. + Connection port. + Connection username. + Type of the proxy. + The proxy host. + The proxy port. + + + + Initializes a new instance of the class. + + Connection host. + Connection port. + Connection username. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Type of the proxy. + The proxy host. + The proxy port. + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + The proxy password. + + + + Initializes a new instance of the class. + + Connection host. + Connection port. + Connection username. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + The proxy password. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + + + + Provides data for message events. + + Message type + + + + Gets the message. + + + + + Initializes a new instance of the class. + + The message. + is null. + + + + Represents SSH_MSG_USERAUTH_BANNER message. + + + + + Gets banner message. + + + + + Gets banner language. + + + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + + + + Called when type specific data need to be loaded. + + + + + Called when type specific data need to be saved. + + + + + Represents SSH_MSG_USERAUTH_FAILURE message. + + + + + Gets or sets the allowed authentications if available. + + + The allowed authentications. + + + + + Gets failure message. + + + + + Gets a value indicating whether authentication is partially successful. + + + true if partially successful; otherwise, false. + + + + + Called when type specific data need to be loaded. + + + + + Called when type specific data need to be saved. + + + + + Represents SSH_MSG_USERAUTH_INFO_REQUEST message. + + + + + Gets information request name. + + + + + Gets information request instruction. + + + + + Gets information request language. + + + + + Gets information request prompts. + + + + + Called when type specific data need to be loaded. + + + + + Called when type specific data need to be saved. + + + + + Represents SSH_MSG_USERAUTH_INFO_RESPONSE message. + + + + + Gets authentication responses. + + + + + Gets the size of the message in bytes. + + + -1 to indicate that the size of the message cannot be determined, + or is too costly to calculate. + + + + + Initializes a new instance of the class. + + + + + Called when type specific data need to be loaded. + + + + + Called when type specific data need to be saved. + + + + + Represents SSH_MSG_USERAUTH_PASSWD_CHANGEREQ message. + + + + + Gets password change request message as UTF-8 encoded byte array. + + + + + Gets message language as UTF-8 encoded byte array. + + + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + + + + Called when type specific data need to be loaded. + + + + + Called when type specific data need to be saved. + + + + + Represents SSH_MSG_USERAUTH_PK_OK message. + + + + + Gets the name of the public key algorithm as ASCII encoded byte array. + + + The name of the public key algorithm. + + + + + Gets the public key data. + + + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + + + + Called when type specific data need to be loaded. + + + + + Called when type specific data need to be saved. + + + + + Represents SSH_MSG_USERAUTH_REQUEST message. Server as a base message for other user authentication requests. + + + + + Returns the authentication message code for SSH_MSG_USERAUTH_REQUEST. + + + + + Gets authentication username as UTF-8 encoded byte array. + + + + + Gets the name of the service as ASCII encoded byte array. + + + The name of the service. + + + + + Gets the name of the authentication method. + + + The name of the method. + + + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + + + + Initializes a new instance of the class. + + Name of the service. + Authentication username. + The name of the authentication method. + + + + Called when type specific data need to be loaded. + + + + + Called when type specific data need to be saved. + + + + + Represents "hostbased" SSH_MSG_USERAUTH_REQUEST message. + + + + + Gets the public key algorithm for host key as ASCII encoded byte array. + + + + + Gets or sets the public host key and certificates for client host. + + + The public host key. + + + + + Gets or sets the name of the client host as ASCII encoded byte array. + + + The name of the client host. + + + + + Gets or sets the client username on the client host as UTF-8 encoded byte array. + + + The client username. + + + + + Gets or sets the signature. + + + The signature. + + + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + + + + Initializes a new instance of the class. + + Name of the service. + Authentication username. + The public key algorithm. + The public host key. + Name of the client host. + The client username. + The signature. + + + + Called when type specific data need to be saved. + + + + + Represents "keyboard-interactive" SSH_MSG_USERAUTH_REQUEST message. + + + + + Gets message language. + + + + + Gets authentication sub methods. + + + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + + + + Initializes a new instance of the class. + + Name of the service. + Authentication username. + + + + Called when type specific data need to be saved. + + + + + Represents "none" SSH_MSG_USERAUTH_REQUEST message. + + + + + Initializes a new instance of the class. + + Name of the service. + Authentication username. + + + + Represents "password" SSH_MSG_USERAUTH_REQUEST message. + + + + + Gets authentication password. + + + + + Gets new authentication password. + + + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + + + + Initializes a new instance of the class. + + Name of the service. + Authentication username. + Authentication password. + + + + Initializes a new instance of the class. + + Name of the service. + Authentication username. + Authentication password. + New authentication password. + + + + Called when type specific data need to be saved. + + + + + Represents "publickey" SSH_MSG_USERAUTH_REQUEST message. + + + + + Gets the name of the public key algorithm as ASCII encoded byte array. + + + The name of the public key algorithm. + + + + + Gets the public key data. + + + + + Gets or sets public key signature. + + + The signature. + + + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + + + + Initializes a new instance of the class. + + Name of the service. + Authentication username. + Name of private key algorithm. + Private key data. + + + + Initializes a new instance of the class. + + Name of the service. + Authentication username. + Name of private key algorithm. + Private key data. + Private key signature. + + + + Called when type specific data need to be saved. + + + + + Represents SSH_MSG_USERAUTH_SUCCESS message. + + + + + Called when type specific data need to be loaded. + + + + + Called when type specific data need to be saved. + + Gets the address to bind to. @@ -6201,34 +7581,6 @@ Called when type specific data need to be saved. - - - Gets the address to bind to. - - - - - Gets port number to bind to. - - - - - Gets the size of the message in bytes. - - - The size of the messages in bytes. - - - - - Called when type specific data need to be loaded. - - - - - Called when type specific data need to be saved. - - Represents SSH_MSG_CHANNEL_CLOSE message. @@ -7957,9 +9309,107 @@ Called when type specific data need to be saved. - + - Indicates that message that implement this interface is allowed during key exchange phase + Gets the address to bind to. + + + + + Gets port number to bind to. + + + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + + + + Called when type specific data need to be loaded. + + + + + Called when type specific data need to be saved. + + + + + Base class for all SSH protocol messages + + + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + + + + Writes the message to the specified . + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Process the current message for the specified . + + The for which to process the current message. + + + + Indicates that a class represents SSH message. This class cannot be inherited. + + + + + Gets or sets message name as defined in RFC 4250. + + + The name. + + + + + Gets or sets message number as defined in RFC 4250. + + + The number. + + + + + Initializes a new instance of the class. + + The name. + The number. + + + + Specifies list of supported services + + + + + ssh-userauth + + + + + ssh-connection @@ -8177,6 +9627,11 @@ Called when type specific data need to be saved. + + + Indicates that message that implement this interface is allowed during key exchange phase + + Represents SSH_MSG_KEX_DH_GEX_GROUP message. @@ -8234,7 +9689,7 @@ The size of the messages in bytes. - + Initializes a new instance of the class. @@ -8363,7 +9818,7 @@ The size of the messages in bytes. - + Initializes a new instance of the class. @@ -8419,6 +9874,84 @@ Called when type specific data need to be saved. + + + Represents SSH_MSG_KEXECDH_INIT message. + + + + + Gets the client's ephemeral contribution to the ECDH exchange, encoded as an octet string + + + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Called when type specific data need to be loaded. + + + + + Called when type specific data need to be saved. + + + + + Represents SSH_MSG_KEXECDH_REPLY message. + + + + + Gets a string encoding an X.509v3 certificate containing the server's ECDSA public host key + + The host key. + + + + Gets the server's ephemeral contribution to the ECDH exchange, encoded as an octet string. + + + + + Gets an octet string containing the server's signature of the newly established exchange hash value. + + The signature. + + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + + + + Called when type specific data need to be loaded. + + + + + Called when type specific data need to be saved. + + Represents SSH_MSG_KEXINIT message. @@ -8639,576 +10172,174 @@ Called when type specific data need to be saved. - + - Represents SSH_MSG_USERAUTH_BANNER message. + Contains operation for working with NetConf server. - + - Gets banner message. + Holds instance that used to communicate to the server - + - Gets banner language. - - - - - Gets the size of the message in bytes. + Gets or sets the operation timeout. - The size of the messages in bytes. + The timeout to wait until an operation completes. The default value is negative + one (-1) milliseconds, which indicates an infinite time-out period. + represents a value that is less than -1 or greater than milliseconds. - + - Called when type specific data need to be loaded. - - - - - Called when type specific data need to be saved. - - - - - Represents SSH_MSG_USERAUTH_FAILURE message. - - - - - Gets or sets the allowed authentications if available. + Gets the current NetConf session. - The allowed authentications. + The current NetConf session. - + - Gets failure message. + Initializes a new instance of the class. + The connection info. + is null. - + - Gets a value indicating whether authentication is partially successful. + Initializes a new instance of the class. - - true if partially successful; otherwise, false. - - - - - Called when type specific data need to be loaded. - - - - - Called when type specific data need to be saved. - - - - - Represents SSH_MSG_USERAUTH_INFO_REQUEST message. - - - - - Gets information request name. - - - - - Gets information request instruction. - - - - - Gets information request language. - - - - - Gets information request prompts. - - - - - Called when type specific data need to be loaded. - - - - - Called when type specific data need to be saved. - - - - - Represents SSH_MSG_USERAUTH_INFO_RESPONSE message. - - - - - Gets authentication responses. - - - - - Gets the size of the message in bytes. - - - -1 to indicate that the size of the message cannot be determined, - or is too costly to calculate. - - - - - Initializes a new instance of the class. - - - - - Called when type specific data need to be loaded. - - - - - Called when type specific data need to be saved. - - - - - Represents SSH_MSG_USERAUTH_PASSWD_CHANGEREQ message. - - - - - Gets password change request message as UTF-8 encoded byte array. - - - - - Gets message language as UTF-8 encoded byte array. - - - - - Gets the size of the message in bytes. - - - The size of the messages in bytes. - - - - - Called when type specific data need to be loaded. - - - - - Called when type specific data need to be saved. - - - - - Represents SSH_MSG_USERAUTH_PK_OK message. - - - - - Gets the name of the public key algorithm as ASCII encoded byte array. - - - The name of the public key algorithm. - - - - - Gets the public key data. - - - - - Gets the size of the message in bytes. - - - The size of the messages in bytes. - - - - - Called when type specific data need to be loaded. - - - - - Called when type specific data need to be saved. - - - - - Represents SSH_MSG_USERAUTH_REQUEST message. Server as a base message for other user authentication requests. - - - - - Returns the authentication message code for SSH_MSG_USERAUTH_REQUEST. - - - - - Gets authentication username as UTF-8 encoded byte array. - - - - - Gets the name of the service as ASCII encoded byte array. - - - The name of the service. - - - - - Gets the name of the authentication method. - - - The name of the method. - - - - - Gets the size of the message in bytes. - - - The size of the messages in bytes. - - - - - Initializes a new instance of the class. - - Name of the service. - Authentication username. - The name of the authentication method. - - - - Called when type specific data need to be loaded. - - - - - Called when type specific data need to be saved. - - - - - Represents "hostbased" SSH_MSG_USERAUTH_REQUEST message. - - - - - Gets the public key algorithm for host key as ASCII encoded byte array. - - - - - Gets or sets the public host key and certificates for client host. - - - The public host key. - - - - - Gets or sets the name of the client host as ASCII encoded byte array. - - - The name of the client host. - - - - - Gets or sets the client username on the client host as UTF-8 encoded byte array. - - - The client username. - - - - - Gets or sets the signature. - - - The signature. - - - - - Gets the size of the message in bytes. - - - The size of the messages in bytes. - - - - - Initializes a new instance of the class. - - Name of the service. - Authentication username. - The public key algorithm. - The public host key. - Name of the client host. - The client username. - The signature. - - - - Called when type specific data need to be saved. - - - - - Represents "keyboard-interactive" SSH_MSG_USERAUTH_REQUEST message. - - - - - Gets message language. - - - - - Gets authentication sub methods. - - - - - Gets the size of the message in bytes. - - - The size of the messages in bytes. - - - - - Initializes a new instance of the class. - - Name of the service. - Authentication username. - - - - Called when type specific data need to be saved. - - - - - Represents "none" SSH_MSG_USERAUTH_REQUEST message. - - - - - Initializes a new instance of the class. - - Name of the service. - Authentication username. - - - - Represents "password" SSH_MSG_USERAUTH_REQUEST message. - - - - - Gets authentication password. - - - - - Gets new authentication password. - - - - - Gets the size of the message in bytes. - - - The size of the messages in bytes. - - - - - Initializes a new instance of the class. - - Name of the service. + Connection host. + Connection port. Authentication username. Authentication password. + is null. + is invalid, or is null or contains only whitespace characters. + is not within and . - + - Initializes a new instance of the class. + Initializes a new instance of the class. - Name of the service. + Connection host. Authentication username. Authentication password. - New authentication password. + is null. + is invalid, or is null or contains only whitespace characters. - + - Called when type specific data need to be saved. + Initializes a new instance of the class. - - - - Represents "publickey" SSH_MSG_USERAUTH_REQUEST message. - - - - - Gets the name of the public key algorithm as ASCII encoded byte array. - - - The name of the public key algorithm. - - - - - Gets the public key data. - - - - - Gets or sets public key signature. - - - The signature. - - - - - Gets the size of the message in bytes. - - - The size of the messages in bytes. - - - - - Initializes a new instance of the class. - - Name of the service. + Connection host. + Connection port. Authentication username. - Name of private key algorithm. - Private key data. + Authentication private key file(s) . + is null. + is invalid, -or- is null or contains only whitespace characters. + is not within and . - + - Initializes a new instance of the class. + Initializes a new instance of the class. - Name of the service. + Connection host. Authentication username. - Name of private key algorithm. - Private key data. - Private key signature. + Authentication private key file(s) . + is null. + is invalid, -or- is null or contains only whitespace characters. - + - Called when type specific data need to be saved. + Initializes a new instance of the class. + The connection info. + Specified whether this instance owns the connection info. + is null. + + If is true, then the + connection info will be disposed when this instance is disposed. + - + - Represents SSH_MSG_USERAUTH_SUCCESS message. + Initializes a new instance of the class. + The connection info. + Specified whether this instance owns the connection info. + The factory to use for creating new services. + is null. + is null. + + If is true, then the + connection info will be disposed when this instance is disposed. + - + - Called when type specific data need to be loaded. - - - - - Called when type specific data need to be saved. - - - - - Base class for all SSH protocol messages - - - - - Gets the size of the message in bytes. + Gets the NetConf server capabilities. - The size of the messages in bytes. + The NetConf server capabilities. - + - Writes the message to the specified . - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Process the current message for the specified . - - The for which to process the current message. - - - - Indicates that a class represents SSH message. This class cannot be inherited. - - - - - Gets or sets message name as defined in RFC 4250. + Gets the NetConf client capabilities. - The name. + The NetConf client capabilities. - + - Gets or sets message number as defined in RFC 4250. + Gets or sets a value indicating whether automatic message id handling is + enabled. - The number. + true if automatic message id handling is enabled; otherwise, false. + The default value is true. - + - Initializes a new instance of the class. + Sends the receive RPC. - The name. - The number. + The RPC. + Reply message to RPC request + Client is not connected. - + - Specifies list of supported services + Sends the receive RPC. + + The XML. + Reply message to RPC request + + + + Sends the close RPC. + + Reply message to closing RPC request + Client is not connected. + + + + Called when client is connected to the server. - + - ssh-userauth + Called when client is disconnecting from the server. - + - ssh-connection + Releases unmanaged and - optionally - managed resources + true to release both managed and unmanaged resources; false to release only unmanaged resources. @@ -9243,6 +10374,662 @@ The session. The number of milliseconds to wait for an operation to complete, or -1 to wait indefinitely. + + + Provides functionality for "none" authentication method + + + + + Gets connection name + + + + + Initializes a new instance of the class. + + The username. + is whitespace or null. + + + + Authenticates the specified session. + + The session. + + Result of authentication process. + + is null. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + + + + Provides functionality to perform password authentication. + + + + + Gets authentication method name + + + + + Gets the password as a sequence of bytes. + + + The password as a sequence of bytes. + + + + + Occurs when user's password has expired and needs to be changed. + + + + + Initializes a new instance of the class. + + The username. + The password. + is whitespace or null. + is null. + + + + Initializes a new instance of the class. + + The username. + The password. + is whitespace or null. + is null. + + + + Authenticates the specified session. + + The session to authenticate. + + Result of authentication process. + + is null. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + + + + Provides connection information when password authentication method is used + + + + + + + + + + Occurs when user's password has expired and needs to be changed. + + + + + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Connection password. + + + + is null. + is invalid, or is null or contains only whitespace characters. + + + + Initializes a new instance of the class. + + Connection host. + Connection port. + Connection username. + Connection password. + is null. + is invalid, or is null or contains only whitespace characters. + is not within and . + + + + Initializes a new instance of the class. + + Connection host. + The port. + Connection username. + Connection password. + Type of the proxy. + The proxy host. + The proxy port. + + + + Initializes a new instance of the class. + + Connection host. + The port. + Connection username. + Connection password. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Connection password. + Type of the proxy. + The proxy host. + The proxy port. + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Connection password. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Connection password. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + The proxy password. + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Connection password. + + + + Initializes a new instance of the class. + + Connection host. + Connection port. + Connection username. + Connection password. + is null. + is invalid, or is null or contains only whitespace characters. + is not within and . + + + + Initializes a new instance of the class. + + Connection host. + The port. + Connection username. + Connection password. + Type of the proxy. + The proxy host. + The proxy port. + + + + Initializes a new instance of the class. + + Connection host. + The port. + Connection username. + Connection password. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Connection password. + Type of the proxy. + The proxy host. + The proxy port. + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Connection password. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Connection password. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + The proxy password. + + + + Initializes a new instance of the class. + + Connection host. + The port. + Connection username. + Connection password. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + The proxy password. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + + + + Provides functionality to perform private key authentication. + + + + + Gets authentication method name + + + + + Gets the key files used for authentication. + + + + + Initializes a new instance of the class. + + The username. + The key files. + is whitespace or null. + + + + Authenticates the specified session. + + The session to authenticate. + + Result of authentication process. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + + + + Provides connection information when private key authentication method is used + + + + + + + + Gets the key files used for authentication. + + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Connection key files. + + + + + + + + Initializes a new instance of the class. + + Connection host. + Connection port. + Connection username. + Connection key files. + + + + Initializes a new instance of the class. + + Connection host. + The port. + Connection username. + Type of the proxy. + The proxy host. + The proxy port. + The key files. + + + + Initializes a new instance of the class. + + Connection host. + The port. + Connection username. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + The key files. + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Type of the proxy. + The proxy host. + The proxy port. + The key files. + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + The key files. + + + + Initializes a new instance of the class. + + Connection host. + Connection username. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + The proxy password. + The key files. + + + + Initializes a new instance of the class. + + Connection host. + The port. + Connection username. + Type of the proxy. + The proxy host. + The proxy port. + The proxy username. + The proxy password. + The key files. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + + + + Represents private key information. + + + + + + + The following private keys are supported: + + + RSA in OpenSSL PEM and ssh.com format + + + DSA in OpenSSL PEM and ssh.com format + + + ECDSA 256/384/521 in OpenSSL PEM format + + + ED25519 in OpenSSH key format + + + + + The following encryption algorithms are supported: + + + DES-EDE3-CBC + + + DES-EDE3-CFB + + + DES-CBC + + + AES-128-CBC + + + AES-192-CBC + + + AES-256-CBC + + + + + + + + Gets the host key. + + + + + Initializes a new instance of the class. + + The private key. + + + + Initializes a new instance of the class. + + Name of the file. + is null or empty. + This method calls internally, this method does not catch exceptions from . + + + + Initializes a new instance of the class. + + Name of the file. + The pass phrase. + is null or empty, or is null. + This method calls internally, this method does not catch exceptions from . + + + + Initializes a new instance of the class. + + The private key. + The pass phrase. + or is null. + + + + Opens the specified private key. + + The private key. + The pass phrase. + + + + Decrypts encrypted private key file data. + + The cipher info. + Encrypted data. + Decryption pass phrase. + Decryption binary salt. + Decrypted byte array. + , , or is null. + + + + Parses an OpenSSH V1 key file (i.e. ED25519 key) according to the the key spec: + https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key. + + the key file data (i.e. base64 encoded data between the header/footer) + passphrase or null if there isn't one + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + + + + Reads next mpint data type from internal buffer where length specified in bits. + + mpint read. + + + + Specifies the type of proxy client will use to connect to server. + + + + No proxy server. + + + A SOCKS4 proxy server. + + + A SOCKS5 proxy server. + + + A HTTP proxy server. + Encloses a path in double quotes, and escapes any embedded double quote with a backslash. @@ -9513,175 +11300,1435 @@ - + - Computes a Hash-based Message Authentication Code (HMAC) by using the hash function. + Provides SCP client functionality. + + + + More information on the SCP protocol is available here: + https://github.com/net-ssh/net-scp/blob/master/lib/net/scp.rb + + + Known issues in OpenSSH: + + + Recursive download (-prf) does not deal well with specific UTF-8 and newline characters. + Recursive update does not support empty path for uploading to home directory. + + + + + + Provides SCP client functionality. - + - Initializes a with the specified key. - - The key. - - - - Initializes a with the specified key and size of the computed hash code. - - The key. - The size, in bits, of the computed hash code. - - - - Gets the size, in bits, of the computed hash code. + Gets or sets the operation timeout. - The size, in bits, of the computed hash code. + The timeout to wait until an operation completes. The default value is negative + one (-1) milliseconds, which indicates an infinite time-out period. - + - Finalizes the hash computation after the last data is processed by the cryptographic stream object. - - - The computed hash code. - - - - - Computes a Hash-based Message Authentication Code (HMAC) by using the hash function. - - - - - Initializes a with the specified key. - - The key. - - - - Initializes a with the specified key and size of the computed hash code. - - The key. - The size, in bits, of the computed hash code. - - - - Gets the size, in bits, of the computed hash code. + Gets or sets the size of the buffer. - The size, in bits, of the computed hash code. + The size of the buffer. The default buffer size is 16384 bytes. - + - Finalizes the hash computation after the last data is processed by the cryptographic stream object. - - - The computed hash code. - - - - - Computes a Hash-based Message Authentication Code (HMAC) by using the hash function. - - - - - Initializes a with the specified key. - - The key. - - - - Initializes a with the specified key and size of the computed hash code. - - The key. - The size, in bits, of the computed hash code. - - - - Gets the size, in bits, of the computed hash code. + Gets or sets the transformation to apply to remote paths. - The size, in bits, of the computed hash code. + The transformation to apply to remote paths. The default is . + is null. + + + This transformation is applied to the remote file or directory path that is passed to the + scp command. + + + See for the transformations that are supplied + out-of-the-box with SSH.NET. + + - + - Finalizes the hash computation after the last data is processed by the cryptographic stream object. + Occurs when downloading file. + + + + Occurs when uploading file. + + + + + Initializes a new instance of the class. + + The connection info. + is null. + + + + Initializes a new instance of the class. + + Connection host. + Connection port. + Authentication username. + Authentication password. + is null. + is invalid, or is null or contains only whitespace characters. + is not within and . + + + + Initializes a new instance of the class. + + Connection host. + Authentication username. + Authentication password. + is null. + is invalid, or is null or contains only whitespace characters. + + + + Initializes a new instance of the class. + + Connection host. + Connection port. + Authentication username. + Authentication private key file(s) . + is null. + is invalid, -or- is null or contains only whitespace characters. + is not within and . + + + + Initializes a new instance of the class. + + Connection host. + Authentication username. + Authentication private key file(s) . + is null. + is invalid, -or- is null or contains only whitespace characters. + + + + Initializes a new instance of the class. + + The connection info. + Specified whether this instance owns the connection info. + is null. + + If is true, then the + connection info will be disposed when this instance is disposed. + + + + + Initializes a new instance of the class. + + The connection info. + Specified whether this instance owns the connection info. + The factory to use for creating new services. + is null. + is null. + + If is true, then the + connection info will be disposed when this instance is disposed. + + + + + Uploads the specified stream to the remote host. + + The to upload. + A relative or absolute path for the remote file. + is null. + is a zero-length . + A directory with the specified path exists on the remote host. + The secure copy execution request was rejected by the server. + + + + Downloads the specified file from the remote host to the stream. + + A relative or absolute path for the remote file. + The to download the remote file to. + is null or contains only whitespace characters. + is null. + exists on the remote host, and is not a regular file. + The secure copy execution request was rejected by the server. + + + + Sets mode, size and name of file being upload. + + The channel to perform the upload in. + A from which any feedback from the server can be read. + The size of the content to upload. + The name of the file, without path, to which the content is to be uploaded. + + + When the SCP transfer is already initiated for a file, a zero-length should + be specified for . This prevents the server from uploading the + content to a file with path <file path>/ if there's + already a directory with this path, and allows us to receive an error response. + + + + + + Uploads the content of a file. + + The channel to perform the upload in. + A from which any feedback from the server can be read. + The content to upload. + The name of the remote file, without path, to which the content is uploaded. + + is only used for raising the event. + + + + + Checks the return code. + + The output stream. + + + + Read a LF-terminated string from the . + + The to read from. - The computed hash code. + The string without trailing LF. - + - Computes a Hash-based Message Authentication Code (HMAC) by using the hash function. + Uploads the specified file to the remote host. + + The file system info. + A relative or absolute path for the remote file. + is null. + is null. + is a zero-length . + A directory with the specified path exists on the remote host. + The secure copy execution request was rejected by the server. + + + + Uploads the specified directory to the remote host. + + The directory info. + A relative or absolute path for the remote directory. + is null. + is null. + is a zero-length string. + does not exist on the remote host, is not a directory or the user does not have the required permission. + The secure copy execution request was rejected by the server. + + + + Downloads the specified file from the remote host to local file. + + Remote host file name. + Local file information. + is null. + is null or empty. + exists on the remote host, and is not a regular file. + The secure copy execution request was rejected by the server. + + + + Downloads the specified directory from the remote host to local directory. + + Remote host directory name. + Local directory information. + is null or empty. + is null. + File or directory with the specified path does not exist on the remote host. + The secure copy execution request was rejected by the server. + + + + Uploads the and + of the next file or directory to upload. + + The channel to perform the upload in. + A from which any feedback from the server can be read. + The file or directory to upload. + + + + Upload the files and subdirectories in the specified directory. + + The channel to perform the upload in. + A from which any feedback from the server can be read. + The directory to upload. + + + + Sets mode and name of the directory being upload. - + - Initializes a with the specified key. - - The key. - - - - Initializes a with the specified key and size of the computed hash code. - - The key. - The size, in bits, of the computed hash code. - - - - Gets the size, in bits, of the computed hash code. - - - The size, in bits, of the computed hash code. - - - - - Finalizes the hash computation after the last data is processed by the cryptographic stream object. + Return a value indicating whether the specified path is a valid SCP file path. + The path to verify. - The computed hash code. + if is a valid SCP file path; otherwise, . + + To match OpenSSH behavior (introduced as a result of CVE-2018-20685), a file path is considered + invalid in any of the following conditions: + + + is a zero-length string. + + + is ".". + + + is "..". + + + contains a forward slash (/). + + + - + - Computes a Hash-based Message Authentication Code (HMAC) by using the hash function. + Represents the abstract base class from which all implementations of algorithms must inherit. - + - Initializes a with the specified key. + Gets algorithm name. - The key. - - - Initializes a with the specified key and size of the computed hash code. - - The key. - The size, in bits, of the computed hash code. + + Copy constructor. This will copy the state of the provided + message digest. - - - Gets the size, in bits, of the computed hash code. - - - The size, in bits, of the computed hash code. - + + interface that a message digest conforms to. - + + return the algorithm name + + @return the algorithm name + + + return the size, in bytes, of the digest produced by this message digest. + + @return the size, in bytes, of the digest produced by this message digest. + + + return the size, in bytes, of the internal buffer used by this digest. + + @return the size, in bytes, of the internal buffer used by this digest. + + + update the message digest with a single byte. + + @param inByte the input byte to be entered. + + + update the message digest with a block of bytes. + + @param input the byte array containing the data. + @param inOff the offset into the byte array where the data starts. + @param len the length of the data. + + + Close the digest, producing the final digest value. The doFinal + call leaves the digest reset. + + @param output the array the digest is to be copied into. + @param outOff the offset into the out array the digest is to start at. + + + reset the digest back to it's initial state. + + + The base class for parameters to key generators. + + + initialise the generator with a source of randomness + and a strength (in bits). + + @param random the random byte source. + @param strength the size, in bits, of the keys we want to produce. + + + return the random source associated with this + generator. + + @return the generators random source. + + + return the bit strength for keys produced by this generator, + + @return the strength of the keys this generator produces (in bits). + + + Generic interface for objects generating random bytes. + + + Add more seed material to the generator. + A byte array to be mixed into the generator's state. + + + Add more seed material to the generator. + A long value to be mixed into the generator's state. + + + Fill byte array with random values. + Array to be filled. + + + Fill byte array with random values. + Array to receive bytes. + Index to start filling at. + Length of segment to fill. + + + return a = a + b - b preserved. + + + unsigned comparison on two arrays - note the arrays may + start with leading zeros. + + + return z = x / y - done in place (z value preserved, x contains the + remainder) + + + return whether or not a BigInteger is probably prime with a + probability of 1 - (1/2)**certainty. +

From Knuth Vol 2, pg 395.

+
+ + Calculate the numbers u1, u2, and u3 such that: + + u1 * a + u2 * b = u3 + + where u3 is the greatest common divider of a and b. + a and b using the extended Euclid algorithm (refer p. 323 + of The Art of Computer Programming vol 2, 2nd ed). + This also seems to have the side effect of calculating + some form of multiplicative inverse. + + @param a First number to calculate gcd for + @param b Second number to calculate gcd for + @param u1Out the return object for the u1 value + @return The greatest common divisor of a and b + + + return w with w = x * x - w is assumed to have enough space. + + + return x with x = y * z - x is assumed to have enough space. + + + Calculate mQuote = -m^(-1) mod b with b = 2^32 (32 = word size) + + + Montgomery multiplication: a = x * y * R^(-1) mod m +
+ Based algorithm 14.36 of Handbook of Applied Cryptography. +
+
  • m, x, y should have length n
  • +
  • a should have length (n + 1)
  • +
  • b = 2^32, R = b^n
  • +
    + The result is put in x +
    + NOTE: the indices of x, y, m, a different in HAC and in Java +
    + + return x = x % y - done in place (y value preserved) + + + do a left shift - this returns a new array. + + + do a right shift - this does it in place. + + + do a right shift by one - this does it in place. + + + returns x = x - y - we assume x is >= y + + + Class representing a simple version of a big decimal. A + SimpleBigDecimal is basically a + {@link java.math.BigInteger BigInteger} with a few digits on the right of + the decimal point. The number of (binary) digits on the right of the decimal + point is called the scale of the SimpleBigDecimal. + Unlike in {@link java.math.BigDecimal BigDecimal}, the scale is not adjusted + automatically, but must be set manually. All SimpleBigDecimals + taking part in the same arithmetic operation must have equal scale. The + result of a multiplication of two SimpleBigDecimals returns a + SimpleBigDecimal with double scale. + + + Returns a SimpleBigDecimal representing the same numerical + value as value. + @param value The value of the SimpleBigDecimal to be + created. + @param scale The scale of the SimpleBigDecimal to be + created. + @return The such created SimpleBigDecimal. + + + Constructor for SimpleBigDecimal. The value of the + constructed SimpleBigDecimal Equals bigInt / + 2scale. + @param bigInt The bigInt value parameter. + @param scale The scale of the constructed SimpleBigDecimal. + + + Class holding methods for point multiplication based on the window + τ-adic nonadjacent form (WTNAF). The algorithms are based on the + paper "Improved Algorithms for Arithmetic on Anomalous Binary Curves" + by Jerome A. Solinas. The paper first appeared in the Proceedings of + Crypto 1997. + + + The window width of WTNAF. The standard value of 4 is slightly less + than optimal for running time, but keeps space requirements for + precomputation low. For typical curves, a value of 5 or 6 results in + a better running time. When changing this value, the + αu's must be computed differently, see + e.g. "Guide to Elliptic Curve Cryptography", Darrel Hankerson, + Alfred Menezes, Scott Vanstone, Springer-Verlag New York Inc., 2004, + p. 121-122 + + + 24 + + + The αu's for a=0 as an array + of ZTauElements. + + + The αu's for a=0 as an array + of TNAFs. + + + The αu's for a=1 as an array + of ZTauElements. + + + The αu's for a=1 as an array + of TNAFs. + + + Computes the norm of an element λ of + Z[τ]. + @param mu The parameter μ of the elliptic curve. + @param lambda The element λ of + Z[τ]. + @return The norm of λ. + + + Computes the norm of an element λ of + R[τ], where λ = u + vτ + and u and u are real numbers (elements of + R). + @param mu The parameter μ of the elliptic curve. + @param u The real part of the element λ of + R[τ]. + @param v The τ-adic part of the element + λ of R[τ]. + @return The norm of λ. + + + Rounds an element λ of R[τ] + to an element of Z[τ], such that their difference + has minimal norm. λ is given as + λ = λ0 + λ1τ. + @param lambda0 The component λ0. + @param lambda1 The component λ1. + @param mu The parameter μ of the elliptic curve. Must + equal 1 or -1. + @return The rounded element of Z[τ]. + @throws ArgumentException if lambda0 and + lambda1 do not have same scale. + + + Approximate division by n. For an integer + k, the value λ = s k / n is + computed to c bits of accuracy. + @param k The parameter k. + @param s The curve parameter s0 or + s1. + @param vm The Lucas Sequence element Vm. + @param a The parameter a of the elliptic curve. + @param m The bit length of the finite field + Fm. + @param c The number of bits of accuracy, i.e. the scale of the returned + SimpleBigDecimal. + @return The value λ = s k / n computed to + c bits of accuracy. + + + Computes the τ-adic NAF (non-adjacent form) of an + element λ of Z[τ]. + @param mu The parameter μ of the elliptic curve. + @param lambda The element λ of + Z[τ]. + @return The τ-adic NAF of λ. + + + Applies the operation τ() to an + AbstractF2mPoint. + @param p The AbstractF2mPoint to which τ() is applied. + @return τ(p) + + + Returns the parameter μ of the elliptic curve. + @param curve The elliptic curve from which to obtain μ. + The curve must be a Koblitz curve, i.e. a Equals + 0 or 1 and b Equals + 1. + @return μ of the elliptic curve. + @throws ArgumentException if the given ECCurve is not a Koblitz + curve. + + + Calculates the Lucas Sequence elements Uk-1 and + Uk or Vk-1 and + Vk. + @param mu The parameter μ of the elliptic curve. + @param k The index of the second element of the Lucas Sequence to be + returned. + @param doV If set to true, computes Vk-1 and + Vk, otherwise Uk-1 and + Uk. + @return An array with 2 elements, containing Uk-1 + and Uk or Vk-1 + and Vk. + + + Computes the auxiliary value tw. If the width is + 4, then for mu = 1, tw = 6 and for + mu = -1, tw = 10 + @param mu The parameter μ of the elliptic curve. + @param w The window width of the WTNAF. + @return the auxiliary value tw + + + Computes the auxiliary values s0 and + s1 used for partial modular reduction. + @param curve The elliptic curve for which to compute + s0 and s1. + @throws ArgumentException if curve is not a + Koblitz curve (Anomalous Binary Curve, ABC). + + + Partial modular reduction modulo + m - 1)/(τ - 1). + @param k The integer to be reduced. + @param m The bitlength of the underlying finite field. + @param a The parameter a of the elliptic curve. + @param s The auxiliary values s0 and + s1. + @param mu The parameter μ of the elliptic curve. + @param c The precision (number of bits of accuracy) of the partial + modular reduction. + @return ρ := k partmod (τm - 1)/(τ - 1) + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by a BigInteger using the reduced τ-adic + NAF (RTNAF) method. + @param p The AbstractF2mPoint to Multiply. + @param k The BigInteger by which to Multiply p. + @return k * p + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by an element λ of Z[τ] + using the τ-adic NAF (TNAF) method. + @param p The AbstractF2mPoint to Multiply. + @param lambda The element λ of + Z[τ]. + @return λ * p + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by an element λ of Z[τ] + using the τ-adic NAF (TNAF) method, given the TNAF + of λ. + @param p The AbstractF2mPoint to Multiply. + @param u The the TNAF of λ.. + @return λ * p + + + Computes the [τ]-adic window NAF of an element + λ of Z[τ]. + @param mu The parameter μ of the elliptic curve. + @param lambda The element λ of + Z[τ] of which to compute the + [τ]-adic NAF. + @param width The window width of the resulting WNAF. + @param pow2w 2width. + @param tw The auxiliary value tw. + @param alpha The αu's for the window width. + @return The [τ]-adic window NAF of + λ. + + + Does the precomputation for WTNAF multiplication. + @param p The ECPoint for which to do the precomputation. + @param a The parameter a of the elliptic curve. + @return The precomputation array for p. + + + Class representing an element of Z[τ]. Let + λ be an element of Z[τ]. Then + λ is given as λ = u + vτ. The + components u and v may be used directly, there + are no accessor methods. + Immutable class. + + + The "real" part of λ. + + + The "τ-adic" part of λ. + + + Constructor for an element λ of + Z[τ]. + @param u The "real" part of λ. + @param v The "τ-adic" part of + λ. + + + Simple shift-and-add multiplication. Serves as reference implementation + to verify (possibly faster) implementations, and for very small scalars. + + @param p + The point to multiply. + @param k + The multiplier. + @return The result of the point multiplication kP. + + + Base class for an elliptic curve. + + + Compute a PreCompInfo for a point on this curve, under a given name. Used by + ECMultipliers to save the precomputation for this ECPoint for use + by subsequent multiplication. + + @param point + The ECPoint to store precomputations for. + @param name + A String used to index precomputations of different types. + @param callback + Called to calculate the PreCompInfo. + + + Normalization ensures that any projective coordinate is 1, and therefore that the x, y + coordinates reflect those of the equivalent point in an affine coordinate system. Where more + than one point is to be normalized, this method will generally be more efficient than + normalizing each point separately. + + @param points + An array of points that will be updated in place with their normalized versions, + where necessary + + + Normalization ensures that any projective coordinate is 1, and therefore that the x, y + coordinates reflect those of the equivalent point in an affine coordinate system. Where more + than one point is to be normalized, this method will generally be more efficient than + normalizing each point separately. An (optional) z-scaling factor can be applied; effectively + each z coordinate is scaled by this value prior to normalization (but only one + actual multiplication is needed). + + @param points + An array of points that will be updated in place with their normalized versions, + where necessary + @param off + The start of the range of points to normalize + @param len + The length of the range of points to normalize + @param iso + The (optional) z-scaling factor - can be null + + + Create a cache-safe lookup table for the specified sequence of points. All the points MUST + belong to this ECCurve instance, and MUST already be normalized. + + + Sets the default ECMultiplier, unless already set. + + + Decode a point on this curve from its ASN.1 encoding. The different + encodings are taken account of, including point compression for + Fp (X9.62 s 4.2.1 pg 17). + @return The decoded point. + + + Elliptic curve over Fp + + + The auxiliary values s0 and + s1 used for partial modular reduction for + Koblitz curves. + + + Solves a quadratic equation z2 + z = beta(X9.62 + D.1.6) The other solution is z + 1. + + @param beta + The value to solve the quadratic equation for. + @return the solution for z2 + z = beta or + null if no solution exists. + + + @return the auxiliary values s0 and + s1 used for partial modular reduction for + Koblitz curves. + + + Returns true if this is a Koblitz curve (ABC curve). + @return true if this is a Koblitz curve (ABC curve), false otherwise + + + Elliptic curves over F2m. The Weierstrass equation is given by + y2 + xy = x3 + ax2 + b. + + + The exponent m of F2m. + + + TPB: The integer k where xm + + xk + 1 represents the reduction polynomial + f(z).
    + PPB: The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + TPB: Always set to 0
    + PPB: The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + TPB: Always set to 0
    + PPB: The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + The point at infinity on this curve. + + + Constructor for Trinomial Polynomial Basis (TPB). + @param m The exponent m of + F2m. + @param k The integer k where xm + + xk + 1 represents the reduction + polynomial f(z). + @param a The coefficient a in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param b The coefficient b in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + + + Constructor for Trinomial Polynomial Basis (TPB). + @param m The exponent m of + F2m. + @param k The integer k where xm + + xk + 1 represents the reduction + polynomial f(z). + @param a The coefficient a in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param b The coefficient b in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param order The order of the main subgroup of the elliptic curve. + @param cofactor The cofactor of the elliptic curve, i.e. + #Ea(F2m) = h * n. + + + Constructor for Pentanomial Polynomial Basis (PPB). + @param m The exponent m of + F2m. + @param k1 The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k2 The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k3 The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param a The coefficient a in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param b The coefficient b in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + + + Constructor for Pentanomial Polynomial Basis (PPB). + @param m The exponent m of + F2m. + @param k1 The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k2 The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k3 The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param a The coefficient a in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param b The coefficient b in the Weierstrass equation + for non-supersingular elliptic curves over + F2m. + @param order The order of the main subgroup of the elliptic curve. + @param cofactor The cofactor of the elliptic curve, i.e. + #Ea(F2m) = h * n. + + + Return true if curve uses a Trinomial basis. + + @return true if curve Trinomial, false otherwise. + + + return the field name for this field. + + @return the string "Fp". + + + return a sqrt root - the routine verifies that the calculation + returns the right value - if none exists it returns null. + + + Class representing the Elements of the finite field + F2m in polynomial basis (PB) + representation. Both trinomial (Tpb) and pentanomial (Ppb) polynomial + basis representations are supported. Gaussian normal basis (GNB) + representation is not supported. + + + Indicates gaussian normal basis representation (GNB). Number chosen + according to X9.62. GNB is not implemented at present. + + + Indicates trinomial basis representation (Tpb). Number chosen + according to X9.62. + + + Indicates pentanomial basis representation (Ppb). Number chosen + according to X9.62. + + + Tpb or Ppb. + + + The exponent m of F2m. + + + The LongArray holding the bits. + + + Constructor for Ppb. + @param m The exponent m of + F2m. + @param k1 The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k2 The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param k3 The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z). + @param x The BigInteger representing the value of the field element. + + + Constructor for Tpb. + @param m The exponent m of + F2m. + @param k The integer k where xm + + xk + 1 represents the reduction + polynomial f(z). + @param x The BigInteger representing the value of the field element. + + + Checks, if the ECFieldElements a and b + are elements of the same field F2m + (having the same representation). + @param a field element. + @param b field element to be compared. + @throws ArgumentException if a and b + are not elements of the same field + F2m (having the same + representation). + + + @return the representation of the field + F2m, either of + {@link F2mFieldElement.Tpb} (trinomial + basis representation) or + {@link F2mFieldElement.Ppb} (pentanomial + basis representation). + + + @return the degree m of the reduction polynomial + f(z). + + + @return Tpb: The integer k where xm + + xk + 1 represents the reduction polynomial + f(z).
    + Ppb: The integer k1 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + @return Tpb: Always returns 0
    + Ppb: The integer k2 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + @return Tpb: Always set to 0
    + Ppb: The integer k3 where xm + + xk3 + xk2 + xk1 + 1 + represents the reduction polynomial f(z).
    +
    + + base class for points on elliptic curves. + + + Returns the affine x-coordinate after checking that this point is normalized. + + @return The affine x-coordinate of this point + @throws IllegalStateException if the point is not normalized + + + Returns the affine y-coordinate after checking that this point is normalized + + @return The affine y-coordinate of this point + @throws IllegalStateException if the point is not normalized + + + Returns the x-coordinate. + + Caution: depending on the curve's coordinate system, this may not be the same value as in an + affine coordinate system; use Normalize() to get a point where the coordinates have their + affine values, or use AffineXCoord if you expect the point to already have been normalized. + + @return the x-coordinate of this point + + + Returns the y-coordinate. + + Caution: depending on the curve's coordinate system, this may not be the same value as in an + affine coordinate system; use Normalize() to get a point where the coordinates have their + affine values, or use AffineYCoord if you expect the point to already have been normalized. + + @return the y-coordinate of this point + + + Normalization ensures that any projective coordinate is 1, and therefore that the x, y + coordinates reflect those of the equivalent point in an affine coordinate system. + + @return a new ECPoint instance representing the same point, but with normalized coordinates + + + return the field element encoded with point compression. (S 4.3.6) + + + Multiplies this ECPoint by the given number. + @param k The multiplicator. + @return k * this. + + + Elliptic curve points over Fp + + + Create a point which encodes without point compression. + + @param curve the curve to use + @param x affine x co-ordinate + @param y affine y co-ordinate + + + Create a point that encodes with or without point compression. + + @param curve the curve to use + @param x affine x co-ordinate + @param y affine y co-ordinate + @param withCompression if true encode with point compression + + + Elliptic curve points over F2m + + + @param curve base curve + @param x x point + @param y y point + + + @param curve base curve + @param x x point + @param y y point + @param withCompression true if encode with point compression. + + + Interface for classes encapsulating a point multiplication algorithm + for ECPoints. + + + Multiplies the ECPoint p by k, i.e. + p is added k times to itself. + @param p The ECPoint to be multiplied. + @param k The factor by which p is multiplied. + @return p multiplied by k. + + + Class holding precomputation data for fixed-point multiplications. + + + Lookup table for the precomputed ECPoints used for a fixed point multiplication. + + + The width used for the precomputation. If a larger width precomputation + is already available this may be larger than was requested, so calling + code should refer to the actual width. + + + Interface for classes storing precomputation data for multiplication + algorithms. Used as a Memento (see GOF patterns) for + WNafMultiplier. + + + Class implementing the WNAF (Window Non-Adjacent Form) multiplication + algorithm. + + + Multiplies this by an integer k using the + Window NAF method. + @param k The integer by which this is multiplied. + @return A new ECPoint which equals this + multiplied by k. + + + Determine window width to use for a scalar multiplication of the given size. + + @param bits the bit-length of the scalar to multiply by + @return the window size to use + + + Class holding precomputation data for the WNAF (Window Non-Adjacent Form) + algorithm. + + + Array holding the precomputed ECPoints used for a Window + NAF multiplication. + + + Array holding the negations of the precomputed ECPoints used + for a Window NAF multiplication. + + + Holds an ECPoint representing Twice(this). Used for the + Window NAF multiplication to create or extend the precomputed values. + + + Computes the Window NAF (non-adjacent Form) of an integer. + @param width The width w of the Window NAF. The width is + defined as the minimal number w, such that for any + w consecutive digits in the resulting representation, at + most one is non-zero. + @param k The integer of which the Window NAF is computed. + @return The Window NAF of the given width, such that the following holds: + k = &sum;i=0l-1 ki2i + , where the ki denote the elements of the + returned byte[]. + + + Determine window width to use for a scalar multiplication of the given size. + + @param bits the bit-length of the scalar to multiply by + @return the window size to use + + + Determine window width to use for a scalar multiplication of the given size. + + @param bits the bit-length of the scalar to multiply by + @param windowSizeCutoffs a monotonically increasing list of bit sizes at which to increment the window width + @return the window size to use + + + Class implementing the WTNAF (Window + τ-adic Non-Adjacent Form) algorithm. + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by k using the reduced τ-adic NAF (RTNAF) + method. + @param p The AbstractF2mPoint to multiply. + @param k The integer by which to multiply k. + @return p multiplied by k. + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by an element λ of Z[τ] using + the τ-adic NAF (TNAF) method. + @param p The AbstractF2mPoint to multiply. + @param lambda The element λ of + Z[τ] of which to compute the + [τ]-adic NAF. + @return p multiplied by λ. + + + Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + by an element λ of Z[τ] + using the window τ-adic NAF (TNAF) method, given the + WTNAF of λ. + @param p The AbstractF2mPoint to multiply. + @param u The the WTNAF of λ.. + @return λ * p + + + Class holding precomputation data for the WTNAF (Window + τ-adic Non-Adjacent Form) algorithm. + + + Array holding the precomputed AbstractF2mPoints used for the + WTNAF multiplication in + {@link org.bouncycastle.math.ec.multiplier.WTauNafMultiplier.multiply() + WTauNafMultiplier.multiply()}. + + + + Utility class for creating IDigest objects from their names/Oids + + + + Use the specified instance of IRandomGenerator as random source. + + This constructor performs no seeding of either the IRandomGenerator or the + constructed SecureRandom. It is the responsibility of the client to provide + proper seed material as necessary/appropriate for the given IRandomGenerator + implementation. + + The source to generate all random bytes from. + + + base constructor. + + + create a SecurityUtilityException with the given message. + + @param message the message to be carried with the exception. + + + General array utilities. + + - Finalizes the hash computation after the last data is processed by the cryptographic stream object. + Are two arrays equal. - - The computed hash code. - + Left side. + Right side. + True if equal. + + + + A constant time equals comparison - does not terminate early if + test will fail. + + first array + second array + true if arrays equal, false otherwise. + + + Make a copy of a range of bytes from the passed in data array. The range can + extend beyond the end of the input array, in which case the return array will + be padded with zeroes. + + @param data the array from which the data is to be copied. + @param from the start index at which the copying should take place. + @param to the final index of the range (exclusive). + + @return a new byte array containing the range given. + + + BigInteger utilities. + + + Return the passed in value as an unsigned byte array. + + @param value value to be converted. + @return a byte array without a leading zero byte if present in the signed encoding. + + + Return the passed in value as an unsigned byte array of specified length, zero-extended as necessary. + + @param length desired length of result array. + @param n value to be converted. + @return a byte array of specified length, with leading zeroes as necessary given the size of n. + + + Return a random BigInteger not less than 'min' and not greater than 'max' + + @param min the least value that may be generated + @param max the greatest value that may be generated + @param random the source of randomness + @return a random BigInteger value in the range [min,max] + + + + Class to decode and encode Hex. + + + + encode the input data producing a Hex encoded byte array. + + @return a byte array containing the Hex encoded data. + + + encode the input data producing a Hex encoded byte array. + + @return a byte array containing the Hex encoded data. + + + Hex encode the byte data writing it to the given output stream. + + @return the number of bytes produced. + + + Hex encode the byte data writing it to the given output stream. + + @return the number of bytes produced. + + + decode the Hex encoded input data. It is assumed the input data is valid. + + @return a byte array representing the decoded data. + + + decode the Hex encoded string data - whitespace will be ignored. + + @return a byte array representing the decoded data. + + + decode the Hex encoded string data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + encode the input data producing a Hex output stream. + + @return the number of bytes produced. + + + decode the Hex encoded byte data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + decode the Hex encoded string data writing it to the given output stream, + whitespace characters will be ignored. + + @return the number of bytes produced. + + + + Produce a copy of this object with its configuration and in its current state. + + + The returned object may be used simply to store the state, or may be used as a similar object + starting from the copied state. + + + + + Restore a copied object state into this object. + + + Implementations of this method should try to avoid or minimise memory allocation to perform the reset. + + an object originally {@link #copy() copied} from an object of the same type as this instance. + if the provided object is not of the correct type. + if the other parameter is in some other way invalid. + + + Exception to be thrown on a failure to reset an object implementing Memoable. +

    + The exception extends InvalidCastException to enable users to have a single handling case, + only introducing specific handling of this one if required. +

    +
    + + Basic Constructor. + + @param msg message to be associated with this exception. + + + + Implements certificate support for host algorithm. + + + + + Gets the host key data. + + + + + Initializes a new instance of the class. + + The host key name. + + + + Signs the specified data. + + The data. + Signed data. + + + + + Verifies the signature. + + The data. + The signature. + true if signature was successfully verified; otherwise false. + @@ -9696,6 +12743,222 @@ The minimum data size. + + BCrypt implementation. + + + BCrypt implements OpenBSD-style Blowfish password hashing using the scheme described in + "A Future- + Adaptable Password Scheme" by Niels Provos and David Mazieres. + + + This password hashing system tries to thwart off-line password cracking using a + computationally-intensive hashing algorithm, based on Bruce Schneier's Blowfish cipher. + The work factor of the algorithm is parameterised, so it can be increased as computers + get faster. + + + Usage is really simple. To hash a password for the first time, call the method with a random salt, like this: + + string pw_hash = BCrypt.HashPassword(plain_password); + + To check whether a plaintext password matches one that has been hashed previously, + use the method: + + + if (BCrypt.Verify(candidate_password, stored_hash)) + Console.WriteLine("It matches"); + else + Console.WriteLine("It does not match"); + + + The method takes an optional parameter (workFactor) that + determines the computational complexity of the hashing: + + + string strong_salt = BCrypt.GenerateSalt(10); + string stronger_salt = BCrypt.GenerateSalt(12); + + + The amount of work increases exponentially (2^workFactor), so each increment is twice + as much work. The default workFactor is 10, and the valid range is 4 to 31. + + + + + + Hash a string using the OpenBSD bcrypt scheme and a salt generated by . + + Just an alias for HashPassword. + The string to hash. + The hashed string. + + + + Hash a string using the OpenBSD bcrypt scheme and a salt generated by . + + Just an alias for HashPassword. + The string to hash. + The log2 of the number of rounds of hashing to apply - the work + factor therefore increases as 2^workFactor. + The hashed string. + + + + Hash a password using the OpenBSD bcrypt scheme and a salt generated by . + + The password to hash. + The hashed password. + + + + Hash a password using the OpenBSD bcrypt scheme and a salt generated by using the given . + + The password to hash. + The log2 of the number of rounds of hashing to apply - the work + factor therefore increases as 2^workFactor. + The hashed password. + + + Hash a password using the OpenBSD bcrypt scheme. + Thrown when one or more arguments have unsupported or + illegal values. + The password to hash. + the salt to hash with (perhaps generated using BCrypt.gensalt). + The hashed password + + + + Generate a salt for use with the method. + + The log2 of the number of rounds of hashing to apply - the work + factor therefore increases as 2**workFactor. + A base64 encoded salt value. + + + + Generate a salt for use with the method + selecting a reasonable default for the number of hashing rounds to apply. + + A base64 encoded salt value. + + + + Verifies that the hash of the given matches the provided + + + The text to verify. + The previously-hashed password. + true if the passwords match, false otherwise. + + + + Encode a byte array using bcrypt's slightly-modified base64 encoding scheme. Note that this + is *not* compatible with the standard MIME-base64 encoding. + + Thrown when one or more arguments have unsupported or + illegal values. + The byte array to encode. + The number of bytes to encode. + Base64-encoded string. + + + + Decode a string encoded using bcrypt's base64 scheme to a byte array. Note that this is *not* + compatible with the standard MIME-base64 encoding. + + Thrown when one or more arguments have unsupported or + illegal values. + The string to decode. + The maximum bytes to decode. + The decoded byte array. + + + + Look up the 3 bits base64-encoded by the specified character, range-checking against + conversion table. + + The base64-encoded value. + The decoded value of x. + + + Blowfish encipher a single 64-bit block encoded as two 32-bit halves. + An array containing the two 32-bit half blocks. + The position in the array of the blocks. + + + Cycically extract a word of key material. + The string to extract the data from. + [in,out] The current offset. + The next word of material from data. + + + Initializes the Blowfish key schedule. + + + Key the Blowfish cipher. + The key byte array. + + + + Perform the "enhanced key schedule" step described by Provos and Mazieres in "A Future- + Adaptable Password Scheme" http://www.openbsd.org/papers/bcrypt-paper.ps. + + Salt byte array. + Input byte array. + + + Perform the central hashing step in the bcrypt scheme. + Thrown when one or more arguments have unsupported or + illegal values. + The input byte array to hash. + The salt byte array to hash with. + The binary logarithm of the number of rounds of hashing to apply. + A byte array containing the hashed result. + + + Compatibility with new OpenBSD function. + Ported from SSHJ library (https://github.com/hierynomus/sshj) + + + + Applies the Bcrypt kdf to derive a key and iv from the passphrase, + the key/iv are returned in the output variable. + Ported from the SSHJ library. https://github.com/hierynomus/sshj + + + + + + + + + Appends multiple byte arrays into one array. + + + + + + + Exception for signalling parse errors. + + + Default constructor. + + + Initializes a new instance of . + The message. + + + Initializes a new instance of . + The message. + The inner exception. + Base class for block cipher implementations. @@ -10121,35 +13384,35 @@ The first of the three processing functions for the encryption and decryption. - The input to be processed. - The mask to be used from Km[n]. - The rotation value to be used. + The input to be processed. + The mask to be used from Km[n]. + The rotation value to be used. The second of the three processing functions for the encryption and decryption. - The input to be processed. - The mask to be used from Km[n]. - The rotation value to be used. + The input to be processed. + The mask to be used from Km[n]. + The rotation value to be used. The third of the three processing functions for the encryption and decryption. - The input to be processed. - The mask to be used from Km[n]. - The rotation value to be used. + The input to be processed. + The mask to be used from Km[n]. + The rotation value to be used. Does the 16 rounds to encrypt the block. - The LH-32bits of the plaintext block. - The RH-32bits of the plaintext block. + The LH-32bits of the plaintext block. + The RH-32bits of the plaintext block. The result. @@ -10960,6 +14223,274 @@ is reclaimed by garbage collection. + + + Implements ECDSA digital signature algorithm. + + + + + Initializes a new instance of the class. + + The ECDSA key. + is null. + + + + Verifies the signature. + + The input. + The signature. + + true if signature was successfully verified; otherwise false. + + + + + Creates the signature. + + The input. + + Signed input data. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + + + + Implements ECDSA digital signature algorithm. + + + + + Initializes a new instance of the class. + + The ED25519Key key. + is null. + + + + Verifies the signature. + + The input. + The signature. + + true if signature was successfully verified; otherwise false. + + Invalid signature. + + + + Creates the signature. + + The input. + + Signed input data. + + Invalid ED25519Key key. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + + + + Computes a Hash-based Message Authentication Code (HMAC) by using the hash function. + + + + + Initializes a with the specified key. + + The key. + + + + Initializes a with the specified key and size of the computed hash code. + + The key. + The size, in bits, of the computed hash code. + + + + Gets the size, in bits, of the computed hash code. + + + The size, in bits, of the computed hash code. + + + + + Finalizes the hash computation after the last data is processed by the cryptographic stream object. + + + The computed hash code. + + + + + Computes a Hash-based Message Authentication Code (HMAC) by using the hash function. + + + + + Initializes a with the specified key. + + The key. + + + + Initializes a with the specified key and size of the computed hash code. + + The key. + The size, in bits, of the computed hash code. + + + + Gets the size, in bits, of the computed hash code. + + + The size, in bits, of the computed hash code. + + + + + Finalizes the hash computation after the last data is processed by the cryptographic stream object. + + + The computed hash code. + + + + + Computes a Hash-based Message Authentication Code (HMAC) by using the hash function. + + + + + Initializes a with the specified key. + + The key. + + + + Initializes a with the specified key and size of the computed hash code. + + The key. + The size, in bits, of the computed hash code. + + + + Gets the size, in bits, of the computed hash code. + + + The size, in bits, of the computed hash code. + + + + + Finalizes the hash computation after the last data is processed by the cryptographic stream object. + + + The computed hash code. + + + + + Computes a Hash-based Message Authentication Code (HMAC) by using the hash function. + + + + + Initializes a with the specified key. + + The key. + + + + Initializes a with the specified key and size of the computed hash code. + + The key. + The size, in bits, of the computed hash code. + + + + Gets the size, in bits, of the computed hash code. + + + The size, in bits, of the computed hash code. + + + + + Finalizes the hash computation after the last data is processed by the cryptographic stream object. + + + The computed hash code. + + + + + Computes a Hash-based Message Authentication Code (HMAC) by using the hash function. + + + + + Initializes a with the specified key. + + The key. + + + + Initializes a with the specified key and size of the computed hash code. + + The key. + The size, in bits, of the computed hash code. + + + + Gets the size, in bits, of the computed hash code. + + + The size, in bits, of the computed hash code. + + + + + Finalizes the hash computation after the last data is processed by the cryptographic stream object. + + + The computed hash code. + + Implements RSA digital signature algorithm. @@ -11052,217 +14583,6 @@ The number of bytes decrypted. - - - Gets the size of the message in bytes. - - - The size of the messages in bytes. - - - - - Represents a key exchange algorithm. - - - - - Occurs when the host key is received. - - - - - Gets the name of the algorithm. - - - The name of the algorithm. - - - - - Gets the exchange hash. - - - The exchange hash. - - - - - Starts the key exchange algorithm. - - The session. - Key exchange init message. - - - - Finishes the key exchange algorithm. - - - - - Creates the client-side cipher to use. - - - The client cipher. - - - - - Creates the server-side cipher to use. - - - The server cipher. - - - - - Creates the server-side hash algorithm to use. - - - The server hash algorithm. - - - - - Creates the client-side hash algorithm to use. - - - The client hash algorithm. - - - - - Creates the compression algorithm to use to deflate data. - - - The compression method to deflate data. - - - - - Creates the compression algorithm to use to inflate data. - - - The compression method to inflate data. - - - - - Base class for "diffie-hellman-group-exchange" algorithms. - - - - - Calculates key exchange hash value. - - - Key exchange hash. - - - - - Starts key exchange algorithm - - The session. - Key exchange init message. - - - - Finishes key exchange algorithm. - - - - - Represents "diffie-hellman-group1-sha1" algorithm implementation. - - - - - Gets the group prime. - - - The group prime. - - - - - Gets the size, in bits, of the computed hash code. - - - The size, in bits, of the computed hash code. - - - - - Calculates key exchange hash value. - - - Key exchange hash. - - - - - Starts key exchange algorithm - - The session. - Key exchange init message. - - - - Finishes key exchange algorithm. - - - - - Gets the size of the message in bytes. - - - The size of the messages in bytes. - - - - - Represents the abstract base class from which all implementations of algorithms must inherit. - - - - - Gets algorithm name. - - - - - Implements certificate support for host algorithm. - - - - - Gets the host key data. - - - - - Initializes a new instance of the class. - - The host key name. - - - - Signs the specified data. - - The data. - Signed data. - - - - - Verifies the signature. - - The data. - The signature. - true if signature was successfully verified; otherwise false. - - Contains DSA private and public key @@ -11352,6 +14672,153 @@ is reclaimed by garbage collection. + + + Contains ECDSA (ecdsa-sha2-nistp{256,384,521}) private and public key + + + + + Gets the SSH name of the ECDSA Key + + + + + Gets the HashAlgorithm to use + + + + + Gets the length of the key. + + + The length of the key. + + + + + Gets the digital signature. + + + + + Gets or sets the public. + + + The public. + + + + + Gets ECDsa Object + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The curve name + Value of publickey + Value of privatekey + + + + Initializes a new instance of the class. + + DER encoded private key data. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + + + + Contains ED25519 private and public key + + + + + Gets the Key String. + + + + + Gets or sets the public. + + + The public. + + + + + Gets the length of the key. + + + The length of the key. + + + + + Gets the digital signature. + + + + + Gets the PublicKey Bytes + + + + + Gets the PrivateKey Bytes + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + pk data. + sk data. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + Base class for asymmetric cipher algorithms @@ -11516,6 +14983,14 @@ is reclaimed by garbage collection. + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + Base class for SSH host algorithms. @@ -11552,6 +15027,92 @@ The signature. True is signature was successfully verifies; otherwise false. + + + Represents a key exchange algorithm. + + + + + Occurs when the host key is received. + + + + + Gets the name of the algorithm. + + + The name of the algorithm. + + + + + Gets the exchange hash. + + + The exchange hash. + + + + + Starts the key exchange algorithm. + + The session. + Key exchange init message. + + + + Finishes the key exchange algorithm. + + + + + Creates the client-side cipher to use. + + + The client cipher. + + + + + Creates the server-side cipher to use. + + + The server cipher. + + + + + Creates the server-side hash algorithm to use. + + + The server hash algorithm. + + + + + Creates the client-side hash algorithm to use. + + + The client hash algorithm. + + + + + Creates the compression algorithm to use to deflate data. + + + The compression method to deflate data. + + + + + Creates the compression algorithm to use to inflate data. + + + The compression method to inflate data. + + Represents base class for different key exchange algorithm implementations @@ -11668,7 +15229,7 @@ The message. - + Generates the session key. @@ -11678,7 +15239,7 @@ The size. - + Generates the session key. @@ -11688,7 +15249,7 @@ The session id. - + Gets the size of the message in bytes. @@ -11696,7 +15257,7 @@ The size of the messages in bytes. - + Gets the size of the message in bytes. @@ -11799,7 +15360,7 @@ Populates the client exchange value. - + Handles the server DH reply message. @@ -11830,6 +15391,44 @@ The group prime. + + + Represents "diffie-hellman-group14-sha256" algorithm implementation. + + + + + https://tools.ietf.org/html/rfc2409#section-6.2 + + + + + Gets algorithm name. + + + + + Gets the group prime. + + + The group prime. + + + + + Represents "diffie-hellman-group16-sha512" algorithm implementation. + + + + + https://tools.ietf.org/html/rfc3526#section-5 + + + + + Gets algorithm name. + + Represents "diffie-hellman-group1-sha1" algorithm implementation. @@ -11866,6 +15465,15 @@ The size, in bits, of the computed hash code. + + + Hashes the specified data bytes. + + The hash data. + + Hashed bytes + + Represents "diffie-hellman-group-exchange-sha256" algorithm implementation. @@ -11893,6 +15501,345 @@ Hashed bytes + + + Base class for "diffie-hellman-group-exchange" algorithms. + + + + + Calculates key exchange hash value. + + + Key exchange hash. + + + + + Starts key exchange algorithm + + The session. + Key exchange init message. + + + + Finishes key exchange algorithm. + + + + + Represents "diffie-hellman-group1-sha1" algorithm implementation. + + + + + Gets the size, in bits, of the computed hash code. + + + The size, in bits, of the computed hash code. + + + + + Hashes the specified data bytes. + + The hash data. + + Hashed bytes + + + + + Base class for "diffie-hellman" SHA-256 group algorithm implementations. + + + + + Gets the size, in bits, of the computed hash code. + + + The size, in bits, of the computed hash code. + + + + + Hashes the specified data bytes. + + The hash data. + + Hashed bytes + + + + + Base class for "diffie-hellman" SHA-512 group algorithm implementations. + + + + + Gets the size, in bits, of the computed hash code. + + + The size, in bits, of the computed hash code. + + + + + Hashes the specified data bytes. + + The hash data. + + Hashed bytes + + + + + Gets the group prime. + + + The group prime. + + + + + Calculates key exchange hash value. + + + Key exchange hash. + + + + + Starts key exchange algorithm + + The session. + Key exchange init message. + + + + Finishes key exchange algorithm. + + + + + Specifies client payload + + + + + Specifies server payload + + + + + Specifies client exchange. + + + + + Specifies server exchange. + + + + + Specifies host key data. + + + + + Specifies signature data. + + + + + Gets the size, in bits, of the computed hash code. + + + The size, in bits, of the computed hash code. + + + + + Calculates key exchange hash value. + + + Key exchange hash. + + + + + Validates the exchange hash. + + + true if exchange hash is valid; otherwise false. + + + + + Starts key exchange algorithm + + The session. + Key exchange init message. + + + + Gets algorithm name. + + + + + Gets the size, in bits, of the computed hash code. + + + The size, in bits, of the computed hash code. + + + + + Starts key exchange algorithm + + The session. + Key exchange init message. + + + + Finishes key exchange algorithm. + + + + + Hashes the specified data bytes. + + The hash data. + + Hashed bytes + + + + + Handles the server DH reply message. + + The host key. + The server exchange value. + The signature. + + + + Gets the parameter of the curve. + + + The parameter of the curve. + + + + + Starts key exchange algorithm + + The session. + Key exchange init message. + + + + Finishes key exchange algorithm. + + + + + Handles the server DH reply message. + + The host key. + The server exchange value. + The signature. + + + + Gets algorithm name. + + + + + Gets Curve Parameter. + + + + + Gets the size, in bits, of the computed hash code. + + + The size, in bits, of the computed hash code. + + + + + Hashes the specified data bytes. + + The hash data. + + Hashed bytes + + + + + Gets algorithm name. + + + + + Gets Curve Parameter. + + + + + Gets the size, in bits, of the computed hash code. + + + The size, in bits, of the computed hash code. + + + + + Hashes the specified data bytes. + + The hash data. + + Hashed bytes + + + + + Gets algorithm name. + + + + + Gets Curve Parameter. + + + + + Gets the size, in bits, of the computed hash code. + + + The size, in bits, of the computed hash code. + + + + + Hashes the specified data bytes. + + The hash data. + + Hashed bytes + + + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + Implements key support for host algorithm. @@ -12089,6 +16036,2258 @@ An . + + + Provides functionality to connect and interact with SSH server. + + + + + Specifies an infinite waiting period. + + + The value of this field is -1 millisecond. + + + + + Specifies an infinite waiting period. + + + The value of this field is -1. + + + + + Specifies maximum packet size defined by the protocol. + + + 68536 (64 KB + 3000 bytes). + + + + + Holds the initial local window size for the channels. + + + 2147483647 (2^31 - 1) bytes. + + + We currently do not define a maximum (remote) window size. + + + + + Holds the maximum size of channel data packets that we receive. + + + 64 KB. + + + + This is the maximum size (in bytes) we support for the data (payload) of a + SSH_MSG_CHANNEL_DATA message we receive. + + + We currently do not enforce this limit. + + + + + + Controls how many authentication attempts can take place at the same time. + + + Some server may restrict number to prevent authentication attacks + + + + + Holds metada about session messages + + + + + Holds a that is signaled when the message listener loop has completed. + + + + + Specifies outbound packet number + + + + + Specifies incoming packet number + + + + + WaitHandle to signal that last service request was accepted + + + + + WaitHandle to signal that exception was thrown by another thread. + + + + + WaitHandle to signal that key exchange was completed. + + + + + WaitHandle to signal that key exchange is in progress. + + + + + Exception that need to be thrown by waiting thread + + + + + Specifies whether connection is authenticated + + + + + Specifies whether user issued Disconnect command or not + + + + + Holds the factory to use for creating new services. + + + + + Holds connection socket. + + + + + Holds an object that is used to ensure only a single thread can read from + at any given time. + + + + + Holds an object that is used to ensure only a single thread can write to + at any given time. + + + This is also used to ensure that is + incremented atomatically. + + + + + Holds an object that is used to ensure only a single thread can dispose + at any given time. + + + This is also used to ensure that will not be disposed + while performing a given operation or set of operations on . + + + + + Gets the session semaphore that controls session channels. + + + The session semaphore. + + + + + Gets the next channel number. + + + The next channel number. + + + + + Gets a value indicating whether the session is connected. + + + true if the session is connected; otherwise, false. + + + This methods returns true in all but the following cases: + + + The is disposed. + + + The SSH_MSG_DISCONNECT message - which is used to disconnect from the server - has been sent. + + + The client has not been authenticated successfully. + + + The listener thread - which is used to receive messages from the server - has stopped. + + + The socket used to communicate with the server is no longer connected. + + + + + + + Gets the session id. + + + The session id, or null if the client has not been authenticated. + + + + + Gets the client init message. + + The client init message. + + + + Gets or sets the server version string. + + The server version. + + + + Gets or sets the client version string. + + The client version. + + + + Gets or sets the connection info. + + The connection info. + + + + Occurs when an error occurred. + + + + + Occurs when session has been disconnected from the server. + + + + + Occurs when host key received. + + + + + Occurs when message is received from the server. + + + + + Occurs when message is received from the server. + + + + + Occurs when message is received from the server. + + + + + Occurs when message is received from the server. + + + + + Occurs when message is received from the server. + + + + + Occurs when message is received from the server. + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when a message is received from the SSH server. + + + + + Occurs when a message is received from the SSH server. + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Occurs when message received + + + + + Initializes a new instance of the class. + + The connection info. + The factory to use for creating new services. + is null. + is null. + + + + Connects to the server. + + Socket connection to the SSH server or proxy server could not be established, or an error occurred while resolving the hostname. + SSH session could not be established. + Authentication of SSH session failed. + Failed to establish proxy connection. + + + + Disconnects from the server. + + + This sends a SSH_MSG_DISCONNECT message to the server, waits for the + server to close the socket on its end and subsequently closes the client socket. + + + + + Waits for the specified handle or the exception handle for the receive thread + to signal within the connection timeout. + + The wait handle. + A received package was invalid or failed the message integrity check. + None of the handles are signaled in time and the session is not disconnecting. + A socket error was signaled while receiving messages from the server. + + When neither handles are signaled in time and the session is not closing, then the + session is disconnected. + + + + + Waits for the specified handle or the exception handle for the receive thread + to signal within the specified timeout. + + The wait handle. + The time to wait for any of the handles to become signaled. + A received package was invalid or failed the message integrity check. + None of the handles are signaled in time and the session is not disconnecting. + A socket error was signaled while receiving messages from the server. + + When neither handles are signaled in time and the session is not closing, then the + session is disconnected. + + + + + Waits for the specified handle or the exception handle for the receive thread + to signal within the connection timeout. + + The wait handle. + A received package was invalid or failed the message integrity check. + None of the handles are signaled in time and the session is not disconnecting. + A socket error was signaled while receiving messages from the server. + + When neither handles are signaled in time and the session is not closing, then the + session is disconnected. + + + + + Waits for the specified to receive a signal, using a + to specify the time interval. + + The that should be signaled. + A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. + + A . + + + + + Waits for the specified to receive a signal, using a + to specify the time interval. + + The that should be signaled. + A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. + When this method returns , contains the . + + A . + + + + + Waits for the specified to receive a signal, using a + to specify the time interval. + + The that should be signaled. + A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. + When this method returns , contains the . + + A . + + + + + Waits for the specified handle or the exception handle for the receive thread + to signal within the specified timeout. + + The wait handle. + The time to wait for any of the handles to become signaled. + A received package was invalid or failed the message integrity check. + None of the handles are signaled in time and the session is not disconnecting. + A socket error was signaled while receiving messages from the server. + + + + Sends a message to the server. + + The message to send. + The client is not connected. + The operation timed out. + The size of the packet exceeds the maximum size defined by the protocol. + + + + Sends an SSH packet to the server. + + A byte array containing the packet to send. + The offset of the packet. + The length of the packet. + Client is not connected to the server. + + + The send is performed in a dispose lock to avoid + and/or when sending the packet. + + + This method is only to be used when the connection is established, as the locking + overhead is not required while establising the connection. + + + + + + Sends a message to the server. + + The message to send. + + true if the message was sent to the server; otherwise, false. + + The size of the packet exceeds the maximum size defined by the protocol. + + This methods returns false when the attempt to send the message results in a + or a . + + + + + Receives the message from the server. + + + The incoming SSH message, or null if the connection with the SSH server was closed. + + + We need no locking here since all messages are read by a single thread. + + + + + Called when received. + + message. + + + + Called when received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when client is disconnecting from the server. + + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Called when message received. + + message. + + + + Registers SSH message with the session. + + The name of the message to register with the session. + + + + Unregister SSH message from the session. + + The name of the message to unregister with the session. + + + + Loads a message from a given buffer. + + An array of bytes from which to construct the message. + The zero-based byte offset in at which to begin reading. + The number of bytes to load. + + A message constructed from . + + The type of the message is not supported. + + + + Establishes a socket connection to the specified host and port. + + The host name of the server to connect to. + The port to connect to. + The connection failed to establish within the configured . + An error occurred trying to establish the connection. + + + + Performs a blocking read on the socket until bytes are received. + + The to read from. + An array of type that is the storage location for the received data. + The position in parameter to store the received data. + The number of bytes to read. + + The number of bytes read. + + The socket is closed. + The read has timed-out. + The read failed. + + + + Gets a value indicating whether the socket is connected. + + + true if the socket is connected; otherwise, false. + + + + As a first check we verify whether is + true. However, this only returns the state of the socket as of + the last I/O operation. + + + Therefore we use the combination of with mode + and to verify if the socket is still connected. + + + The MSDN doc mention the following on the return value of + with mode : + + + true if data is available for reading; + + + true if the connection has been closed, reset, or terminated; otherwise, returns false. + + + + + Conclusion: when the return value is true - but no data is available for reading - then + the socket is no longer connected. + + + When a is used from multiple threads, there's a race condition + between the invocation of and the moment + when the value of is obtained. To workaround this issue + we synchronize reads from the . + + + + + + Performs a blocking read on the socket until bytes are received. + + The to read from. + An array of type that is the storage location for the received data. + The position in parameter to store the received data. + The number of bytes to read. + + The number of bytes read. + + The read has timed-out. + The read failed. + + + + Performs a blocking read on the socket until a line is read. + + The to read from. + A that represents the time to wait until a line is read. + The read has timed-out. + An error occurred when trying to access the socket. + + The line read from the socket, or null when the remote server has shutdown and all data has been received. + + + + + Shuts down and disposes the socket. + + + + + Listens for incoming message from the server and handles them. This method run as a task on separate thread. + + + + + https://tools.ietf.org/html/rfc1929 + + + + + Raises the event. + + The . + + + + Resets connection-specific information to ensure state of a previous connection + does not affect new connections. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Releases unmanaged resources and performs other cleanup operations before the + is reclaimed by garbage collection. + + + + + Gets or sets the connection info. + + The connection info. + + + + Create a new SSH session channel. + + + A new SSH session channel. + + + + + Create a new channel for a locally forwarded TCP/IP port. + + + A new channel for a locally forwarded TCP/IP port. + + + + + Creates a "forwarded-tcpip" SSH channel. + + + A new "forwarded-tcpip" SSH channel. + + + + + Sends a message to the server. + + The message to send. + The client is not connected. + The operation timed out. + The size of the packet exceeds the maximum size defined by the protocol. + + + + Sends a message to the server. + + The message to send. + + true if the message was sent to the server; otherwise, false. + + The size of the packet exceeds the maximum size defined by the protocol. + + This methods returns false when the attempt to send the message results in a + or a . + + + + + Represents the result of a wait operations. + + + + + The was signaled within the specified interval. + + + + + The was not signaled within the specified interval. + + + + + The session is in a disconnected state. + + + + + The session is in a failed state. + + + + + Implementation of the SSH File Transfer Protocol (SFTP) over SSH. + + + + + Holds the instance that is used to communicate to the + SFTP server. + + + + + Holds the operation timeout. + + + + + Holds the size of the buffer. + + + + + Gets or sets the operation timeout. + + + The timeout to wait until an operation completes. The default value is negative + one (-1) milliseconds, which indicates an infinite timeout period. + + The method was called after the client was disposed. + represents a value that is less than -1 or greater than milliseconds. + + + + Gets or sets the maximum size of the buffer in bytes. + + + The size of the buffer. The default buffer size is 32768 bytes (32 KB). + + + + For write operations, this limits the size of the payload for + individual SSH_FXP_WRITE messages. The actual size is always + capped at the maximum packet size supported by the peer + (minus the size of protocol fields). + + + For read operations, this controls the size of the payload which + is requested from the peer in a SSH_FXP_READ message. The peer + will send the requested number of bytes in a SSH_FXP_DATA message, + possibly split over multiple SSH_MSG_CHANNEL_DATA messages. + + + To optimize the size of the SSH packets sent by the peer, + the actual requested size will take into account the size of the + SSH_FXP_DATA protocol fields. + + + The size of the each indivual SSH_FXP_DATA message is limited to the + local maximum packet size of the channel, which is set to 64 KB + for SSH.NET. However, the peer can limit this even further. + + + The method was called after the client was disposed. + + + + Gets remote working directory. + + Client is not connected. + The method was called after the client was disposed. + + + + Gets sftp protocol version. + + Client is not connected. + The method was called after the client was disposed. + + + + Gets the current SFTP session. + + + The current SFTP session. + + + + + Initializes a new instance of the class. + + The connection info. + is null. + + + + Initializes a new instance of the class. + + Connection host. + Connection port. + Authentication username. + Authentication password. + is null. + is invalid. -or- is null or contains only whitespace characters. + is not within and . + + + + Initializes a new instance of the class. + + Connection host. + Authentication username. + Authentication password. + is null. + is invalid. -or- is null contains only whitespace characters. + + + + Initializes a new instance of the class. + + Connection host. + Connection port. + Authentication username. + Authentication private key file(s) . + is null. + is invalid. -or- is nunullll or contains only whitespace characters. + is not within and . + + + + Initializes a new instance of the class. + + Connection host. + Authentication username. + Authentication private key file(s) . + is null. + is invalid. -or- is null or contains only whitespace characters. + + + + Initializes a new instance of the class. + + The connection info. + Specified whether this instance owns the connection info. + is null. + + If is true, the connection info will be disposed when this + instance is disposed. + + + + + Initializes a new instance of the class. + + The connection info. + Specified whether this instance owns the connection info. + The factory to use for creating new services. + is null. + is null. + + If is true, the connection info will be disposed when this + instance is disposed. + + + + + Changes remote directory to path. + + New directory path. + is null. + Client is not connected. + Permission to change directory denied by remote host. -or- A SSH command was denied by the server. + was not found on the remote host. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + + + Changes permissions of file(s) to specified mode. + + File(s) path, may match multiple files. + The mode. + is null. + Client is not connected. + Permission to change permission on the path(s) was denied by the remote host. -or- A SSH command was denied by the server. + was not found on the remote host. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + + + Creates remote directory specified by path. + + Directory path to create. + is null or contains only whitespace characters. + Client is not connected. + Permission to create the directory was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + + + Deletes remote directory specified by path. + + Directory to be deleted path. + is null or contains only whitespace characters. + Client is not connected. + was not found on the remote host. + Permission to delete the directory was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + + + Deletes remote file specified by path. + + File to be deleted path. + is null or contains only whitespace characters. + Client is not connected. + was not found on the remote host. + Permission to delete the file was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + + + Renames remote file from old path to new path. + + Path to the old file location. + Path to the new file location. + is null. -or- or is null. + Client is not connected. + Permission to rename the file was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + + + Renames remote file from old path to new path. + + Path to the old file location. + Path to the new file location. + if set to true then perform a posix rename. + is null. -or- or is null. + Client is not connected. + Permission to rename the file was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + + + Creates a symbolic link from old path to new path. + + The old path. + The new path. + is null. -or- is null or contains only whitespace characters. + Client is not connected. + Permission to create the symbolic link was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + + + Retrieves list of files in remote directory. + + The path. + The list callback. + + A list of files. + + is null. + Client is not connected. + Permission to list the contents of the directory was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + + + Begins an asynchronous operation of retrieving list of files in remote directory. + + The path. + The method to be called when the asynchronous write operation is completed. + A user-provided object that distinguishes this particular asynchronous write request from other requests. + The list callback. + + An that references the asynchronous operation. + + The method was called after the client was disposed. + + + + Ends an asynchronous operation of retrieving list of files in remote directory. + + The pending asynchronous SFTP request. + + A list of files. + + The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . + + + + Gets reference to remote file or directory. + + The path. + + A reference to file object. + + Client is not connected. + was not found on the remote host. + is null. + The method was called after the client was disposed. + + + + Checks whether file or directory exists; + + The path. + + true if directory or file exists; otherwise false. + + is null or contains only whitespace characters. + Client is not connected. + Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + + + Downloads remote file specified by the path into the stream. + + File to download. + Stream to write the file into. + The download callback. + is null. + is null or contains only whitespace characters. + Client is not connected. + Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. + was not found on the remote host./// + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. + + + + + Begins an asynchronous file downloading into the stream. + + The path. + The output. + + An that references the asynchronous operation. + + is null. + is null or contains only whitespace characters. + Client is not connected. + Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. + + + + + Begins an asynchronous file downloading into the stream. + + The path. + The output. + The method to be called when the asynchronous write operation is completed. + + An that references the asynchronous operation. + + is null. + is null or contains only whitespace characters. + Client is not connected. + Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. + + + + + Begins an asynchronous file downloading into the stream. + + The path. + The output. + The method to be called when the asynchronous write operation is completed. + A user-provided object that distinguishes this particular asynchronous write request from other requests. + The download callback. + + An that references the asynchronous operation. + + is null. + is null or contains only whitespace characters. + The method was called after the client was disposed. + + Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. + + + + + Ends an asynchronous file downloading into the stream. + + The pending asynchronous SFTP request. + The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . + Client is not connected. + Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. + The path was not found on the remote host. + A SSH error where is the message from the remote host. + + + + Uploads stream into remote file. + + Data input stream. + Remote file path. + The upload callback. + is null. + is null or contains only whitespace characters. + Client is not connected. + Permission to upload the file was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. + + + + + Uploads stream into remote file. + + Data input stream. + Remote file path. + if set to true then existing file will be overwritten. + The upload callback. + is null. + is null or contains only whitespace characters. + Client is not connected. + Permission to upload the file was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. + + + + + Begins an asynchronous uploading the stream into remote file. + + Data input stream. + Remote file path. + + An that references the asynchronous operation. + + is null. + is null or contains only whitespace characters. + Client is not connected. + Permission to list the contents of the directory was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + + Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. + + + If the remote file already exists, it is overwritten and truncated. + + + + + + Begins an asynchronous uploading the stream into remote file. + + Data input stream. + Remote file path. + The method to be called when the asynchronous write operation is completed. + + An that references the asynchronous operation. + + is null. + is null or contains only whitespace characters. + Client is not connected. + Permission to list the contents of the directory was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + + Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. + + + If the remote file already exists, it is overwritten and truncated. + + + + + + Begins an asynchronous uploading the stream into remote file. + + Data input stream. + Remote file path. + The method to be called when the asynchronous write operation is completed. + A user-provided object that distinguishes this particular asynchronous write request from other requests. + The upload callback. + + An that references the asynchronous operation. + + is null. + is null or contains only whitespace characters. + Client is not connected. + Permission to list the contents of the directory was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + The method was called after the client was disposed. + + + Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. + + + If the remote file already exists, it is overwritten and truncated. + + + + + + Begins an asynchronous uploading the stream into remote file. + + Data input stream. + Remote file path. + Specified whether an existing file can be overwritten. + The method to be called when the asynchronous write operation is completed. + A user-provided object that distinguishes this particular asynchronous write request from other requests. + The upload callback. + + An that references the asynchronous operation. + + is null. + is null or contains only whitespace characters. + The method was called after the client was disposed. + + + Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. + + + When refers to an existing file, set to true to overwrite and truncate that file. + If is false, the upload will fail and will throw an + . + + + + + + Ends an asynchronous uploading the stream into remote file. + + The pending asynchronous SFTP request. + The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . + Client is not connected. + The directory of the file was not found on the remote host. + Permission to upload the file was denied by the remote host. -or- A SSH command was denied by the server. + A SSH error where is the message from the remote host. + + + + Gets status using statvfs@openssh.com request. + + The path. + + A instance that contains file status information. + + Client is not connected. + is null. + The method was called after the client was disposed. + + + + Appends lines to a file, creating the file if it does not already exist. + + The file to append the lines to. The file is created if it does not already exist. + The lines to append to the file. + isnull -or- is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + The characters are written to the file using UTF-8 encoding without a Byte-Order Mark (BOM) + + + + + Appends lines to a file by using a specified encoding, creating the file if it does not already exist. + + The file to append the lines to. The file is created if it does not already exist. + The lines to append to the file. + The character encoding to use. + is null. -or- is null. -or- is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + + + Appends the specified string to the file, creating the file if it does not already exist. + + The file to append the specified string to. + The string to append to the file. + is null. -or- is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + The characters are written to the file using UTF-8 encoding without a Byte-Order Mark (BOM). + + + + + Appends the specified string to the file, creating the file if it does not already exist. + + The file to append the specified string to. + The string to append to the file. + The character encoding to use. + is null. -or- is null. -or- is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + + + Creates a that appends UTF-8 encoded text to the specified file, + creating the file if it does not already exist. + + The path to the file to append to. + + A that appends text to a file using UTF-8 encoding without a + Byte-Order Mark (BOM). + + is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + + + Creates a that appends text to a file using the specified + encoding, creating the file if it does not already exist. + + The path to the file to append to. + The character encoding to use. + + A that appends text to a file using the specified encoding. + + is null. -or- is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + + + Creates or overwrites a file in the specified path. + + The path and name of the file to create. + + A that provides read/write access to the file specified in path. + + is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + If the target file already exists, it is first truncated to zero bytes. + + + + + Creates or overwrites the specified file. + + The path and name of the file to create. + The maximum number of bytes buffered for reads and writes to the file. + + A that provides read/write access to the file specified in path. + + is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + If the target file already exists, it is first truncated to zero bytes. + + + + + Creates or opens a file for writing UTF-8 encoded text. + + The file to be opened for writing. + + A that writes text to a file using UTF-8 encoding without + a Byte-Order Mark (BOM). + + is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + + If the target file already exists, it is overwritten. It is not first truncated to zero bytes. + + + If the target file does not exist, it is created. + + + + + + Creates or opens a file for writing text using the specified encoding. + + The file to be opened for writing. + The character encoding to use. + + A that writes to a file using the specified encoding. + + is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + + If the target file already exists, it is overwritten. It is not first truncated to zero bytes. + + + If the target file does not exist, it is created. + + + + + + Deletes the specified file or directory. + + The name of the file or directory to be deleted. Wildcard characters are not supported. + is null. + Client is not connected. + was not found on the remote host. + The method was called after the client was disposed. + + + + Returns the date and time the specified file or directory was last accessed. + + The file or directory for which to obtain access date and time information. + + A structure set to the date and time that the specified file or directory was last accessed. + This value is expressed in local time. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last accessed. + + The file or directory for which to obtain access date and time information. + + A structure set to the date and time that the specified file or directory was last accessed. + This value is expressed in UTC time. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Returns the date and time the specified file or directory was last written to. + + The file or directory for which to obtain write date and time information. + + A structure set to the date and time that the specified file or directory was last written to. + This value is expressed in local time. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last written to. + + The file or directory for which to obtain write date and time information. + + A structure set to the date and time that the specified file or directory was last written to. + This value is expressed in UTC time. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Opens a on the specified path with read/write access. + + The file to open. + A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten. + + An unshared that provides access to the specified file, with the specified mode and read/write access. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Opens a on the specified path, with the specified mode and access. + + The file to open. + A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten. + A value that specifies the operations that can be performed on the file. + + An unshared that provides access to the specified file, with the specified mode and access. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Opens an existing file for reading. + + The file to be opened for reading. + + A read-only on the specified path. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Opens an existing UTF-8 encoded text file for reading. + + The file to be opened for reading. + + A on the specified path. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Opens a file for writing. + + The file to be opened for writing. + + An unshared object on the specified path with access. + + is null. + Client is not connected. + The method was called after the client was disposed. + + If the file does not exist, it is created. + + + + + Opens a binary file, reads the contents of the file into a byte array, and closes the file. + + The file to open for reading. + + A byte array containing the contents of the file. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Opens a text file, reads all lines of the file using UTF-8 encoding, and closes the file. + + The file to open for reading. + + A string array containing all lines of the file. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Opens a file, reads all lines of the file with the specified encoding, and closes the file. + + The file to open for reading. + The encoding applied to the contents of the file. + + A string array containing all lines of the file. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Opens a text file, reads all lines of the file with the UTF-8 encoding, and closes the file. + + The file to open for reading. + + A string containing all lines of the file. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Opens a file, reads all lines of the file with the specified encoding, and closes the file. + + The file to open for reading. + The encoding applied to the contents of the file. + + A string containing all lines of the file. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Reads the lines of a file with the UTF-8 encoding. + + The file to read. + + The lines of the file. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Read the lines of a file that has a specified encoding. + + The file to read. + The encoding that is applied to the contents of the file. + + The lines of the file. + + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Sets the date and time the specified file was last accessed. + + The file for which to set the access date and time information. + A containing the value to set for the last access date and time of path. This value is expressed in local time. + + + + Sets the date and time, in coordinated universal time (UTC), that the specified file was last accessed. + + The file for which to set the access date and time information. + A containing the value to set for the last access date and time of path. This value is expressed in UTC time. + + + + Sets the date and time that the specified file was last written to. + + The file for which to set the date and time information. + A containing the value to set for the last write date and time of path. This value is expressed in local time. + + + + Sets the date and time, in coordinated universal time (UTC), that the specified file was last written to. + + The file for which to set the date and time information. + A containing the value to set for the last write date and time of path. This value is expressed in UTC time. + + + + Writes the specified byte array to the specified file, and closes the file. + + The file to write to. + The bytes to write to the file. + is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + + If the target file already exists, it is overwritten. It is not first truncated to zero bytes. + + + If the target file does not exist, it is created. + + + + + + Writes a collection of strings to the file using the UTF-8 encoding, and closes the file. + + The file to write to. + The lines to write to the file. + is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + + The characters are written to the file using UTF-8 encoding without a Byte-Order Mark (BOM). + + + If the target file already exists, it is overwritten. It is not first truncated to zero bytes. + + + If the target file does not exist, it is created. + + + + + + Write the specified string array to the file using the UTF-8 encoding, and closes the file. + + The file to write to. + The string array to write to the file. + is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + + The characters are written to the file using UTF-8 encoding without a Byte-Order Mark (BOM). + + + If the target file already exists, it is overwritten. It is not first truncated to zero bytes. + + + If the target file does not exist, it is created. + + + + + + Writes a collection of strings to the file using the specified encoding, and closes the file. + + The file to write to. + The lines to write to the file. + The character encoding to use. + is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + + If the target file already exists, it is overwritten. It is not first truncated to zero bytes. + + + If the target file does not exist, it is created. + + + + + + Writes the specified string array to the file by using the specified encoding, and closes the file. + + The file to write to. + The string array to write to the file. + An object that represents the character encoding applied to the string array. + is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + + If the target file already exists, it is overwritten. It is not first truncated to zero bytes. + + + If the target file does not exist, it is created. + + + + + + Writes the specified string to the file using the UTF-8 encoding, and closes the file. + + The file to write to. + The string to write to the file. + is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + + The characters are written to the file using UTF-8 encoding without a Byte-Order Mark (BOM). + + + If the target file already exists, it is overwritten. It is not first truncated to zero bytes. + + + If the target file does not exist, it is created. + + + + + + Writes the specified string to the file using the specified encoding, and closes the file. + + The file to write to. + The string to write to the file. + The encoding to apply to the string. + is null. + Client is not connected. + The specified path is invalid, or its directory was not found on the remote host. + The method was called after the client was disposed. + + + If the target file already exists, it is overwritten. It is not first truncated to zero bytes. + + + If the target file does not exist, it is created. + + + + + + Gets the of the file on the path. + + The path to the file. + + The of the file on the path. + + is null. + Client is not connected. + was not found on the remote host. + The method was called after the client was disposed. + + + + Sets the specified of the file on the specified path. + + The path to the file. + The desired . + is null. + Client is not connected. + The method was called after the client was disposed. + + + + Synchronizes the directories. + + The source path. + The destination path. + The search pattern. + + A list of uploaded files. + + is null. + is null or contains only whitespace. + was not found on the remote host. + + + + Begins the synchronize directories. + + The source path. + The destination path. + The search pattern. + The async callback. + The state. + + An that represents the asynchronous directory synchronization. + + is null. + is null or contains only whitespace. + + + + Ends the synchronize directories. + + The async result. + + A list of uploaded files. + + The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . + The destination path was not found on the remote host. + + + + Internals the list directory. + + The path. + The list callback. + + A list of files in the specfied directory. + + is null. + Client not connected. + + + + Internals the download file. + + The path. + The output. + An that references the asynchronous request. + The download callback. + is null. + is null or contains whitespace. + Client not connected. + + + + Internals the upload file. + + The input. + The path. + The flags. + An that references the asynchronous request. + The upload callback. + is null. + is null or contains whitespace. + Client not connected. + + + + Called when client is connected to the server. + + + + + Called when client is disconnecting from the server. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + SSH_FXF_READ + + + + + SSH_FXF_WRITE + + + + + SSH_FXF_APPEND + + + + + SSH_FXF_CREAT + + + + + SSH_FXF_TRUNC + + + + + SSH_FXF_EXCL + + Gets the SFTP protocol version. @@ -12417,36 +18616,6 @@ Currently, we do not take the remote window size into account. - - - SSH_FXF_READ - - - - - SSH_FXF_WRITE - - - - - SSH_FXF_APPEND - - - - - SSH_FXF_CREAT - - - - - SSH_FXF_TRUNC - - - - - SSH_FXF_EXCL - - Gets the size of the message in bytes. @@ -12463,7 +18632,15 @@ The size of the messages in bytes. - + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + + Gets the size of the message in bytes. @@ -12479,22 +18656,6 @@ The size of the messages in bytes. - - - Gets the size of the message in bytes. - - - The size of the messages in bytes. - - - - - Gets the size of the message in bytes. - - - The size of the messages in bytes. - - Gets the size of the message in bytes. @@ -12503,6 +18664,14 @@ The size of the messages in bytes. + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + Gets the size of the message in bytes. @@ -12666,6 +18835,14 @@ The size of the messages in bytes. + + + Gets the size of the message in bytes. + + + The size of the messages in bytes. + + Gets the zero-based offset (in bytes) relative to the beginning of the file that the write @@ -12701,14 +18878,6 @@ The length (in bytes) of the data to write. - - - Gets the size of the message in bytes. - - - The size of the messages in bytes. - - Encapsulates the results of an asynchronous download operation. @@ -14339,3912 +20508,6 @@ SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK - - - Provides additional information for asynchronous command execution - - - - - Initializes a new instance of the class. - - The async callback. - The state. - - - - Provides functionality to perform keyboard interactive authentication. - - - - - Gets authentication method name - - - - - Occurs when server prompts for more authentication information. - - - - - Initializes a new instance of the class. - - The username. - is whitespace or null. - - - - Authenticates the specified session. - - The session to authenticate. - Result of authentication process. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Releases unmanaged resources and performs other cleanup operations before the - is reclaimed by garbage collection. - - - - - Provides connection information when keyboard interactive authentication method is used - - - - - - - - Occurs when server prompts for more authentication information. - - - - - - - - Initializes a new instance of the class. - - The host. - The username. - - - - Initializes a new instance of the class. - - The host. - The port. - The username. - - - - Initializes a new instance of the class. - - Connection host. - Connection port. - Connection username. - Type of the proxy. - The proxy host. - The proxy port. - - - - Initializes a new instance of the class. - - Connection host. - Connection port. - Connection username. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Type of the proxy. - The proxy host. - The proxy port. - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - The proxy password. - - - - Initializes a new instance of the class. - - Connection host. - Connection port. - Connection username. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - The proxy password. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Releases unmanaged resources and performs other cleanup operations before the - is reclaimed by garbage collection. - - - - - Provides functionality for "none" authentication method - - - - - Gets connection name - - - - - Initializes a new instance of the class. - - The username. - is whitespace or null. - - - - Authenticates the specified session. - - The session. - - Result of authentication process. - - is null. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Releases unmanaged resources and performs other cleanup operations before the - is reclaimed by garbage collection. - - - - - Provides functionality to perform password authentication. - - - - - Gets authentication method name - - - - - Gets the password as a sequence of bytes. - - - The password as a sequence of bytes. - - - - - Occurs when user's password has expired and needs to be changed. - - - - - Initializes a new instance of the class. - - The username. - The password. - is whitespace or null. - is null. - - - - Initializes a new instance of the class. - - The username. - The password. - is whitespace or null. - is null. - - - - Authenticates the specified session. - - The session to authenticate. - - Result of authentication process. - - is null. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Releases unmanaged resources and performs other cleanup operations before the - is reclaimed by garbage collection. - - - - - Specifies behavior for expected expression - - - - - Gets the expected regular expression. - - - - - Gets the action to perform when expected expression is found. - - - - - Initializes a new instance of the class. - - The expect regular expression. - The action to perform. - or is null. - - - - Initializes a new instance of the class. - - The expect expression. - The action to perform. - or is null. - - - - Provides functionality for forwarding connections from the client to destination servers via the SSH server, - also known as dynamic port forwarding. - - - - - Gets the bound host. - - - - - Gets the bound port. - - - - - Gets a value indicating whether port forwarding is started. - - - true if port forwarding is started; otherwise, false. - - - - - Initializes a new instance of the class. - - The port. - - - - Initializes a new instance of the class. - - The host. - The port. - - - - Starts local port forwarding. - - - - - Stops local port forwarding, and waits for the specified timeout until all pending - requests are processed. - - The maximum amount of time to wait for pending requests to finish processing. - - - - Ensures the current instance is not disposed. - - The current instance is disposed. - - - - Interrupts the listener, and unsubscribes from events. - - - - - Waits for pending channels to close. - - The maximum time to wait for the pending channels to close. - - - - Holds a value indicating whether the current instance is disposed. - - - true if the current instance is disposed; otherwise, false. - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Releases unmanaged resources and performs other cleanup operations before the - is reclaimed by garbage collection. - - - - - Initializes the . - - - - When the port is started for the first time, a is created with an initial count - of 1. - - - On subsequent (re)starts, we'll dispose the current and create a new one with - initial count of 1. - - - - - - Reads a null terminated string from a socket. - - The to read from. - The timeout to apply to individual reads. - - The read, or null when the socket was closed. - - - - - Provides functionality for local port forwarding - - - - - Initializes the . - - - - When the port is started for the first time, a is created with an initial count - of 1. - - - On subsequent (re)starts, we'll dispose the current and create a new one with - initial count of 1. - - - - - - Gets the bound host. - - - - - Gets the bound port. - - - - - Gets the forwarded host. - - - - - Gets the forwarded port. - - - - - Gets a value indicating whether port forwarding is started. - - - true if port forwarding is started; otherwise, false. - - - - - Initializes a new instance of the class. - - The bound port. - The host. - The port. - is greater than . - is null. - is greater than . - - - - - - - Initializes a new instance of the class. - - The bound host. - The host. - The port. - is null. - is null. - is greater than . - - - - Initializes a new instance of the class. - - The bound host. - The bound port. - The host. - The port. - is null. - is null. - is greater than . - is greater than . - - - - Starts local port forwarding. - - - - - Stops local port forwarding, and waits for the specified timeout until all pending - requests are processed. - - The maximum amount of time to wait for pending requests to finish processing. - - - - Ensures the current instance is not disposed. - - The current instance is disposed. - - - - Interrupts the listener, and unsubscribes from events. - - - - - Waits for pending channels to close. - - The maximum time to wait for the pending channels to close. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Releases unmanaged resources and performs other cleanup operations before the - is reclaimed by garbage collection. - - - - - Provides connection information when password authentication method is used - - - - - - - - - - Occurs when user's password has expired and needs to be changed. - - - - - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Connection password. - - - - is null. - is invalid, or is null or contains only whitespace characters. - - - - Initializes a new instance of the class. - - Connection host. - Connection port. - Connection username. - Connection password. - is null. - is invalid, or is null or contains only whitespace characters. - is not within and . - - - - Initializes a new instance of the class. - - Connection host. - The port. - Connection username. - Connection password. - Type of the proxy. - The proxy host. - The proxy port. - - - - Initializes a new instance of the class. - - Connection host. - The port. - Connection username. - Connection password. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Connection password. - Type of the proxy. - The proxy host. - The proxy port. - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Connection password. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Connection password. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - The proxy password. - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Connection password. - - - - Initializes a new instance of the class. - - Connection host. - Connection port. - Connection username. - Connection password. - is null. - is invalid, or is null or contains only whitespace characters. - is not within and . - - - - Initializes a new instance of the class. - - Connection host. - The port. - Connection username. - Connection password. - Type of the proxy. - The proxy host. - The proxy port. - - - - Initializes a new instance of the class. - - Connection host. - The port. - Connection username. - Connection password. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Connection password. - Type of the proxy. - The proxy host. - The proxy port. - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Connection password. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Connection password. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - The proxy password. - - - - Initializes a new instance of the class. - - Connection host. - The port. - Connection username. - Connection password. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - The proxy password. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Releases unmanaged resources and performs other cleanup operations before the - is reclaimed by garbage collection. - - - - - Provides functionality to perform private key authentication. - - - - - Gets authentication method name - - - - - Gets the key files used for authentication. - - - - - Initializes a new instance of the class. - - The username. - The key files. - is whitespace or null. - - - - Authenticates the specified session. - - The session to authenticate. - - Result of authentication process. - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Releases unmanaged resources and performs other cleanup operations before the - is reclaimed by garbage collection. - - - - - Provides connection information when private key authentication method is used - - - - - - - - Gets the key files used for authentication. - - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Connection key files. - - - - - - - - Initializes a new instance of the class. - - Connection host. - Connection port. - Connection username. - Connection key files. - - - - Initializes a new instance of the class. - - Connection host. - The port. - Connection username. - Type of the proxy. - The proxy host. - The proxy port. - The key files. - - - - Initializes a new instance of the class. - - Connection host. - The port. - Connection username. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - The key files. - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Type of the proxy. - The proxy host. - The proxy port. - The key files. - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - The key files. - - - - Initializes a new instance of the class. - - Connection host. - Connection username. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - The proxy password. - The key files. - - - - Initializes a new instance of the class. - - Connection host. - The port. - Connection username. - Type of the proxy. - The proxy host. - The proxy port. - The proxy username. - The proxy password. - The key files. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Releases unmanaged resources and performs other cleanup operations before the - is reclaimed by garbage collection. - - - - - Specifies the type of proxy client will use to connect to server. - - - - No proxy server. - - - A SOCKS4 proxy server. - - - A SOCKS5 proxy server. - - - A HTTP proxy server. - - - - Provides SCP client functionality. - - - - More information on the SCP protocol is available here: - https://github.com/net-ssh/net-scp/blob/master/lib/net/scp.rb - - - Known issues in OpenSSH: - - - Recursive download (-prf) does not deal well with specific UTF-8 and newline characters. - Recursive update does not support empty path for uploading to home directory. - - - - - - Provides SCP client functionality. - - - - - Gets or sets the operation timeout. - - - The timeout to wait until an operation completes. The default value is negative - one (-1) milliseconds, which indicates an infinite time-out period. - - - - - Gets or sets the size of the buffer. - - - The size of the buffer. The default buffer size is 16384 bytes. - - - - - Gets or sets the transformation to apply to remote paths. - - - The transformation to apply to remote paths. The default is . - - is null. - - - This transformation is applied to the remote file or directory path that is passed to the - scp command. - - - See for the transformations that are supplied - out-of-the-box with SSH.NET. - - - - - - Occurs when downloading file. - - - - - Occurs when uploading file. - - - - - Initializes a new instance of the class. - - The connection info. - is null. - - - - Initializes a new instance of the class. - - Connection host. - Connection port. - Authentication username. - Authentication password. - is null. - is invalid, or is null or contains only whitespace characters. - is not within and . - - - - Initializes a new instance of the class. - - Connection host. - Authentication username. - Authentication password. - is null. - is invalid, or is null or contains only whitespace characters. - - - - Initializes a new instance of the class. - - Connection host. - Connection port. - Authentication username. - Authentication private key file(s) . - is null. - is invalid, -or- is null or contains only whitespace characters. - is not within and . - - - - Initializes a new instance of the class. - - Connection host. - Authentication username. - Authentication private key file(s) . - is null. - is invalid, -or- is null or contains only whitespace characters. - - - - Initializes a new instance of the class. - - The connection info. - Specified whether this instance owns the connection info. - is null. - - If is true, then the - connection info will be disposed when this instance is disposed. - - - - - Initializes a new instance of the class. - - The connection info. - Specified whether this instance owns the connection info. - The factory to use for creating new services. - is null. - is null. - - If is true, then the - connection info will be disposed when this instance is disposed. - - - - - Uploads the specified stream to the remote host. - - The to upload. - A relative or absolute path for the remote file. - A directory with the specified path exists on the remote host. - The secure copy execution request was rejected by the server. - - - - Downloads the specified file from the remote host to the stream. - - A relative or absolute path for the remote file. - The to download the remote file to. - is null or contains only whitespace characters. - is null. - exists on the remote host, and is not a regular file. - The secure copy execution request was rejected by the server. - - - - Sets mode, size and name of file being upload. - - The channel to perform the upload in. - A from which any feedback from the server can be read. - The size of the content to upload. - The name of the file, without path, to which the content is to be uploaded. - - - When the SCP transfer is already initiated for a file, a zero-length should - be specified for . This prevents the server from uploading the - content to a file with path <file path>/ if there's - already a directory with this path, and allows us to receive an error response. - - - - - - Uploads the content of a file. - - The channel to perform the upload in. - A from which any feedback from the server can be read. - The content to upload. - The name of the remote file, without path, to which the content is uploaded. - - is only used for raising the event. - - - - - Checks the return code. - - The output stream. - - - - Read a LF-terminated string from the . - - The to read from. - - The string without trailing LF. - - - - - Uploads the specified file to the remote host. - - The file system info. - A relative or absolute path for the remote file. - is null. - is null or empty. - A directory with the specified path exists on the remote host. - The secure copy execution request was rejected by the server. - - - - Uploads the specified directory to the remote host. - - The directory info. - A relative or absolute path for the remote directory. - fileSystemInfo - is null or empty. - exists on the remote host, and is not a directory. - The secure copy execution request was rejected by the server. - - - - Downloads the specified file from the remote host to local file. - - Remote host file name. - Local file information. - is null. - is null or empty. - exists on the remote host, and is not a regular file. - The secure copy execution request was rejected by the server. - - - - Downloads the specified directory from the remote host to local directory. - - Remote host directory name. - Local directory information. - is null or empty. - is null. - File or directory with the specified path does not exist on the remote host. - The secure copy execution request was rejected by the server. - - - - Uploads the and - of the next file or directory to upload. - - The channel to perform the upload in. - A from which any feedback from the server can be read. - The file or directory to upload. - - - - Upload the files and subdirectories in the specified directory. - - The channel to perform the upload in. - A from which any feedback from the server can be read. - The directory to upload. - - - - Sets mode and name of the directory being upload. - - - - - Base class for port forwarding functionality. - - - - - Gets or sets the session. - - - The session. - - - - - The event occurs as the forwarded port is being stopped. - - - - - The event occurs as the forwarded port is being stopped. - - - - - Gets a value indicating whether port forwarding is started. - - - true if port forwarding is started; otherwise, false. - - - - - Occurs when an exception is thrown. - - - - - Occurs when a port forwarding request is received. - - - - - Starts port forwarding. - - - - - Stops port forwarding. - - - - - Starts port forwarding. - - - - - Stops port forwarding, and waits for the specified timeout until all pending - requests are processed. - - The maximum amount of time to wait for pending requests to finish processing. - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Ensures the current instance is not disposed. - - The current instance is disposed. - - - - Raises event. - - The exception. - - - - Raises event. - - Request originator host. - Request originator port. - - - - Raises the event. - - - - - Handles session ErrorOccured event. - - The source of the event. - The instance containing the event data. - - - - Provides functionality for remote port forwarding - - - - - Gets a value indicating whether port forwarding is started. - - - true if port forwarding is started; otherwise, false. - - - - - Gets the bound host. - - - - - Gets the bound host. - - - - - Gets the bound port. - - - - - Gets the forwarded host. - - - - - Gets the forwarded host. - - - - - Gets the forwarded port. - - - - - Initializes a new instance of the class. - - The bound host address. - The bound port. - The host address. - The port. - is null. - is null. - is greater than . - is greater than . - - - - Initializes a new instance of the class. - - The bound port. - The host. - The port. - - - - - - - Initializes a new instance of the class. - - The bound host. - The bound port. - The host. - The port. - - - - Starts remote port forwarding. - - - - - Stops remote port forwarding. - - The maximum amount of time to wait for the port to stop. - - - - Ensures the current instance is not disposed. - - The current instance is disposed. - - - - Initializes the . - - - - When the port is started for the first time, a is created with an initial count - of 1. - - - On subsequent (re)starts, we'll dispose the current and create a new one with - initial count of 1. - - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Releases unmanaged resources and performs other cleanup operations before the - is reclaimed by garbage collection. - - - - - Provides data for message events. - - Message type - - - - Gets the message. - - - - - Initializes a new instance of the class. - - The message. - is null. - - - - Contains operation for working with NetConf server. - - - - - Holds instance that used to communicate to the server - - - - - Gets or sets the operation timeout. - - - The timeout to wait until an operation completes. The default value is negative - one (-1) milliseconds, which indicates an infinite time-out period. - - - - - Initializes a new instance of the class. - - The connection info. - is null. - - - - Initializes a new instance of the class. - - Connection host. - Connection port. - Authentication username. - Authentication password. - is null. - is invalid, or is null or contains only whitespace characters. - is not within and . - - - - Initializes a new instance of the class. - - Connection host. - Authentication username. - Authentication password. - is null. - is invalid, or is null or contains only whitespace characters. - - - - Initializes a new instance of the class. - - Connection host. - Connection port. - Authentication username. - Authentication private key file(s) . - is null. - is invalid, -or- is null or contains only whitespace characters. - is not within and . - - - - Initializes a new instance of the class. - - Connection host. - Authentication username. - Authentication private key file(s) . - is null. - is invalid, -or- is null or contains only whitespace characters. - - - - Initializes a new instance of the class. - - The connection info. - Specified whether this instance owns the connection info. - is null. - - If is true, then the - connection info will be disposed when this instance is disposed. - - - - - Initializes a new instance of the class. - - The connection info. - Specified whether this instance owns the connection info. - The factory to use for creating new services. - is null. - is null. - - If is true, then the - connection info will be disposed when this instance is disposed. - - - - - Gets the NetConf server capabilities. - - - The NetConf server capabilities. - - - - - Gets the NetConf client capabilities. - - - The NetConf client capabilities. - - - - - Gets or sets a value indicating whether automatic message id handling is - enabled. - - - true if automatic message id handling is enabled; otherwise, false. - The default value is true. - - - - - Sends the receive RPC. - - The RPC. - Reply message to RPC request - Client is not connected. - - - - Sends the receive RPC. - - The XML. - Reply message to RPC request - - - - Sends the close RPC. - - Reply message to closing RPC request - Client is not connected. - - - - Called when client is connected to the server. - - - - - Called when client is disconnecting from the server. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Represents private key information. - - - - - - - Supports RSA and DSA private key in both OpenSSH and ssh.com format. - - - The following encryption algorithms are supported: - - - DES-EDE3-CBC - - - DES-EDE3-CFB - - - DES-CBC - - - AES-128-CBC - - - AES-192-CBC - - - AES-256-CBC - - - - - - - - Gets the host key. - - - - - Initializes a new instance of the class. - - The private key. - - - - Initializes a new instance of the class. - - Name of the file. - is null or empty. - This method calls internally, this method does not catch exceptions from . - - - - Initializes a new instance of the class. - - Name of the file. - The pass phrase. - is null or empty, or is null. - This method calls internally, this method does not catch exceptions from . - - - - Initializes a new instance of the class. - - The private key. - The pass phrase. - or is null. - - - - Opens the specified private key. - - The private key. - The pass phrase. - - - - Decrypts encrypted private key file data. - - The cipher info. - Encrypted data. - Decryption pass phrase. - Decryption binary salt. - Decrypted byte array. - , , or is null. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Releases unmanaged resources and performs other cleanup operations before the - is reclaimed by garbage collection. - - - - - Reads next mpint data type from internal buffer where length specified in bits. - - mpint read. - - - - Provides functionality to connect and interact with SSH server. - - - - - Specifies an infinite waiting period. - - - The value of this field is -1 millisecond. - - - - - Specifies an infinite waiting period. - - - The value of this field is -1. - - - - - Specifies maximum packet size defined by the protocol. - - - 68536 (64 KB + 3000 bytes). - - - - - Holds the initial local window size for the channels. - - - 2147483647 (2^31 - 1) bytes. - - - We currently do not define a maximum (remote) window size. - - - - - Holds the maximum size of channel data packets that we receive. - - - 64 KB. - - - - This is the maximum size (in bytes) we support for the data (payload) of a - SSH_MSG_CHANNEL_DATA message we receive. - - - We currently do not enforce this limit. - - - - - - Controls how many authentication attempts can take place at the same time. - - - Some server may restrict number to prevent authentication attacks - - - - - Holds metada about session messages - - - - - Holds a that is signaled when the message listener loop has completed. - - - - - Specifies outbound packet number - - - - - Specifies incoming packet number - - - - - WaitHandle to signal that last service request was accepted - - - - - WaitHandle to signal that exception was thrown by another thread. - - - - - WaitHandle to signal that key exchange was completed. - - - - - WaitHandle to signal that key exchange is in progress. - - - - - Exception that need to be thrown by waiting thread - - - - - Specifies whether connection is authenticated - - - - - Specifies whether user issued Disconnect command or not - - - - - Holds the factory to use for creating new services. - - - - - Holds connection socket. - - - - - Holds an object that is used to ensure only a single thread can read from - at any given time. - - - - - Holds an object that is used to ensure only a single thread can write to - at any given time. - - - This is also used to ensure that is - incremented atomatically. - - - - - Holds an object that is used to ensure only a single thread can dispose - at any given time. - - - This is also used to ensure that will not be disposed - while performing a given operation or set of operations on . - - - - - Gets the session semaphore that controls session channels. - - - The session semaphore. - - - - - Gets the next channel number. - - - The next channel number. - - - - - Gets a value indicating whether the session is connected. - - - true if the session is connected; otherwise, false. - - - This methods returns true in all but the following cases: - - - The is disposed. - - - The SSH_MSG_DISCONNECT message - which is used to disconnect from the server - has been sent. - - - The client has not been authenticated successfully. - - - The listener thread - which is used to receive messages from the server - has stopped. - - - The socket used to communicate with the server is no longer connected. - - - - - - - Gets the session id. - - - The session id, or null if the client has not been authenticated. - - - - - Gets the client init message. - - The client init message. - - - - Gets or sets the server version string. - - The server version. - - - - Gets or sets the client version string. - - The client version. - - - - Gets or sets the connection info. - - The connection info. - - - - Occurs when an error occurred. - - - - - Occurs when session has been disconnected from the server. - - - - - Occurs when host key received. - - - - - Occurs when message is received from the server. - - - - - Occurs when message is received from the server. - - - - - Occurs when message is received from the server. - - - - - Occurs when message is received from the server. - - - - - Occurs when message is received from the server. - - - - - Occurs when message is received from the server. - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when a message is received from the SSH server. - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Occurs when message received - - - - - Initializes a new instance of the class. - - The connection info. - The factory to use for creating new services. - is null. - is null. - - - - Connects to the server. - - Socket connection to the SSH server or proxy server could not be established, or an error occurred while resolving the hostname. - SSH session could not be established. - Authentication of SSH session failed. - Failed to establish proxy connection. - - - - Disconnects from the server. - - - This sends a SSH_MSG_DISCONNECT message to the server, waits for the - server to close the socket on its end and subsequently closes the client socket. - - - - - Waits for the specified handle or the exception handle for the receive thread - to signal within the connection timeout. - - The wait handle. - A received package was invalid or failed the message integrity check. - None of the handles are signaled in time and the session is not disconnecting. - A socket error was signaled while receiving messages from the server. - - When neither handles are signaled in time and the session is not closing, then the - session is disconnected. - - - - - Waits for the specified handle or the exception handle for the receive thread - to signal within the specified timeout. - - The wait handle. - The time to wait for any of the handles to become signaled. - A received package was invalid or failed the message integrity check. - None of the handles are signaled in time and the session is not disconnecting. - A socket error was signaled while receiving messages from the server. - - When neither handles are signaled in time and the session is not closing, then the - session is disconnected. - - - - - Waits for the specified handle or the exception handle for the receive thread - to signal within the connection timeout. - - The wait handle. - A received package was invalid or failed the message integrity check. - None of the handles are signaled in time and the session is not disconnecting. - A socket error was signaled while receiving messages from the server. - - When neither handles are signaled in time and the session is not closing, then the - session is disconnected. - - - - - Waits for the specified handle or the exception handle for the receive thread - to signal within the specified timeout. - - The wait handle. - The time to wait for any of the handles to become signaled. - A received package was invalid or failed the message integrity check. - None of the handles are signaled in time and the session is not disconnecting. - A socket error was signaled while receiving messages from the server. - - - - Sends a message to the server. - - The message to send. - The client is not connected. - The operation timed out. - The size of the packet exceeds the maximum size defined by the protocol. - - - - Sends an SSH packet to the server. - - A byte array containing the packet to send. - The offset of the packet. - The length of the packet. - Client is not connected to the server. - - - The send is performed in a dispose lock to avoid - and/or when sending the packet. - - - This method is only to be used when the connection is established, as the locking - overhead is not required while establising the connection. - - - - - - Sends a message to the server. - - The message to send. - - true if the message was sent to the server; otherwise, false. - - The size of the packet exceeds the maximum size defined by the protocol. - - This methods returns false when the attempt to send the message results in a - or a . - - - - - Receives the message from the server. - - - The incoming SSH message, or null if the connection with the SSH server was closed. - - - We need no locking here since all messages are read by a single thread. - - - - - Called when received. - - message. - - - - Called when received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when client is disconnecting from the server. - - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Called when message received. - - message. - - - - Registers SSH message with the session. - - The name of the message to register with the session. - - - - Unregister SSH message from the session. - - The name of the message to unregister with the session. - - - - Loads a message from a given buffer. - - An array of bytes from which to construct the message. - The zero-based byte offset in at which to begin reading. - The number of bytes to load. - - A message constructed from . - - The type of the message is not supported. - - - - Establishes a socket connection to the specified host and port. - - The host name of the server to connect to. - The port to connect to. - The connection failed to establish within the configured . - An error occurred trying to establish the connection. - - - - Performs a blocking read on the socket until bytes are received. - - An array of type that is the storage location for the received data. - The position in parameter to store the received data. - The number of bytes to read. - - The number of bytes read. - - The socket is closed. - The read has timed-out. - The read failed. - - - - Gets a value indicating whether the socket is connected. - - - true if the socket is connected; otherwise, false. - - - - As a first check we verify whether is - true. However, this only returns the state of the socket as of - the last I/O operation. - - - Therefore we use the combination of with mode - and to verify if the socket is still connected. - - - The MSDN doc mention the following on the return value of - with mode : - - - true if data is available for reading; - - - true if the connection has been closed, reset, or terminated; otherwise, returns false. - - - - - Conclusion: when the return value is true - but no data is available for reading - then - the socket is no longer connected. - - - When a is used from multiple threads, there's a race condition - between the invocation of and the moment - when the value of is obtained. To workaround this issue - we synchronize reads from the . - - - - - - Performs a blocking read on the socket until bytes are received. - - An array of type that is the storage location for the received data. - The position in parameter to store the received data. - The number of bytes to read. - - The number of bytes read. - - The read has timed-out. - The read failed. - - - - Performs a blocking read on the socket until a line is read. - - A that represents the time to wait until a line is read. - The read has timed-out. - An error occurred when trying to access the socket. - - The line read from the socket, or null when the remote server has shutdown and all data has been received. - - - - - Shuts down and disposes the socket. - - - - - Listens for incoming message from the server and handles them. This method run as a task on separate thread. - - - - - Raises the event. - - The . - - - - Resets connection-specific information to ensure state of a previous connection - does not affect new connections. - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Releases unmanaged resources and performs other cleanup operations before the - is reclaimed by garbage collection. - - - - - Gets or sets the connection info. - - The connection info. - - - - Create a new SSH session channel. - - - A new SSH session channel. - - - - - Create a new channel for a locally forwarded TCP/IP port. - - - A new channel for a locally forwarded TCP/IP port. - - - - - Creates a "forwarded-tcpip" SSH channel. - - - A new "forwarded-tcpip" SSH channel. - - - - - Sends a message to the server. - - The message to send. - The client is not connected. - The operation timed out. - The size of the packet exceeds the maximum size defined by the protocol. - - - - Sends a message to the server. - - The message to send. - - true if the message was sent to the server; otherwise, false. - - The size of the packet exceeds the maximum size defined by the protocol. - - This methods returns false when the attempt to send the message results in a - or a . - - - - - Implementation of the SSH File Transfer Protocol (SFTP) over SSH. - - - - - Holds the instance that is used to communicate to the - SFTP server. - - - - - Holds the operation timeout. - - - - - Holds the size of the buffer. - - - - - Gets or sets the operation timeout. - - - The timeout to wait until an operation completes. The default value is negative - one (-1) milliseconds, which indicates an infinite timeout period. - - The method was called after the client was disposed. - - - - Gets or sets the maximum size of the buffer in bytes. - - - The size of the buffer. The default buffer size is 32768 bytes (32 KB). - - - - For write operations, this limits the size of the payload for - individual SSH_FXP_WRITE messages. The actual size is always - capped at the maximum packet size supported by the peer - (minus the size of protocol fields). - - - For read operations, this controls the size of the payload which - is requested from the peer in a SSH_FXP_READ message. The peer - will send the requested number of bytes in a SSH_FXP_DATA message, - possibly split over multiple SSH_MSG_CHANNEL_DATA messages. - - - To optimize the size of the SSH packets sent by the peer, - the actual requested size will take into account the size of the - SSH_FXP_DATA protocol fields. - - - The size of the each indivual SSH_FXP_DATA message is limited to the - local maximum packet size of the channel, which is set to 64 KB - for SSH.NET. However, the peer can limit this even further. - - - The method was called after the client was disposed. - - - - Gets remote working directory. - - Client is not connected. - The method was called after the client was disposed. - - - - Gets sftp protocol version. - - Client is not connected. - The method was called after the client was disposed. - - - - Initializes a new instance of the class. - - The connection info. - is null. - - - - Initializes a new instance of the class. - - Connection host. - Connection port. - Authentication username. - Authentication password. - is null. - is invalid. -or- is null or contains only whitespace characters. - is not within and . - - - - Initializes a new instance of the class. - - Connection host. - Authentication username. - Authentication password. - is null. - is invalid. -or- is null contains only whitespace characters. - - - - Initializes a new instance of the class. - - Connection host. - Connection port. - Authentication username. - Authentication private key file(s) . - is null. - is invalid. -or- is nunullll or contains only whitespace characters. - is not within and . - - - - Initializes a new instance of the class. - - Connection host. - Authentication username. - Authentication private key file(s) . - is null. - is invalid. -or- is null or contains only whitespace characters. - - - - Initializes a new instance of the class. - - The connection info. - Specified whether this instance owns the connection info. - is null. - - If is true, the connection info will be disposed when this - instance is disposed. - - - - - Initializes a new instance of the class. - - The connection info. - Specified whether this instance owns the connection info. - The factory to use for creating new services. - is null. - is null. - - If is true, the connection info will be disposed when this - instance is disposed. - - - - - Changes remote directory to path. - - New directory path. - is null. - Client is not connected. - Permission to change directory denied by remote host. -or- A SSH command was denied by the server. - was not found on the remote host. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - - - Changes permissions of file(s) to specified mode. - - File(s) path, may match multiple files. - The mode. - is null. - Client is not connected. - Permission to change permission on the path(s) was denied by the remote host. -or- A SSH command was denied by the server. - was not found on the remote host. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - - - Creates remote directory specified by path. - - Directory path to create. - is null or contains only whitespace characters. - Client is not connected. - Permission to create the directory was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - - - Deletes remote directory specified by path. - - Directory to be deleted path. - is null or contains only whitespace characters. - Client is not connected. - was not found on the remote host. - Permission to delete the directory was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - - - Deletes remote file specified by path. - - File to be deleted path. - is null or contains only whitespace characters. - Client is not connected. - was not found on the remote host. - Permission to delete the file was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - - - Renames remote file from old path to new path. - - Path to the old file location. - Path to the new file location. - is null. -or- or is null. - Client is not connected. - Permission to rename the file was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - - - Renames remote file from old path to new path. - - Path to the old file location. - Path to the new file location. - if set to true then perform a posix rename. - is null. -or- or is null. - Client is not connected. - Permission to rename the file was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - - - Creates a symbolic link from old path to new path. - - The old path. - The new path. - is null. -or- is null or contains only whitespace characters. - Client is not connected. - Permission to create the symbolic link was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - - - Retrieves list of files in remote directory. - - The path. - The list callback. - - A list of files. - - is null. - Client is not connected. - Permission to list the contents of the directory was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - - - Begins an asynchronous operation of retrieving list of files in remote directory. - - The path. - The method to be called when the asynchronous write operation is completed. - A user-provided object that distinguishes this particular asynchronous write request from other requests. - The list callback. - - An that references the asynchronous operation. - - The method was called after the client was disposed. - - - - Ends an asynchronous operation of retrieving list of files in remote directory. - - The pending asynchronous SFTP request. - - A list of files. - - The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . - - - - Gets reference to remote file or directory. - - The path. - - A reference to file object. - - Client is not connected. - was not found on the remote host. - is null. - The method was called after the client was disposed. - - - - Checks whether file or directory exists; - - The path. - - true if directory or file exists; otherwise false. - - is null or contains only whitespace characters. - Client is not connected. - Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - - - Downloads remote file specified by the path into the stream. - - File to download. - Stream to write the file into. - The download callback. - is null. - is null or contains only whitespace characters. - Client is not connected. - Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. - was not found on the remote host./// - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. - - - - - Begins an asynchronous file downloading into the stream. - - The path. - The output. - - An that references the asynchronous operation. - - is null. - is null or contains only whitespace characters. - Client is not connected. - Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. - - - - - Begins an asynchronous file downloading into the stream. - - The path. - The output. - The method to be called when the asynchronous write operation is completed. - - An that references the asynchronous operation. - - is null. - is null or contains only whitespace characters. - Client is not connected. - Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. - - - - - Begins an asynchronous file downloading into the stream. - - The path. - The output. - The method to be called when the asynchronous write operation is completed. - A user-provided object that distinguishes this particular asynchronous write request from other requests. - The download callback. - - An that references the asynchronous operation. - - is null. - is null or contains only whitespace characters. - The method was called after the client was disposed. - - Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. - - - - - Ends an asynchronous file downloading into the stream. - - The pending asynchronous SFTP request. - The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . - Client is not connected. - Permission to perform the operation was denied by the remote host. -or- A SSH command was denied by the server. - The path was not found on the remote host. - A SSH error where is the message from the remote host. - - - - Uploads stream into remote file. - - Data input stream. - Remote file path. - The upload callback. - is null. - is null or contains only whitespace characters. - Client is not connected. - Permission to upload the file was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. - - - - - Uploads stream into remote file. - - Data input stream. - Remote file path. - if set to true then existing file will be overwritten. - The upload callback. - is null. - is null or contains only whitespace characters. - Client is not connected. - Permission to upload the file was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. - - - - - Begins an asynchronous uploading the stream into remote file. - - Data input stream. - Remote file path. - - An that references the asynchronous operation. - - is null. - is null or contains only whitespace characters. - Client is not connected. - Permission to list the contents of the directory was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - - Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. - - - If the remote file already exists, it is overwritten and truncated. - - - - - - Begins an asynchronous uploading the stream into remote file. - - Data input stream. - Remote file path. - The method to be called when the asynchronous write operation is completed. - - An that references the asynchronous operation. - - is null. - is null or contains only whitespace characters. - Client is not connected. - Permission to list the contents of the directory was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - - Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. - - - If the remote file already exists, it is overwritten and truncated. - - - - - - Begins an asynchronous uploading the stream into remote file. - - Data input stream. - Remote file path. - The method to be called when the asynchronous write operation is completed. - A user-provided object that distinguishes this particular asynchronous write request from other requests. - The upload callback. - - An that references the asynchronous operation. - - is null. - is null or contains only whitespace characters. - Client is not connected. - Permission to list the contents of the directory was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - The method was called after the client was disposed. - - - Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. - - - If the remote file already exists, it is overwritten and truncated. - - - - - - Begins an asynchronous uploading the stream into remote file. - - Data input stream. - Remote file path. - Specified whether an existing file can be overwritten. - The method to be called when the asynchronous write operation is completed. - A user-provided object that distinguishes this particular asynchronous write request from other requests. - The upload callback. - - An that references the asynchronous operation. - - is null. - is null or contains only whitespace characters. - The method was called after the client was disposed. - - - Method calls made by this method to , may under certain conditions result in exceptions thrown by the stream. - - - When refers to an existing file, set to true to overwrite and truncate that file. - If is false, the upload will fail and will throw an - . - - - - - - Ends an asynchronous uploading the stream into remote file. - - The pending asynchronous SFTP request. - The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . - Client is not connected. - The directory of the file was not found on the remote host. - Permission to upload the file was denied by the remote host. -or- A SSH command was denied by the server. - A SSH error where is the message from the remote host. - - - - Gets status using statvfs@openssh.com request. - - The path. - - A instance that contains file status information. - - Client is not connected. - is null. - The method was called after the client was disposed. - - - - Appends lines to a file, creating the file if it does not already exist. - - The file to append the lines to. The file is created if it does not already exist. - The lines to append to the file. - isnull -or- is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - The characters are written to the file using UTF-8 encoding without a Byte-Order Mark (BOM) - - - - - Appends lines to a file by using a specified encoding, creating the file if it does not already exist. - - The file to append the lines to. The file is created if it does not already exist. - The lines to append to the file. - The character encoding to use. - is null. -or- is null. -or- is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - - - Appends the specified string to the file, creating the file if it does not already exist. - - The file to append the specified string to. - The string to append to the file. - is null. -or- is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - The characters are written to the file using UTF-8 encoding without a Byte-Order Mark (BOM). - - - - - Appends the specified string to the file, creating the file if it does not already exist. - - The file to append the specified string to. - The string to append to the file. - The character encoding to use. - is null. -or- is null. -or- is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - - - Creates a that appends UTF-8 encoded text to the specified file, - creating the file if it does not already exist. - - The path to the file to append to. - - A that appends text to a file using UTF-8 encoding without a - Byte-Order Mark (BOM). - - is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - - - Creates a that appends text to a file using the specified - encoding, creating the file if it does not already exist. - - The path to the file to append to. - The character encoding to use. - - A that appends text to a file using the specified encoding. - - is null. -or- is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - - - Creates or overwrites a file in the specified path. - - The path and name of the file to create. - - A that provides read/write access to the file specified in path. - - is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - If the target file already exists, it is first truncated to zero bytes. - - - - - Creates or overwrites the specified file. - - The path and name of the file to create. - The maximum number of bytes buffered for reads and writes to the file. - - A that provides read/write access to the file specified in path. - - is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - If the target file already exists, it is first truncated to zero bytes. - - - - - Creates or opens a file for writing UTF-8 encoded text. - - The file to be opened for writing. - - A that writes text to a file using UTF-8 encoding without - a Byte-Order Mark (BOM). - - is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - - If the target file already exists, it is overwritten. It is not first truncated to zero bytes. - - - If the target file does not exist, it is created. - - - - - - Creates or opens a file for writing text using the specified encoding. - - The file to be opened for writing. - The character encoding to use. - - A that writes to a file using the specified encoding. - - is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - - If the target file already exists, it is overwritten. It is not first truncated to zero bytes. - - - If the target file does not exist, it is created. - - - - - - Deletes the specified file or directory. - - The name of the file or directory to be deleted. Wildcard characters are not supported. - is null. - Client is not connected. - was not found on the remote host. - The method was called after the client was disposed. - - - - Returns the date and time the specified file or directory was last accessed. - - The file or directory for which to obtain access date and time information. - - A structure set to the date and time that the specified file or directory was last accessed. - This value is expressed in local time. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last accessed. - - The file or directory for which to obtain access date and time information. - - A structure set to the date and time that the specified file or directory was last accessed. - This value is expressed in UTC time. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Returns the date and time the specified file or directory was last written to. - - The file or directory for which to obtain write date and time information. - - A structure set to the date and time that the specified file or directory was last written to. - This value is expressed in local time. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last written to. - - The file or directory for which to obtain write date and time information. - - A structure set to the date and time that the specified file or directory was last written to. - This value is expressed in UTC time. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Opens a on the specified path with read/write access. - - The file to open. - A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten. - - An unshared that provides access to the specified file, with the specified mode and read/write access. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Opens a on the specified path, with the specified mode and access. - - The file to open. - A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten. - A value that specifies the operations that can be performed on the file. - - An unshared that provides access to the specified file, with the specified mode and access. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Opens an existing file for reading. - - The file to be opened for reading. - - A read-only on the specified path. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Opens an existing UTF-8 encoded text file for reading. - - The file to be opened for reading. - - A on the specified path. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Opens a file for writing. - - The file to be opened for writing. - - An unshared object on the specified path with access. - - is null. - Client is not connected. - The method was called after the client was disposed. - - If the file does not exist, it is created. - - - - - Opens a binary file, reads the contents of the file into a byte array, and closes the file. - - The file to open for reading. - - A byte array containing the contents of the file. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Opens a text file, reads all lines of the file using UTF-8 encoding, and closes the file. - - The file to open for reading. - - A string array containing all lines of the file. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Opens a file, reads all lines of the file with the specified encoding, and closes the file. - - The file to open for reading. - The encoding applied to the contents of the file. - - A string array containing all lines of the file. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Opens a text file, reads all lines of the file with the UTF-8 encoding, and closes the file. - - The file to open for reading. - - A string containing all lines of the file. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Opens a file, reads all lines of the file with the specified encoding, and closes the file. - - The file to open for reading. - The encoding applied to the contents of the file. - - A string containing all lines of the file. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Reads the lines of a file with the UTF-8 encoding. - - The file to read. - - The lines of the file. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Read the lines of a file that has a specified encoding. - - The file to read. - The encoding that is applied to the contents of the file. - - The lines of the file. - - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Sets the date and time the specified file was last accessed. - - The file for which to set the access date and time information. - A containing the value to set for the last access date and time of path. This value is expressed in local time. - - - - Sets the date and time, in coordinated universal time (UTC), that the specified file was last accessed. - - The file for which to set the access date and time information. - A containing the value to set for the last access date and time of path. This value is expressed in UTC time. - - - - Sets the date and time that the specified file was last written to. - - The file for which to set the date and time information. - A containing the value to set for the last write date and time of path. This value is expressed in local time. - - - - Sets the date and time, in coordinated universal time (UTC), that the specified file was last written to. - - The file for which to set the date and time information. - A containing the value to set for the last write date and time of path. This value is expressed in UTC time. - - - - Writes the specified byte array to the specified file, and closes the file. - - The file to write to. - The bytes to write to the file. - is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - - If the target file already exists, it is overwritten. It is not first truncated to zero bytes. - - - If the target file does not exist, it is created. - - - - - - Writes a collection of strings to the file using the UTF-8 encoding, and closes the file. - - The file to write to. - The lines to write to the file. - is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - - The characters are written to the file using UTF-8 encoding without a Byte-Order Mark (BOM). - - - If the target file already exists, it is overwritten. It is not first truncated to zero bytes. - - - If the target file does not exist, it is created. - - - - - - Write the specified string array to the file using the UTF-8 encoding, and closes the file. - - The file to write to. - The string array to write to the file. - is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - - The characters are written to the file using UTF-8 encoding without a Byte-Order Mark (BOM). - - - If the target file already exists, it is overwritten. It is not first truncated to zero bytes. - - - If the target file does not exist, it is created. - - - - - - Writes a collection of strings to the file using the specified encoding, and closes the file. - - The file to write to. - The lines to write to the file. - The character encoding to use. - is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - - If the target file already exists, it is overwritten. It is not first truncated to zero bytes. - - - If the target file does not exist, it is created. - - - - - - Writes the specified string array to the file by using the specified encoding, and closes the file. - - The file to write to. - The string array to write to the file. - An object that represents the character encoding applied to the string array. - is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - - If the target file already exists, it is overwritten. It is not first truncated to zero bytes. - - - If the target file does not exist, it is created. - - - - - - Writes the specified string to the file using the UTF-8 encoding, and closes the file. - - The file to write to. - The string to write to the file. - is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - - The characters are written to the file using UTF-8 encoding without a Byte-Order Mark (BOM). - - - If the target file already exists, it is overwritten. It is not first truncated to zero bytes. - - - If the target file does not exist, it is created. - - - - - - Writes the specified string to the file using the specified encoding, and closes the file. - - The file to write to. - The string to write to the file. - The encoding to apply to the string. - is null. - Client is not connected. - The specified path is invalid, or its directory was not found on the remote host. - The method was called after the client was disposed. - - - If the target file already exists, it is overwritten. It is not first truncated to zero bytes. - - - If the target file does not exist, it is created. - - - - - - Gets the of the file on the path. - - The path to the file. - - The of the file on the path. - - is null. - Client is not connected. - was not found on the remote host. - The method was called after the client was disposed. - - - - Sets the specified of the file on the specified path. - - The path to the file. - The desired . - is null. - Client is not connected. - The method was called after the client was disposed. - - - - Synchronizes the directories. - - The source path. - The destination path. - The search pattern. - - A list of uploaded files. - - is null. - is null or contains only whitespace. - was not found on the remote host. - - - - Begins the synchronize directories. - - The source path. - The destination path. - The search pattern. - The async callback. - The state. - - An that represents the asynchronous directory synchronization. - - is null. - is null or contains only whitespace. - - - - Ends the synchronize directories. - - The async result. - - A list of uploaded files. - - The object did not come from the corresponding async method on this type.-or- was called multiple times with the same . - The destination path was not found on the remote host. - - - - Internals the list directory. - - The path. - The list callback. - - A list of files in the specfied directory. - - is null. - Client not connected. - - - - Internals the download file. - - The path. - The output. - An that references the asynchronous request. - The download callback. - is null. - is null or contains whitespace. - Client not connected. - - - - Internals the upload file. - - The input. - The path. - The flags. - An that references the asynchronous request. - The upload callback. - is null. - is null or contains whitespace. - Client not connected. - - - - Called when client is connected to the server. - - - - - Called when client is disconnecting from the server. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - Represents instance of the SSH shell object @@ -18380,6 +20643,9 @@ The terminal height in pixels. The terminal mode values. The size of the buffer. + The channel could not be opened. + The pseudo-terminal request was not accepted by the server. + The request to start a shell was not accepted by the server. @@ -18813,7 +21079,7 @@ This method internally uses asynchronous calls. - + CommandText property is empty. Invalid Operation - An existing channel was used to execute this command. @@ -19263,6 +21529,7 @@ The session is already connected. The method was called after the session was disposed. + The channel session could not be opened, or the subsystem could not be executed.