public byte[] Build() { var sshDataStream = new SshDataStream(0); sshDataStream.WriteByte(KeyExchangeDhGroupExchangeReply.MessageNumber); sshDataStream.Write((uint)(4 + _hostKeyAlgorithm.Length + _hostKeys.Length)); sshDataStream.Write((uint) _hostKeyAlgorithm.Length); sshDataStream.Write(_hostKeyAlgorithm, 0, _hostKeyAlgorithm.Length); sshDataStream.Write(_hostKeys, 0, _hostKeys.Length); sshDataStream.Write(_f); sshDataStream.WriteBinary(_signature); return sshDataStream.ToArray(); }
/// <summary> /// Writes data into internal buffer. /// </summary> /// <param name="buffer">The data to write.</param> /// <exception cref="ArgumentNullException"><paramref name="buffer"/> is <c>null</c>.</exception> protected void WriteBinaryString(byte[] buffer) { _stream.WriteBinary(buffer); }
public byte[] Build() { var serviceName = _serviceName.ToArray(); var sshDataStream = new SshDataStream(4 + 1 + 1 + 4 + serviceName.Length); sshDataStream.Write((uint)(sshDataStream.Capacity - 4)); // packet length sshDataStream.WriteByte(0); // padding length sshDataStream.WriteByte(ServiceAcceptMessage.MessageNumber); sshDataStream.WriteBinary(serviceName); return sshDataStream.ToArray(); }