Table of Contents

Interface IKeyExchange

Namespace
Renci.SshNet.Security
Assembly
Renci.SshNet.dll

Represents a key exchange algorithm.

public interface IKeyExchange : IDisposable

Implements

Properties

ExchangeHash

Gets the exchange hash.

byte[] ExchangeHash { get; }

Property Value

byte[]

Name

Gets the name of the algorithm.

string Name { get; }

Property Value

string

Methods

CreateClientCipher(out bool)

Creates the client-side cipher to use.

Cipher CreateClientCipher(out bool isAead)

Parameters

isAead bool

true to indicate the cipher is AEAD, false to indicate the cipher is not AEAD.

Returns

Cipher

The client cipher.

CreateClientHash(out bool)

Creates the client-side hash algorithm to use.

HashAlgorithm CreateClientHash(out bool isEncryptThenMAC)

Parameters

isEncryptThenMAC bool

true to enable encrypt-then-MAC, false to use encrypt-and-MAC.

Returns

HashAlgorithm

The client hash algorithm.

CreateCompressor()

Creates the compression algorithm to use to deflate data.

Compressor CreateCompressor()

Returns

Compressor

The compression method to deflate data.

CreateDecompressor()

Creates the compression algorithm to use to inflate data.

Compressor CreateDecompressor()

Returns

Compressor

The compression method to inflate data.

CreateServerCipher(out bool)

Creates the server-side cipher to use.

Cipher CreateServerCipher(out bool isAead)

Parameters

isAead bool

true to indicate the cipher is AEAD, false to indicate the cipher is not AEAD.

Returns

Cipher

The server cipher.

CreateServerHash(out bool)

Creates the server-side hash algorithm to use.

HashAlgorithm CreateServerHash(out bool isEncryptThenMAC)

Parameters

isEncryptThenMAC bool

true to enable encrypt-then-MAC, false to use encrypt-and-MAC.

Returns

HashAlgorithm

The server hash algorithm.

Finish()

Finishes the key exchange algorithm.

void Finish()

Start(Session, KeyExchangeInitMessage, bool)

Starts the key exchange algorithm.

void Start(Session session, KeyExchangeInitMessage message, bool sendClientInitMessage)

Parameters

session Session

The session.

message KeyExchangeInitMessage

The key exchange init message received from the server.

sendClientInitMessage bool

Whether to send a key exchange init message in response.

HostKeyReceived

Occurs when the host key is received.

event EventHandler<HostKeyEventArgs> HostKeyReceived

Event Type

EventHandler<HostKeyEventArgs>