Merge pull request #3591 from directhex/mono_libdir_fallback
[mono.git] / mcs / class / System / Mono.Net.Security / NoReflectionHelper.cs
index b703ec7411a1837c282286b629d2c1dcd11d4606..2787775d30204014f088f82f644ced144f584b02 100644 (file)
@@ -33,9 +33,12 @@ using MX = MonoSecurity::Mono.Security.X509;
 using MSI = Mono.Security.Interface;
 using MX = Mono.Security.X509;
 #endif
+using System.Security.Cryptography.X509Certificates;
 #endif
 
 using System;
+using System.Net;
+using System.Net.Security;
 
 namespace Mono.Net.Security
 {
@@ -44,7 +47,16 @@ namespace Mono.Net.Security
        //
        internal static class NoReflectionHelper
        {
-               internal static object GetDefaultCertificateValidator (object settings)
+               internal static object GetInternalValidator (object provider, object settings)
+               {
+                       #if SECURITY_DEP
+                       return ChainValidationHelper.GetInternalValidator ((MSI.MonoTlsProvider)provider, (MSI.MonoTlsSettings)settings);
+                       #else
+                       throw new NotSupportedException ();
+                       #endif
+               }
+
+               internal static object GetDefaultValidator (object settings)
                {
                        #if SECURITY_DEP
                        return ChainValidationHelper.GetDefaultValidator ((MSI.MonoTlsSettings)settings);
@@ -52,5 +64,87 @@ namespace Mono.Net.Security
                        throw new NotSupportedException ();
                        #endif
                }
+
+               internal static object GetProvider ()
+               {
+                       #if SECURITY_DEP
+                       return MonoTlsProviderFactory.GetProvider ();
+                       #else
+                       throw new NotSupportedException ();
+                       #endif
+               }
+
+               internal static bool IsInitialized {
+                       get {
+                               #if SECURITY_DEP
+                               return MonoTlsProviderFactory.IsInitialized;
+                               #else
+                               throw new NotSupportedException ();
+                               #endif
+                       }
+               }
+
+               internal static void Initialize ()
+               {
+                       #if SECURITY_DEP
+                       MonoTlsProviderFactory.Initialize ();
+                       #else
+                       throw new NotSupportedException ();
+                       #endif
+               }
+
+               internal static void Initialize (string provider)
+               {
+                       #if SECURITY_DEP
+                       MonoTlsProviderFactory.Initialize (provider);
+                       #else
+                       throw new NotSupportedException ();
+                       #endif
+               }
+
+               internal static HttpWebRequest CreateHttpsRequest (Uri requestUri, object provider, object settings)
+               {
+                       #if SECURITY_DEP
+                       return MonoTlsProviderFactory.CreateHttpsRequest (requestUri, (MSI.MonoTlsProvider)provider, (MSI.MonoTlsSettings)settings);
+                       #else
+                       throw new NotSupportedException ();
+                       #endif
+               }
+
+               internal static object CreateHttpListener (object certificate, object provider, object settings)
+               {
+                       #if SECURITY_DEP
+                       return MonoTlsProviderFactory.CreateHttpListener ((X509Certificate)certificate, (MSI.MonoTlsProvider)provider, (MSI.MonoTlsSettings)settings);
+                       #else
+                       throw new NotSupportedException ();
+                       #endif
+               }
+
+               internal static object GetMonoSslStream (SslStream stream)
+               {
+                       #if SECURITY_DEP
+                       return stream.Impl;
+                       #else
+                       throw new NotSupportedException ();
+                       #endif
+               }
+
+               internal static bool IsProviderSupported (string name)
+               {
+                       #if SECURITY_DEP
+                       return MonoTlsProviderFactory.IsProviderSupported (name);
+                       #else
+                       throw new NotSupportedException ();
+                       #endif
+               }
+
+               internal static object GetProvider (string name)
+               {
+                       #if SECURITY_DEP
+                       return MonoTlsProviderFactory.GetProvider (name);
+                       #else
+                       throw new NotSupportedException ();
+                       #endif
+               }
        }
 }