[Mono.Security.Interface] Cleanup and simplify MonoTlsProviderFactory.
authorMartin Baulig <martin.baulig@xamarin.com>
Tue, 27 Sep 2016 09:53:05 +0000 (11:53 +0200)
committerMartin Baulig <martin.baulig@xamarin.com>
Tue, 27 Sep 2016 20:23:10 +0000 (22:23 +0200)
commitfd6108736c215244d2a5ed64f11e1876295cbd87
tree16a185d3ccfd079df5ac2bee9d5da569162b7f42
parent80950a920fc14bf9d3e03e08953c2590b13a5b46
[Mono.Security.Interface] Cleanup and simplify MonoTlsProviderFactory.

The "global" TLS Provider (returned by MonoTlsProviderFactory.GetProvider())
may only be modified at application startup (before any of the TLS / Certificate
code has been used).

* MonoTlsProviderFactory.HasProvider has been removed.

  This property used to initialize the TLS Subsystem without throwing any
  exceptions.  However, properties with side-effects is a bad design principle.

* Add MonoTlsProviderFactory.IsInitialized.

  Does not have any side-effects.

* Add MonoTlsProviderFactory.Initialize() and Initialize(string).

  May only be called at application startup and explicitly initializes the
  TLS Subsystem.

* Rename MonoTlsProviderFactory.GetDefaultProvider() into GetProvider()
  and removed MonoTlsProviderFactory.GetCurrentProvider().

  We do not distinguish between a "default" and a "current" provider anymore;
  there is only one "global" provider.

* Add MonoTlsProviderFactory.IsProviderSupported(string).

  Checks whether a specific TLS Provider is supported, without having side-effects.

* Make the old APIs [Obsolete] until products have been updated.

* Add some documentation to MonoTlsProviderFactory.

(cherry picked from commit 7c3ae83b31a2456d00daf2949706719e3e694d15)
mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs
mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs
mcs/class/System/Mono.Net.Security/NoReflectionHelper.cs