public override object GetValue() { return(KeyUtils.SupportedAlgorithms .Select(x => new HostKey { KeyType = x, KeyXml = KeyUtils.GeneratePrivateKey(x) }) .ToList()); }
public ActionResult ReGenSsh(String conform) { if (String.Equals(conform, "yes", StringComparison.OrdinalIgnoreCase)) { UserConfiguration.Current.HostKeys.Clear(); foreach (var type in KeyUtils.SupportedAlgorithms) { UserConfiguration.Current.HostKeys.Add(new HostKey { KeyType = type, KeyXml = KeyUtils.GeneratePrivateKey(type) }); } UserConfiguration.Current.Save(); SshServerConfig.RestartSshServer(); return(RedirectToAction("Edit")); } return(View()); }