using System; namespace Renci.SshNet.Messages.Authentication { /// /// Represents SSH_MSG_USERAUTH_FAILURE message. /// [Message("SSH_MSG_USERAUTH_FAILURE", 51)] public class FailureMessage : Message { /// /// Gets or sets the allowed authentications if available. /// /// /// The allowed authentications. /// public string[] AllowedAuthentications { get; set; } /// /// Gets failure message. /// public string Message { get; private set; } /// /// Gets a value indicating whether authentication is partially successful. /// /// /// true if partially successful; otherwise, false. /// public bool PartialSuccess { get; private set; } /// /// Called when type specific data need to be loaded. /// protected override void LoadData() { AllowedAuthentications = ReadNamesList(); PartialSuccess = ReadBoolean(); if (PartialSuccess) { Message = string.Join(",", AllowedAuthentications); } } /// /// Called when type specific data need to be saved. /// protected override void SaveData() { throw new NotImplementedException(); } internal override void Process(Session session) { session.OnUserAuthenticationFailureReceived(this); } } }