Xceed .NET Libraries Documentation
Xceed.SSH.Protocols Assembly / Xceed.SSH.Protocols Namespace / SSHTransportLayerProtocol Class / FitKey Method
This is KThis is HThis is K1


In This Topic
    FitKey Method
    In This Topic
    RFC 4253: 7.2. Output from Key Exchange
    Syntax
    'Declaration
     
    
    Public Function FitKey( _
       ByVal keyExchangeAlgorithm As ISSHKeyExchangeAlgorithm, _
       ByVal sharedSecret() As Byte, _
       ByVal exchangeHash() As Byte, _
       ByVal key() As Byte, _
       ByVal targetSize As Integer _
    ) As Byte()
    'Usage
     
    
    Dim instance As SSHTransportLayerProtocol
    Dim keyExchangeAlgorithm As ISSHKeyExchangeAlgorithm
    Dim sharedSecret() As Byte
    Dim exchangeHash() As Byte
    Dim key() As Byte
    Dim targetSize As Integer
    Dim value() As Byte
     
    value = instance.FitKey(keyExchangeAlgorithm, sharedSecret, exchangeHash, key, targetSize)

    Parameters

    keyExchangeAlgorithm
    sharedSecret
    This is KThis is HThis is K1
    exchangeHash
    key
    targetSize
    Remarks
    Key data MUST be taken from the beginning of the hash output. As many bytes as needed are taken from the beginning of the hash value. If the key length needed is longer than the output of the HASH, the key is extended by computing HASH of the concatenation of K and H and the entire key so far, and appending the resulting bytes (as many as HASH generates) to the key. This process is repeated until enough key material is available; the key is taken from the beginning of this value. In other words: K1 = HASH(K || H || X || session_id) (X is e.g., "A") K2 = HASH(K || H || K1) K3 = HASH(K || H || K1 || K2) ... key = K1 || K2 || K3 || ...
    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Standard: netstandard2.0, netstandard2.1

    .NET Framework: net20, net35, net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also