Class KeyExchangeDiffieHellmanGroupExchange
- Namespace
- Renci.SshNet.Security
- Assembly
- Renci.SshNet.dll
Provides the implementation of "diffie-hellman-group-exchange" algorithms.
public class KeyExchangeDiffieHellmanGroupExchange : KeyExchange, IKeyExchange, IDisposableInheritance
Implements
Inherited Members
Constructors
KeyExchangeDiffieHellmanGroupExchange(string, HashAlgorithmName)
Initializes a new instance of the Renci.SshNet.Security.KeyExchangeDiffieHellmanGroupExchange class.
public KeyExchangeDiffieHellmanGroupExchange(string name, HashAlgorithmName hashAlgorithm)Parameters
namestring-
The name of the key exchange algorithm.
hashAlgorithmHashAlgorithmName-
The hash algorithm to be used.
Exceptions
- ArgumentNullException
-
nameor System.Security.Cryptography.HashAlgorithmName.Name is null. - ArgumentException
-
hashAlgorithmis not a valid hash algorithm.
KeyExchangeDiffieHellmanGroupExchange(string, HashAlgorithmName, uint, uint, uint)
Initializes a new instance of the Renci.SshNet.Security.KeyExchangeDiffieHellmanGroupExchange class.
public KeyExchangeDiffieHellmanGroupExchange(string name, HashAlgorithmName hashAlgorithm, uint minimumGroupSize, uint preferredGroupSize, uint maximumGroupSize)Parameters
namestring-
The name of the key exchange algorithm.
hashAlgorithmHashAlgorithmName-
The hash algorithm to be used.
minimumGroupSizeuint-
The minimum size in bits of an acceptable group.
preferredGroupSizeuint-
The preferred size in bits of an acceptable group.
maximumGroupSizeuint-
The maximum size in bits of an acceptable group.
Exceptions
- ArgumentNullException
-
nameor System.Security.Cryptography.HashAlgorithmName.Name is null. - ArgumentException
-
hashAlgorithmis not a valid hash algorithm. - ArgumentOutOfRangeException
-
preferredGroupSizeis not betweenminimumGroupSizeandmaximumGroupSize.
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()