Back to FlowSsh Documentation

HostKeyAlgs Structure/Class


struct FlowSshC_HostKeyAlgs
  byte m_sshRsa;
  byte m_sshDss;


struct HostKeyAlgs : public FlowSshC_HostKeyAlgs
    m_sshRsa = m_sshDss = 1;


public sealed class HostKeyAlgs
  public byte SshRsa;
  public byte SshDss;
  public HostKeyAlgs()
    SshRsa = SshDss = 1;


  • SshRsa: Priority of "ssh-rsa".
  • SshDss: Priority of "ssh-dsa".


FlowSshC/Cpp/Net supports the "ssh-rsa" and "ssh-dss" algorithms for SSH host authentication. Many SSH servers have host-keys for both algorithms; some have host-keys only for one of them. The HostKeyAlgs structure/class is used to specify which of the two algorithms to use, and if both, which one to prefer. For member values the following rules apply:

  • An algorithm is enabled if it holds a non-zero value.
  • Algorithms with lower non-zero values precede algorithms with higher values.
  • Algorithms holding the same non-zero value are ordered by their declaration order.

By default, both host-key algorithms are enabled and "ssh-rsa" takes precedence.