Back to FlowSsh Documentation

HostKeyAlgs Structure/Class

[C]

struct FlowSshC_HostKeyAlgs
{
  byte m_ecdsaSecp256k1;
  byte m_ecdsaNistp521;
  byte m_ecdsaNistp384;
  byte m_ecdsaNistp256;
  byte m_sshRsa;
  byte m_sshDss;
};

[C++]

struct HostKeyAlgs : public FlowSshC_HostKeyAlgs
{
  HostKeyAlgs()
  {
    m_ecdsaSecp256k1 = 1;
    m_ecdsaNistp521 = 1;
    m_ecdsaNistp384 = 1;
    m_ecdsaNistp256 = 1;
    m_sshRsa = 1;
    m_sshDss = 1;
  }
};

[C#]

public sealed class HostKeyAlgs
{
  public byte EcdsaSecp256k1;
  public byte EcdsaNistp521;
  public byte EcdsaNistp384;
  public byte EcdsaNistp256;
  public byte SshRsa;
  public byte SshDss;
  
  public HostKeyAlgs()
  {
    EcdsaSecp256k1 = 1;
    EcdsaNistp521 = 1;
    EcdsaNistp384 = 1;
    EcdsaNistp256 = 1;
    SshRsa = 1;
    SshDss = 1;
  }
}

Members

  • EcdsaSecp256k1: Priority of "ecdsa-sha2-1.3.132.0.10".
  • EcdsaNistp521: Priority of "ecdsa-sha2-nistp521".
  • EcdsaNistp384: Priority of "ecdsa-sha2-nistp384".
  • EcdsaNistp256: Priority of "ecdsa-sha2-nistp256".
  • SshRsa: Priority of "ssh-rsa".
  • SshDss: Priority of "ssh-dsa".

Remarks

FlowSshC/Cpp/Net supports ECDSA, RSA, and DSA algorithms for SSH host authentication. Many SSH servers have host-keys for several algorithms; some have host-keys only for one of them. The HostKeyAlgs structure/class is used to specify which of the algorithms to use, and if several, 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, all host-key algorithms are enabled.