<PackageReference Include="SSH.NET" Version="2020.0.2" />

HostKeyEventArgs

public class HostKeyEventArgs : EventArgs
Provides data for the HostKeyReceived event.
using Renci.SshNet.Abstractions; using Renci.SshNet.Security; using System; using System.Security.Cryptography; namespace Renci.SshNet.Common { public class HostKeyEventArgs : EventArgs { public bool CanTrust { get; set; } public byte[] HostKey { get; set; } public string HostKeyName { get; set; } public byte[] FingerPrint { get; set; } public int KeyLength { get; set; } public HostKeyEventArgs(KeyHostAlgorithm host) { CanTrust = true; HostKey = host.Data; HostKeyName = host.Name; KeyLength = host.Key.KeyLength; using (MD5 mD = CryptoAbstraction.CreateMD5()) FingerPrint = mD.ComputeHash(host.Data); } } }