f920353a0925eeb88ec687226a08b5e3c656b93b
[mono.git] / mcs / class / System / ReferenceSources / _SecureChannel.cs
1 //
2 // Mono-specific additions to Microsoft's _SecureChannel.cs
3 //
4 #if MONO_FEATURE_NEW_TLS && SECURITY_DEP
5 #if MONO_SECURITY_ALIAS
6 extern alias MonoSecurity;
7 using MonoSecurity::Mono.Security.Interface;
8 #else
9 using Mono.Security.Interface;
10 #endif
11 namespace System.Net.Security
12 {
13         partial class SecureChannel
14         {
15                 internal MonoTlsConnectionInfo GetMonoConnectionInfo ()
16                 {
17                         return SSPIWrapper.GetMonoConnectionInfo (m_SecModule, m_SecurityContext);
18                 }
19
20                 internal ProtocolToken CreateShutdownMessage ()
21                 {
22                         var buffer = SSPIWrapper.CreateShutdownMessage (m_SecModule, m_SecurityContext);
23                         return new ProtocolToken (buffer, SecurityStatus.ContinueNeeded);
24                 }
25
26                 internal ProtocolToken CreateHelloRequestMessage ()
27                 {
28                         var buffer = SSPIWrapper.CreateHelloRequestMessage (m_SecModule, m_SecurityContext);
29                         return new ProtocolToken (buffer, SecurityStatus.ContinueNeeded);
30                 }
31
32                 internal bool IsClosed {
33                         get {
34                                 if (m_SecModule == null || m_SecurityContext == null || m_SecurityContext.IsClosed)
35                                         return true;
36                                 return SSPIWrapper.IsClosed (m_SecModule, m_SecurityContext);
37                         }
38                 }
39         }
40 }
41 #endif