InformationResponseMessage.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using System;
  2. using System.Collections.Generic;
  3. namespace Renci.SshNet.Messages.Authentication
  4. {
  5. /// <summary>
  6. /// Represents SSH_MSG_USERAUTH_INFO_RESPONSE message.
  7. /// </summary>
  8. [Message("SSH_MSG_USERAUTH_INFO_RESPONSE", 61)]
  9. internal class InformationResponseMessage : Message
  10. {
  11. /// <summary>
  12. /// Gets authentication responses.
  13. /// </summary>
  14. public IList<string> Responses { get; private set; }
  15. #if TUNING
  16. /// <summary>
  17. /// Gets the size of the message in bytes.
  18. /// </summary>
  19. /// <value>
  20. /// <c>-1</c> to indicate that the size of the message cannot be determined,
  21. /// or is too costly to calculate.
  22. /// </value>
  23. protected override int BufferCapacity
  24. {
  25. get { return -1; }
  26. }
  27. #endif
  28. /// <summary>
  29. /// Initializes a new instance of the <see cref="InformationResponseMessage"/> class.
  30. /// </summary>
  31. public InformationResponseMessage()
  32. {
  33. Responses = new List<string>();
  34. }
  35. /// <summary>
  36. /// Called when type specific data need to be loaded.
  37. /// </summary>
  38. protected override void LoadData()
  39. {
  40. throw new NotImplementedException();
  41. }
  42. /// <summary>
  43. /// Called when type specific data need to be saved.
  44. /// </summary>
  45. protected override void SaveData()
  46. {
  47. Write((UInt32)Responses.Count);
  48. foreach (var response in Responses)
  49. {
  50. Write(response);
  51. }
  52. }
  53. }
  54. }