Merge pull request #5444 from hifi/fix-tds-inputoutput
[mono.git] / mcs / class / Mono.Security / Mono.Security.Interface / MonoTlsProvider.cs
index 740d79536481597c38bebe58cea2470c5fd8fdbe..5a03262e229f281a0ce751f4a28c6ed160902969 100644 (file)
@@ -72,6 +72,10 @@ namespace Mono.Security.Interface
 
        public abstract class MonoTlsProvider
        {
+               internal MonoTlsProvider ()
+               {
+               }
+
                public abstract Guid ID {
                        get;
                }
@@ -118,17 +122,33 @@ namespace Mono.Security.Interface
                        Stream innerStream, bool leaveInnerStreamOpen,
                        MonoTlsSettings settings = null);
 
+               internal abstract IMonoSslStream CreateSslStreamInternal (
+                       SslStream sslStream, Stream innerStream, bool leaveInnerStreamOpen,
+                       MonoTlsSettings settings);
+
 #endregion
 
-#region Certificate Validation
+#region Native Certificate Implementation
 
-               /*
-                * Allows a TLS provider to provide a custom system certificiate validator.
-                */
-               public virtual bool HasCustomSystemCertificateValidator {
+               internal virtual bool HasNativeCertificates {
                        get { return false; }
                }
 
+               internal virtual X509Certificate2Impl GetNativeCertificate (
+                       byte[] data, string password, X509KeyStorageFlags flags)
+               {
+                       throw new InvalidOperationException ();
+               }
+
+               internal virtual X509Certificate2Impl GetNativeCertificate (
+                       X509Certificate certificate)
+               {
+                       throw new InvalidOperationException ();
+               }
+
+#endregion
+
+#region Certificate Validation
                /*
                 * If @serverMode is true, then we're a server and want to validate a certificate
                 * that we received from a client.
@@ -138,33 +158,19 @@ namespace Mono.Security.Interface
                 * Returns `true` if certificate validation has been performed and `false` to invoke the
                 * default system validator.
                 */
-               public virtual bool InvokeSystemCertificateValidator (
-                       ICertificateValidator validator, string targetHost, bool serverMode,
-                       X509CertificateCollection certificates, X509Chain chain, out bool success,
-                       ref MonoSslPolicyErrors errors, ref int status11)
-               {
-                       success = false;
-                       return false;
-               }
-
+               internal abstract bool ValidateCertificate (
+                       ICertificateValidator2 validator, string targetHost, bool serverMode,
+                       X509CertificateCollection certificates, bool wantsChain, ref X509Chain chain,
+                       ref MonoSslPolicyErrors errors, ref int status11);
 #endregion
 
-#region Manged SSPI
+#region Misc
 
-               /*
-                * The managed SSPI implementation from the new TLS code.
-                */
-
-               public abstract bool SupportsTlsContext {
+               internal abstract bool SupportsCleanShutdown {
                        get;
                }
 
-               public abstract IMonoTlsContext CreateTlsContext (
-                       string hostname, bool serverMode, TlsProtocols protocolFlags,
-                       X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
-                       bool remoteCertRequired, MonoEncryptionPolicy encryptionPolicy,
-                       MonoTlsSettings settings);
-
 #endregion
+
        }
 }