< Summary

Information
Class: Renci.SshNet.Messages.Transport.KeyExchangeDhReplyMessage
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Transport\KeyExchangeDhReplyMessage.cs
Line coverage
42%
Covered lines: 11
Uncovered lines: 15
Coverable lines: 26
Total lines: 72
Line coverage: 42.3%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_HostKey()100%1100%
get_F()100%1100%
get_Signature()100%1100%
get_BufferCapacity()100%10%
LoadData()100%1100%
SaveData()100%10%
Process(...)100%1100%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Transport\KeyExchangeDhReplyMessage.cs

#LineLine coverage
 1namespace Renci.SshNet.Messages.Transport
 2{
 3    /// <summary>
 4    /// Represents SSH_MSG_KEXDH_REPLY message.
 5    /// </summary>
 6    [Message("SSH_MSG_KEXDH_REPLY", 31)]
 7    public class KeyExchangeDhReplyMessage : Message
 8    {
 9        /// <summary>
 10        /// Gets server public host key and certificates.
 11        /// </summary>
 12        /// <value>The host key.</value>
 2413        public byte[] HostKey { get; private set; }
 14
 15        /// <summary>
 16        /// Gets the F value.
 17        /// </summary>
 2418        public byte[] F { get; private set; }
 19
 20        /// <summary>
 21        /// Gets the signature of H.
 22        /// </summary>
 23        /// <value>The signature.</value>
 2424        public byte[] Signature { get; private set; }
 25
 26        /// <summary>
 27        /// Gets the size of the message in bytes.
 28        /// </summary>
 29        /// <value>
 30        /// The size of the messages in bytes.
 31        /// </value>
 32        protected override int BufferCapacity
 33        {
 34            get
 035            {
 036                var capacity = base.BufferCapacity;
 037                capacity += 4; // HostKey length
 038                capacity += HostKey.Length; // HostKey
 039                capacity += 4; // F length
 040                capacity += F.Length; // F
 041                capacity += 4; // Signature length
 042                capacity += Signature.Length; // Signature
 043                return capacity;
 044            }
 45        }
 46
 47        /// <summary>
 48        /// Called when type specific data need to be loaded.
 49        /// </summary>
 50        protected override void LoadData()
 1251        {
 1252            HostKey = ReadBinary();
 1253            F = ReadBinary();
 1254            Signature = ReadBinary();
 1255        }
 56
 57        /// <summary>
 58        /// Called when type specific data need to be saved.
 59        /// </summary>
 60        protected override void SaveData()
 061        {
 062            WriteBinaryString(HostKey);
 063            WriteBinaryString(F);
 064            WriteBinaryString(Signature);
 065        }
 66
 67        internal override void Process(Session session)
 1268        {
 1269            session.OnKeyExchangeDhReplyMessageReceived(this);
 1270        }
 71    }
 72}