Xceed .NET Libraries Documentation
HostKeyReceived Event (SSHClient)


Xceed.SSH.Client Assembly > Xceed.SSH.Client Namespace > SSHClient Class : HostKeyReceived Event
This event is triggered during connection sequence to a SSH server when the server's public key is received for authentication.
Syntax
'Declaration
 
Public Event HostKeyReceived As HostKeyReceivedEventHandler
'Usage
 
Dim instance As SSHClient

Dim handler As HostKeyReceivedEventHandler

 

AddHandler instance.HostKeyReceived, handler
public event HostKeyReceivedEventHandler HostKeyReceived
Event Data

The event handler receives an argument of type HostKeyReceivedEventArgs containing data related to this event. The following HostKeyReceivedEventArgs properties provide information specific to this event.

PropertyDescription
Gets or sets a System.Boolean value that indicates whether the server's public key should be accepted or rejected by the client. Default is true.  
Gets a System.Byte array that represents the server's raw public key.  
Gets a System.Int32 that represents the length, in bits, of the public key that the raw host key data represents.  
Gets a System.Byte array that represents the server's public key, computed into a MD5 hash value.  
Gets a System.String that represents the server's public key, computed into a MD5 hash value.  
 
 
Gets a System.String that represents the algorithm used to compute the server's public key.  
Gets a ISSHPublicKeyAlgorithm object that represents the algorithm used to compute the server's public key.  
Remarks
The event arguments contain the server's public key. The key is available as an MD5 fingerprint or as the raw byte array. An application that subscribes to the event can accept or reject the key with the AcceptHostKey property.
Example
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also