/// <returns>a signature of the original data followed by the data compressed with gzip.</returns> private byte[] SignAndCompress(byte[] buffer) { using (var memory = new MemoryStream()) { using (var gzip = new GZipStream(memory, CompressionMode.Compress)) { gzip.Write(buffer, 0, buffer.Length); } return(_signing.GetSignature(buffer).Concat(memory.ToArray()).ToArray()); } }