<PackageReference Include="SSH.NET" Version="2014.4.6-beta2" />

KeyExchange

public abstract class KeyExchange : Algorithm, IDisposable
Represents base class for different key exchange algorithm implementations
public byte[] ExchangeHash { get; }

Gets the exchange hash.

protected Session Session { get; }

Gets or sets the session.

public BigInteger SharedKey { get; protected set; }

Gets or sets key exchange shared key.

Occurs when host key received.

protected KeyExchange()

protected abstract byte[] CalculateHash()

Calculates key exchange hash value.

protected bool CanTrustHostKey(KeyHostAlgorithm host)

Determines whether the specified host key can be trusted.

Creates the client side cipher to use.

Creates the client side hash algorithm to use.

Creates the compression algorithm to use to deflate data.

Creates the compression algorithm to use to inflate data.

Creates the server side cipher to use.

Creates the server side hash algorithm to use.

public void Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged ResourceMessages.

protected virtual void Dispose(bool disposing)

Releases unmanaged and - optionally - managed resources

public virtual void Finish()

Finishes key exchange algorithm.

protected virtual byte[] Hash(byte[] hashData)

Hashes the specified data bytes.

protected void SendMessage(Message message)

Sends SSH message to the server

public virtual void Start(Session session, KeyExchangeInitMessage message)

Starts key exchange algorithm

protected abstract bool ValidateExchangeHash()

Validates the exchange hash.