public static byte[] CreateHeartbeatExtension(HeartbeatExtension heartbeatExtension)
        {
            if (heartbeatExtension == null)
            {
                throw new TlsFatalAlert(80);
            }
            MemoryStream memoryStream = new MemoryStream();

            heartbeatExtension.Encode(memoryStream);
            return(memoryStream.ToArray());
        }
Example #2
0
        /// <exception cref="IOException"></exception>
        public static byte[] CreateHeartbeatExtension(HeartbeatExtension heartbeatExtension)
        {
            if (heartbeatExtension == null)
            {
                throw new TlsFatalAlert(AlertDescription.internal_error);
            }

            MemoryStream buf = new MemoryStream();

            heartbeatExtension.Encode(buf);

            return(buf.ToArray());
        }
Example #3
0
        public static byte[] CreateHeartbeatExtension(HeartbeatExtension heartbeatExtension)
        {
            //IL_000b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0011: Expected O, but got Unknown
            if (heartbeatExtension == null)
            {
                throw new TlsFatalAlert(80);
            }
            MemoryStream val = new MemoryStream();

            heartbeatExtension.Encode((Stream)(object)val);
            return(val.ToArray());
        }
        /// <exception cref="IOException"></exception>
        public static byte[] CreateHeartbeatExtension(HeartbeatExtension heartbeatExtension)
        {
            if (heartbeatExtension == null)
                throw new TlsFatalAlert(AlertDescription.internal_error);

            MemoryStream buf = new MemoryStream();

            heartbeatExtension.Encode(buf);

            return buf.ToArray();
        }