6c504503995da5ec683fb89b44ce2dd5db12befe
[mono.git] / mcs / class / System / ReferenceSources / Internal.cs
1 //
2 // Internal.cs
3 //
4 // Author:
5 //       Martin Baulig <martin.baulig@xamarin.com>
6 //
7 // Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining a copy
10 // of this software and associated documentation files (the "Software"), to deal
11 // in the Software without restriction, including without limitation the rights
12 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 // copies of the Software, and to permit persons to whom the Software is
14 // furnished to do so, subject to the following conditions:
15 //
16 // The above copyright notice and this permission notice shall be included in
17 // all copies or substantial portions of the Software.
18 //
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 // THE SOFTWARE.
26
27 using System.Runtime.InteropServices;
28 using System.Security.Cryptography.X509Certificates;
29
30 namespace System.Net.Security
31 {
32         //From Schannel.h
33         [Flags]
34         internal enum SchProtocols
35         {
36                 Zero = 0,
37                 PctClient = 0x00000002,
38                 PctServer = 0x00000001,
39                 Pct = (PctClient | PctServer),
40                 Ssl2Client = 0x00000008,
41                 Ssl2Server = 0x00000004,
42                 Ssl2 = (Ssl2Client | Ssl2Server),
43                 Ssl3Client = 0x00000020,
44                 Ssl3Server = 0x00000010,
45                 Ssl3 = (Ssl3Client | Ssl3Server),
46                 Tls10Client = 0x00000080,
47                 Tls10Server = 0x00000040,
48                 Tls10 = (Tls10Client | Tls10Server),
49                 Tls11Client = 0x00000200,
50                 Tls11Server = 0x00000100,
51                 Tls11 = (Tls11Client | Tls11Server),
52                 Tls12Client = 0x00000800,
53                 Tls12Server = 0x00000400,
54                 Tls12 = (Tls12Client | Tls12Server),
55                 Ssl3Tls = (Ssl3 | Tls10),
56                 UniClient = unchecked((int)0x80000000),
57                 UniServer = 0x40000000,
58                 Unified = (UniClient | UniServer),
59                 ClientMask = (PctClient | Ssl2Client | Ssl3Client | Tls10Client | Tls11Client | Tls12Client | UniClient),
60                 ServerMask = (PctServer | Ssl2Server | Ssl3Server | Tls10Server | Tls11Server | Tls12Server | UniServer)
61         }
62
63         //From Schannel.h
64         [StructLayout (LayoutKind.Sequential)]
65         internal class SslConnectionInfo
66         {
67                 public readonly int Protocol;
68                 public readonly int DataCipherAlg;
69                 public readonly int DataKeySize;
70                 public readonly int DataHashAlg;
71                 public readonly int DataHashKeySize;
72                 public readonly int KeyExchangeAlg;
73                 public readonly int KeyExchKeySize;
74
75                 internal SslConnectionInfo (int protocol)
76                 {
77                         Protocol = protocol;
78                 }
79         }
80 }