C# Class Renci.SshNet.Security.KeyExchange

Represents base class for different key exchange algorithm implementations
Inheritance: Renci.SshNet.Security.Algorithm, IDisposable
Datei anzeigen Open project: sshnet/SSH.NET

Public Methods

Method Description
CreateClientCipher ( ) : Cipher

Creates the client side cipher to use.

CreateClientHash ( ) : HashAlgorithm

Creates the client side hash algorithm to use.

CreateCompressor ( ) : Compressor

Creates the compression algorithm to use to deflate data.

CreateDecompressor ( ) : Compressor

Creates the compression algorithm to use to inflate data.

CreateServerCipher ( ) : Cipher

Creates the server side cipher to use.

CreateServerHash ( ) : HashAlgorithm

Creates the server side hash algorithm to use.

Dispose ( ) : void

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

Finish ( ) : void

Finishes key exchange algorithm.

Start ( Session session, KeyExchangeInitMessage message ) : void

Starts key exchange algorithm

Protected Methods

Method Description
CalculateHash ( ) : byte[]

Calculates key exchange hash value.

CanTrustHostKey ( KeyHostAlgorithm host ) : bool

Determines whether the specified host key can be trusted.

Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

Hash ( byte hashData ) : byte[]

Hashes the specified data bytes.

SendMessage ( Message message ) : void

Sends SSH message to the server

ValidateExchangeHash ( ) : bool

Validates the exchange hash.

Private Methods

Method Description
GenerateSessionKey ( BigInteger sharedKey, byte exchangeHash, byte key, int size ) : byte[]

Generates the session key.

GenerateSessionKey ( BigInteger sharedKey, byte exchangeHash, char p, byte sessionId ) : byte[]

Generates the session key.

Method Details

CalculateHash() protected abstract method

Calculates key exchange hash value.
protected abstract CalculateHash ( ) : byte[]
return byte[]

CanTrustHostKey() protected method

Determines whether the specified host key can be trusted.
protected CanTrustHostKey ( KeyHostAlgorithm host ) : bool
host KeyHostAlgorithm The host algorithm.
return bool

CreateClientCipher() public method

Creates the client side cipher to use.
public CreateClientCipher ( ) : Cipher
return Cipher

CreateClientHash() public method

Creates the client side hash algorithm to use.
public CreateClientHash ( ) : HashAlgorithm
return HashAlgorithm

CreateCompressor() public method

Creates the compression algorithm to use to deflate data.
public CreateCompressor ( ) : Compressor
return Renci.SshNet.Compression.Compressor

CreateDecompressor() public method

Creates the compression algorithm to use to inflate data.
public CreateDecompressor ( ) : Compressor
return Renci.SshNet.Compression.Compressor

CreateServerCipher() public method

Creates the server side cipher to use.
public CreateServerCipher ( ) : Cipher
return Cipher

CreateServerHash() public method

Creates the server side hash algorithm to use.
public CreateServerHash ( ) : HashAlgorithm
return HashAlgorithm

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

Dispose() protected method

Releases unmanaged and - optionally - managed resources
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

Finish() public method

Finishes key exchange algorithm.
public Finish ( ) : void
return void

Hash() protected method

Hashes the specified data bytes.
protected Hash ( byte hashData ) : byte[]
hashData byte The hash data.
return byte[]

SendMessage() protected method

Sends SSH message to the server
protected SendMessage ( Message message ) : void
message Renci.SshNet.Messages.Message The message.
return void

Start() public method

Starts key exchange algorithm
public Start ( Session session, KeyExchangeInitMessage message ) : void
session Session The session.
message Renci.SshNet.Messages.Transport.KeyExchangeInitMessage Key exchange init message.
return void

ValidateExchangeHash() protected abstract method

Validates the exchange hash.
protected abstract ValidateExchangeHash ( ) : bool
return bool