Back to FlowSsh Documentation

HostKeyAlgs Structure/Class

[C]

struct FlowSshC_HostKeyAlgs
{
  byte m_sshRsa;
  byte m_sshDss;
};

[C++]

struct HostKeyAlgs : public FlowSshC_HostKeyAlgs
{
  HostKeyAlgs()
  {
    m_sshRsa = m_sshDss = 1;
  }
};

[C#]

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

Members

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

Remarks

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.