2
0

RequestMessageKeyboardInteractive.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. namespace Renci.SshNet.Messages.Authentication
  2. {
  3. /// <summary>
  4. /// Represents "keyboard-interactive" SSH_MSG_USERAUTH_REQUEST message.
  5. /// </summary>
  6. internal class RequestMessageKeyboardInteractive : RequestMessage
  7. {
  8. /// <summary>
  9. /// Gets the name of the authentication method.
  10. /// </summary>
  11. /// <value>
  12. /// The name of the method.
  13. /// </value>
  14. public override string MethodName
  15. {
  16. get
  17. {
  18. return "keyboard-interactive";
  19. }
  20. }
  21. /// <summary>
  22. /// Gets message language.
  23. /// </summary>
  24. public string Language { get; private set; }
  25. /// <summary>
  26. /// Gets authentication sub methods.
  27. /// </summary>
  28. public string SubMethods { get; private set; }
  29. /// <summary>
  30. /// Initializes a new instance of the <see cref="RequestMessageKeyboardInteractive"/> class.
  31. /// </summary>
  32. /// <param name="serviceName">Name of the service.</param>
  33. /// <param name="username">Authentication username.</param>
  34. public RequestMessageKeyboardInteractive(ServiceName serviceName, string username)
  35. : base(serviceName, username)
  36. {
  37. this.Language = string.Empty;
  38. this.SubMethods = string.Empty;
  39. }
  40. /// <summary>
  41. /// Called when type specific data need to be saved.
  42. /// </summary>
  43. protected override void SaveData()
  44. {
  45. base.SaveData();
  46. this.Write(this.Language);
  47. this.Write(this.SubMethods);
  48. }
  49. }
  50. }