Table of Contents

Class HostKeyEventArgs

Namespace
Renci.SshNet.Common
Assembly
Renci.SshNet.dll

Provides data for the HostKeyReceived event.

public class HostKeyEventArgs : EventArgs

Inheritance

Inherited Members

Constructors

HostKeyEventArgs(KeyHostAlgorithm)

Initializes a new instance of the Renci.SshNet.Common.HostKeyEventArgs class.

public HostKeyEventArgs(KeyHostAlgorithm host)

Parameters

host KeyHostAlgorithm

The host.

Exceptions

ArgumentNullException

host is null.

Properties

CanTrust

Gets or sets a value indicating whether host key can be trusted.

public bool CanTrust { get; set; }

Property Value

bool

Certificate

Gets the certificate presented by the host, or null if the host did not present a certificate.

public Certificate? Certificate { get; }

Property Value

Certificate?

FingerPrint

Gets the MD5 fingerprint.

public byte[] FingerPrint { get; }

Property Value

byte[]

FingerPrintMD5

Gets the MD5 fingerprint of the host key in the same format as the ssh command, i.e. hexadecimal bytes separated by colons, but without the MD5: prefix.

public string FingerPrintMD5 { get; }

Property Value

string

Examples

97:70:33:82:fd:29:3a:73:39:af:6a:07:ad:f8:80:49.

FingerPrintSHA256

Gets the SHA256 fingerprint of the host key in the same format as the ssh command, i.e. non-padded base64, but without the SHA256: prefix.

public string FingerPrintSHA256 { get; }

Property Value

string

Examples

ohD8VZEXGWo6Ez8GSEJQ9WpafgLFsOfLOtGGQCQo6Og.

HostKey

Gets the host key.

public byte[] HostKey { get; }

Property Value

byte[]

HostKeyName

Gets the host key name.

public string HostKeyName { get; }

Property Value

string

KeyLength

Gets the length of the key in bits.

public int KeyLength { get; }

Property Value

int