2
0

KeyExchangeDhReplyMessage.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Renci.SshNet.Common;
  2. namespace Renci.SshNet.Messages.Transport
  3. {
  4. /// <summary>
  5. /// Represents SSH_MSG_KEXDH_REPLY message.
  6. /// </summary>
  7. [Message("SSH_MSG_KEXDH_REPLY", 31)]
  8. public class KeyExchangeDhReplyMessage : Message
  9. {
  10. /// <summary>
  11. /// Gets server public host key and certificates
  12. /// </summary>
  13. /// <value>The host key.</value>
  14. public byte[] HostKey { get; private set; }
  15. /// <summary>
  16. /// Gets the F value.
  17. /// </summary>
  18. public BigInteger F { get; private set; }
  19. /// <summary>
  20. /// Gets the signature of H.
  21. /// </summary>
  22. /// <value>The signature.</value>
  23. public byte[] Signature { get; private set; }
  24. /// <summary>
  25. /// Called when type specific data need to be loaded.
  26. /// </summary>
  27. protected override void LoadData()
  28. {
  29. ResetReader();
  30. HostKey = ReadBinaryString();
  31. F = ReadBigInt();
  32. Signature = ReadBinaryString();
  33. }
  34. /// <summary>
  35. /// Called when type specific data need to be saved.
  36. /// </summary>
  37. protected override void SaveData()
  38. {
  39. WriteBinaryString(HostKey);
  40. Write(F);
  41. WriteBinaryString(Signature);
  42. }
  43. }
  44. }