Class KeyExchangeDiffieHellman
- Namespace
- Renci.SshNet.Security
- Assembly
- Renci.SshNet.dll
Provides the implementation of "diffie-hellman-groupN" algorithms.
public class KeyExchangeDiffieHellman : KeyExchange, IKeyExchange, IDisposableInheritance
Implements
Inherited Members
Constructors
KeyExchangeDiffieHellman(string, DHParameters, HashAlgorithmName)
Initializes a new instance of the Renci.SshNet.Security.KeyExchangeDiffieHellman class.
public KeyExchangeDiffieHellman(string name, DHParameters parameters, HashAlgorithmName hashAlgorithm)Parameters
namestring-
The name of the key exchange algorithm.
parametersDHParameters-
The Diffie-Hellman parameters to be used.
hashAlgorithmHashAlgorithmName-
The hash algorithm to be used.
Exceptions
- ArgumentNullException
-
name,parameters, or System.Security.Cryptography.HashAlgorithmName.Name is null. - ArgumentException
-
hashAlgorithmis not a valid hash algorithm.
Properties
Name
Gets the algorithm name.
public override string Name { get; }Property Value
Methods
CalculateHash()
Calculates key exchange hash value.
protected override byte[] CalculateHash()Returns
- byte[]
-
Key exchange hash.
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Hash(byte[])
Hashes the specified data bytes.
protected override byte[] Hash(byte[] hashData)Parameters
hashDatabyte[]-
The hash data.
Returns
- byte[]
-
The hash of the data.
Start(Session, KeyExchangeInitMessage, bool)
Starts the key exchange algorithm.
public override void Start(Session session, KeyExchangeInitMessage message, bool sendClientInitMessage)Parameters
sessionSession-
The session.
messageKeyExchangeInitMessage-
The key exchange init message received from the server.
sendClientInitMessagebool-
Whether to send a key exchange init message in response.
ValidateExchangeHash()
Validates the exchange hash.
protected override bool ValidateExchangeHash()