Exemplo n.º 1
0
 public static HttpListener CreateHttpListener(X509Certificate certificate, MonoTlsProvider provider = null, MonoTlsSettings settings = null)
 {
     return((HttpListener)NoReflectionHelper.CreateHttpListener(certificate, provider, settings));
 }
Exemplo n.º 2
0
 /*
  * Installs a custom TLS Provider.
  *
  * May only be called at application startup and will throw
  * @InvalidOperationException if a provider has already been installed.
  */
 public static void InstallProvider(MonoTlsProvider provider)
 {
     NoReflectionHelper.InstallProvider(provider);
 }
Exemplo n.º 3
0
 /*
  * Create @HttpWebRequest with the specified @provider (may be null to use the default one).
  *
  * NOTE: This needs to be written as "System.Uri" to avoid ambiguity with Mono.Security.Uri in the
  *        mobile build.
  *
  */
 public static HttpWebRequest CreateHttpsRequest(System.Uri requestUri, MonoTlsProvider provider, MonoTlsSettings settings = null)
 {
     return(NoReflectionHelper.CreateHttpsRequest(requestUri, provider, settings));
 }
 /*
  * Initialize the TLS Subsystem.
  *
  * This method may be called at any time.  It ensures that the TLS Subsystem is
  * initialized and a provider available.
  */
 public static void Initialize()
 {
     NoReflectionHelper.Initialize();
 }
Exemplo n.º 5
0
 /*
  * Returns the default @MonoTlsProvider.
  *
  * This method throws @NotSupportedException if no TLS Provider can be found.
  */
 public static MonoTlsProvider GetDefaultProvider()
 {
     return((MonoTlsProvider)NoReflectionHelper.GetDefaultProvider());
 }
 public static IMonoSslStream GetMonoSslStream(SslStream stream)
 {
     return((IMonoSslStream)NoReflectionHelper.GetMonoSslStream(stream));
 }
 public static IMonoSslStream GetMonoSslStream(HttpListenerContext context)
 {
     return((IMonoSslStream)NoReflectionHelper.GetMonoSslStream(context));
 }
 /*
  * Checks whether @provider is supported.
  *
  * On mobile, this will always return false when using the linker.
  */
 public static bool IsProviderSupported(string provider)
 {
     return(NoReflectionHelper.IsProviderSupported(provider));
 }
 /*
  * Returns the requested TLS Provider, for use with the call-by-call APIs below.
  *
  * Throw @NotSupportedException if the requested provider is not supported or
  * when using the linker on mobile.
  */
 public static MonoTlsProvider GetProvider(string provider)
 {
     return((MonoTlsProvider)NoReflectionHelper.GetProvider(provider));
 }
 /*
  * Initialize the TLS Subsystem with a specific provider.
  *
  * May only be called at application startup (before any of the TLS / Certificate
  * APIs have been used).
  *
  * Throws @NotSupportedException if the TLS Subsystem is already initialized
  * (@IsInitialized returns true) or the requested provider is not supported.
  *
  * On mobile, this will always throw @NotSupportedException when using the linker.
  */
 public static void Initialize(string provider)
 {
     NoReflectionHelper.Initialize(provider);
 }
 /*
  * Use this overloaded version in user code.
  */
 public static ICertificateValidator GetValidator(MonoTlsSettings settings)
 {
     return((ICertificateValidator)NoReflectionHelper.GetDefaultValidator(settings));
 }
 /*
  * Internal API, intended to be used by MonoTlsProvider implementations.
  */
 internal static ICertificateValidator2 GetInternalValidator(MonoTlsSettings settings, MonoTlsProvider provider)
 {
     return((ICertificateValidator2)NoReflectionHelper.GetInternalValidator(provider, settings));
 }
Exemplo n.º 13
0
 /*
  * Selects the default TLS Provider.
  *
  * May only be called at application startup and will throw
  * @InvalidOperationException if a provider has already been installed.
  */
 public static void SetDefaultProvider(string name)
 {
     NoReflectionHelper.SetDefaultProvider(name);
 }
Exemplo n.º 14
0
 static ICertificateValidator GetDefaultValidator(MonoTlsProvider provider, MonoTlsSettings settings)
 {
     return((ICertificateValidator)NoReflectionHelper.GetDefaultCertificateValidator(provider, settings));
 }