public static byte[] CreateServerNameExtension(ServerNameList serverNameList)
        {
            if (serverNameList == null)
            {
                throw new TlsFatalAlert(80);
            }
            MemoryStream memoryStream = new MemoryStream();

            serverNameList.Encode(memoryStream);
            return(memoryStream.ToArray());
        }
        public static ServerNameList ReadServerNameExtension(byte[] extensionData)
        {
            if (extensionData == null)
            {
                throw new ArgumentNullException("extensionData");
            }
            MemoryStream   memoryStream = new MemoryStream(extensionData, writable: false);
            ServerNameList result       = ServerNameList.Parse(memoryStream);

            TlsProtocol.AssertEmpty(memoryStream);
            return(result);
        }
        public static ServerNameList ReadServerNameExtension(byte[] extensionData)
        {
            if (extensionData == null)
            {
                throw new ArgumentNullException("extensionData");
            }
            MemoryStream   input = new MemoryStream(extensionData, false);
            ServerNameList list  = ServerNameList.Parse(input);

            TlsProtocol.AssertEmpty(input);
            return(list);
        }
Пример #4
0
        /// <exception cref="IOException"></exception>
        public static byte[] CreateServerNameExtension(ServerNameList serverNameList)
        {
            if (serverNameList == null)
            {
                throw new TlsFatalAlert(AlertDescription.internal_error);
            }

            MemoryStream buf = new MemoryStream();

            serverNameList.Encode(buf);

            return(buf.ToArray());
        }
Пример #5
0
        public static byte[] CreateServerNameExtension(ServerNameList serverNameList)
        {
            //IL_000b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0011: Expected O, but got Unknown
            if (serverNameList == null)
            {
                throw new TlsFatalAlert(80);
            }
            MemoryStream val = new MemoryStream();

            serverNameList.Encode((Stream)(object)val);
            return(val.ToArray());
        }
Пример #6
0
        public static ServerNameList ReadServerNameExtension(byte[] extensionData)
        {
            //IL_0008: Unknown result type (might be due to invalid IL or missing references)
            //IL_0010: Unknown result type (might be due to invalid IL or missing references)
            //IL_0016: Expected O, but got Unknown
            if (extensionData == null)
            {
                throw new ArgumentNullException("extensionData");
            }
            MemoryStream   val    = new MemoryStream(extensionData, false);
            ServerNameList result = ServerNameList.Parse((Stream)(object)val);

            TlsProtocol.AssertEmpty(val);
            return(result);
        }
Пример #7
0
 /// <exception cref="IOException"></exception>
 public static void AddServerNameExtension(IDictionary extensions, ServerNameList serverNameList)
 {
     extensions[ExtensionType.server_name] = CreateServerNameExtension(serverNameList);
 }
Пример #8
0
 public static void AddServerNameExtension(IDictionary extensions, ServerNameList serverNameList)
 {
     extensions.set_Item((object)0, (object)CreateServerNameExtension(serverNameList));
 }
Пример #9
0
 /// <exception cref="IOException"></exception>
 public static void AddServerNameExtension(IDictionary extensions, ServerNameList serverNameList)
 {
     extensions[ExtensionType.server_name] = CreateServerNameExtension(serverNameList);
 }
Пример #10
0
        /// <exception cref="IOException"></exception>
        public static byte[] CreateServerNameExtension(ServerNameList serverNameList)
        {
            if (serverNameList == null)
                throw new TlsFatalAlert(AlertDescription.internal_error);

            MemoryStream buf = new MemoryStream();
        
            serverNameList.Encode(buf);

            return buf.ToArray();
        }
 public static void AddServerNameExtension(IDictionary extensions, ServerNameList serverNameList)
 {
     extensions[0] = TlsExtensionsUtilities.CreateServerNameExtension(serverNameList);
 }