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

IKeyExchange

public interface IKeyExchange : IDisposable
Represents a key exchange algorithm.
using Renci.SshNet.Common; using Renci.SshNet.Compression; using Renci.SshNet.Messages.Transport; using Renci.SshNet.Security.Cryptography; using System; using System.Security.Cryptography; namespace Renci.SshNet.Security { public interface IKeyExchange : IDisposable { string Name { get; } byte[] ExchangeHash { get; } event EventHandler<HostKeyEventArgs> HostKeyReceived; void Start(Session session, KeyExchangeInitMessage message, bool sendClientInitMessage); void Finish(); Cipher CreateClientCipher(); Cipher CreateServerCipher(); HashAlgorithm CreateServerHash(out bool isEncryptThenMAC); HashAlgorithm CreateClientHash(out bool isEncryptThenMAC); Compressor CreateCompressor(); Compressor CreateDecompressor(); } }