SshIdentification
Represents an SSH identification.
using System;
namespace Renci.SshNet.Connection
{
public sealed class SshIdentification
{
public string SoftwareVersion { get; }
public string ProtocolVersion { get; }
public string Comments { get; }
public SshIdentification(string protocolVersion, string softwareVersion)
: this(protocolVersion, softwareVersion, null)
{
}
public SshIdentification(string protocolVersion, string softwareVersion, string comments)
{
if (protocolVersion == null)
throw new ArgumentNullException("protocolVersion");
if (softwareVersion == null)
throw new ArgumentNullException("softwareVersion");
ProtocolVersion = protocolVersion;
SoftwareVersion = softwareVersion;
Comments = comments;
}
public override string ToString()
{
string text = "SSH-" + ProtocolVersion + "-" + SoftwareVersion;
if (Comments != null)
text = text + " " + Comments;
return text;
}
}
}