SslStream.platformnotsupported.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. //
  2. // SslStream.cs
  3. //
  4. // Author:
  5. // Rolf Bjarne Kvinge <[email protected]>
  6. //
  7. // Copyright (c) 2016 Xamarin, Inc.
  8. //
  9. // Permission is hereby granted, free of charge, to any person obtaining a copy
  10. // of this software and associated documentation files (the "Software"), to deal
  11. // in the Software without restriction, including without limitation the rights
  12. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13. // copies of the Software, and to permit persons to whom the Software is
  14. // furnished to do so, subject to the following conditions:
  15. //
  16. // The above copyright notice and this permission notice shall be included in
  17. // all copies or substantial portions of the Software.
  18. //
  19. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  24. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  25. // THE SOFTWARE.
  26. using System.IO;
  27. using System.Security.Authentication;
  28. using System.Security.Cryptography.X509Certificates;
  29. using System.Threading.Tasks;
  30. namespace System.Net.Security
  31. {
  32. /*
  33. * These two are defined by the referencesource; add them here to make
  34. * it easy to switch between the two implementations.
  35. */
  36. internal delegate bool RemoteCertValidationCallback (
  37. string host,
  38. X509Certificate certificate,
  39. X509Chain chain,
  40. SslPolicyErrors sslPolicyErrors);
  41. internal delegate X509Certificate LocalCertSelectionCallback (
  42. string targetHost,
  43. X509CertificateCollection localCertificates,
  44. X509Certificate remoteCertificate,
  45. string[] acceptableIssuers);
  46. public partial class SslStream : System.Net.Security.AuthenticatedStream
  47. {
  48. public SslStream(System.IO.Stream innerStream) : base (default(System.IO.Stream), default(bool)) => throw new PlatformNotSupportedException ();
  49. public SslStream(System.IO.Stream innerStream, bool leaveInnerStreamOpen) : base (default(System.IO.Stream), default(bool)) => throw new PlatformNotSupportedException ();
  50. public SslStream(System.IO.Stream innerStream, bool leaveInnerStreamOpen, System.Net.Security.RemoteCertificateValidationCallback userCertificateValidationCallback) : base (default(System.IO.Stream), default(bool)) => throw new PlatformNotSupportedException ();
  51. public SslStream(System.IO.Stream innerStream, bool leaveInnerStreamOpen, System.Net.Security.RemoteCertificateValidationCallback userCertificateValidationCallback, System.Net.Security.LocalCertificateSelectionCallback userCertificateSelectionCallback) : base (default(System.IO.Stream), default(bool)) => throw new PlatformNotSupportedException ();
  52. public SslStream(System.IO.Stream innerStream, bool leaveInnerStreamOpen, System.Net.Security.RemoteCertificateValidationCallback userCertificateValidationCallback, System.Net.Security.LocalCertificateSelectionCallback userCertificateSelectionCallback, System.Net.Security.EncryptionPolicy encryptionPolicy) : base (default(System.IO.Stream), default(bool)) => throw new PlatformNotSupportedException ();
  53. public override bool CanRead { get { throw new PlatformNotSupportedException (); } }
  54. public override bool CanSeek { get { throw new PlatformNotSupportedException (); } }
  55. public override bool CanTimeout { get { throw new PlatformNotSupportedException (); } }
  56. public override bool CanWrite { get { throw new PlatformNotSupportedException (); } }
  57. public virtual bool CheckCertRevocationStatus { get { throw new PlatformNotSupportedException (); } }
  58. public virtual System.Security.Authentication.CipherAlgorithmType CipherAlgorithm { get { throw new PlatformNotSupportedException (); } }
  59. public virtual int CipherStrength { get { throw new PlatformNotSupportedException (); } }
  60. public virtual System.Security.Authentication.HashAlgorithmType HashAlgorithm { get { throw new PlatformNotSupportedException (); } }
  61. public virtual int HashStrength { get { throw new PlatformNotSupportedException (); } }
  62. public override bool IsAuthenticated { get { throw new PlatformNotSupportedException (); } }
  63. public override bool IsEncrypted { get { throw new PlatformNotSupportedException (); } }
  64. public override bool IsMutuallyAuthenticated { get { throw new PlatformNotSupportedException (); } }
  65. public override bool IsServer { get { throw new PlatformNotSupportedException (); } }
  66. public override bool IsSigned { get { throw new PlatformNotSupportedException (); } }
  67. public virtual System.Security.Authentication.ExchangeAlgorithmType KeyExchangeAlgorithm { get { throw new PlatformNotSupportedException (); } }
  68. public virtual int KeyExchangeStrength { get { throw new PlatformNotSupportedException (); } }
  69. public override long Length { get { throw new PlatformNotSupportedException (); } }
  70. public virtual System.Security.Cryptography.X509Certificates.X509Certificate LocalCertificate { get { throw new PlatformNotSupportedException (); } }
  71. public System.Net.Security.SslApplicationProtocol NegotiatedApplicationProtocol { get { throw new PlatformNotSupportedException (); } }
  72. public override long Position { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
  73. public override int ReadTimeout { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
  74. public virtual System.Security.Cryptography.X509Certificates.X509Certificate RemoteCertificate { get { throw new PlatformNotSupportedException (); } }
  75. public virtual System.Security.Authentication.SslProtocols SslProtocol { get { throw new PlatformNotSupportedException (); } }
  76. public System.Net.TransportContext TransportContext { get { throw new PlatformNotSupportedException (); } }
  77. public override int WriteTimeout { get { throw new PlatformNotSupportedException (); } set { throw new PlatformNotSupportedException (); } }
  78. public virtual void AuthenticateAsClient(string targetHost) { throw new PlatformNotSupportedException (); }
  79. public virtual void AuthenticateAsClient(string targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, bool checkCertificateRevocation) { throw new PlatformNotSupportedException (); }
  80. public virtual void AuthenticateAsClient(string targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { throw new PlatformNotSupportedException (); }
  81. public System.Threading.Tasks.Task AuthenticateAsClientAsync(System.Net.Security.SslClientAuthenticationOptions sslClientAuthenticationOptions, System.Threading.CancellationToken cancellationToken) { throw new PlatformNotSupportedException (); }
  82. public virtual System.Threading.Tasks.Task AuthenticateAsClientAsync(string targetHost) { throw new PlatformNotSupportedException (); }
  83. public virtual System.Threading.Tasks.Task AuthenticateAsClientAsync(string targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, bool checkCertificateRevocation) { throw new PlatformNotSupportedException (); }
  84. public virtual System.Threading.Tasks.Task AuthenticateAsClientAsync(string targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { throw new PlatformNotSupportedException (); }
  85. public virtual void AuthenticateAsServer(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate) { throw new PlatformNotSupportedException (); }
  86. public virtual void AuthenticateAsServer(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation) { throw new PlatformNotSupportedException (); }
  87. public virtual void AuthenticateAsServer(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate, bool clientCertificateRequired, System.Security.Authentication.SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { throw new PlatformNotSupportedException (); }
  88. public System.Threading.Tasks.Task AuthenticateAsServerAsync(System.Net.Security.SslServerAuthenticationOptions sslServerAuthenticationOptions, System.Threading.CancellationToken cancellationToken) { throw new PlatformNotSupportedException (); }
  89. public virtual System.Threading.Tasks.Task AuthenticateAsServerAsync(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate) { throw new PlatformNotSupportedException (); }
  90. public virtual System.Threading.Tasks.Task AuthenticateAsServerAsync(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation) { throw new PlatformNotSupportedException (); }
  91. public virtual System.Threading.Tasks.Task AuthenticateAsServerAsync(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate, bool clientCertificateRequired, System.Security.Authentication.SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { throw new PlatformNotSupportedException (); }
  92. public virtual System.IAsyncResult BeginAuthenticateAsClient(string targetHost, System.AsyncCallback asyncCallback, object asyncState) { throw new PlatformNotSupportedException (); }
  93. public virtual System.IAsyncResult BeginAuthenticateAsClient(string targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, bool checkCertificateRevocation, System.AsyncCallback asyncCallback, object asyncState) { throw new PlatformNotSupportedException (); }
  94. public virtual System.IAsyncResult BeginAuthenticateAsClient(string targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, bool checkCertificateRevocation, System.AsyncCallback asyncCallback, object asyncState) { throw new PlatformNotSupportedException (); }
  95. public virtual System.IAsyncResult BeginAuthenticateAsServer(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate, System.AsyncCallback asyncCallback, object asyncState) { throw new PlatformNotSupportedException (); }
  96. public virtual System.IAsyncResult BeginAuthenticateAsServer(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation, System.AsyncCallback asyncCallback, object asyncState) { throw new PlatformNotSupportedException (); }
  97. public virtual System.IAsyncResult BeginAuthenticateAsServer(System.Security.Cryptography.X509Certificates.X509Certificate serverCertificate, bool clientCertificateRequired, System.Security.Authentication.SslProtocols enabledSslProtocols, bool checkCertificateRevocation, System.AsyncCallback asyncCallback, object asyncState) { throw new PlatformNotSupportedException (); }
  98. public override System.IAsyncResult BeginRead(byte[] buffer, int offset, int count, System.AsyncCallback asyncCallback, object asyncState) { throw new PlatformNotSupportedException (); }
  99. public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int count, System.AsyncCallback asyncCallback, object asyncState) { throw new PlatformNotSupportedException (); }
  100. protected override void Dispose(bool disposing) { throw new PlatformNotSupportedException (); }
  101. public override System.Threading.Tasks.ValueTask DisposeAsync() { throw new PlatformNotSupportedException (); }
  102. public virtual void EndAuthenticateAsClient(System.IAsyncResult asyncResult) { throw new PlatformNotSupportedException (); }
  103. public virtual void EndAuthenticateAsServer(System.IAsyncResult asyncResult) { throw new PlatformNotSupportedException (); }
  104. public override int EndRead(System.IAsyncResult asyncResult) { throw new PlatformNotSupportedException (); }
  105. public override void EndWrite(System.IAsyncResult asyncResult) { throw new PlatformNotSupportedException (); }
  106. public override void Flush() { throw new PlatformNotSupportedException (); }
  107. public override System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken cancellationToken) { throw new PlatformNotSupportedException (); }
  108. public override int Read(byte[] buffer, int offset, int count) { throw new PlatformNotSupportedException (); }
  109. public override long Seek(long offset, System.IO.SeekOrigin origin) { throw new PlatformNotSupportedException (); }
  110. public override void SetLength(long value) { throw new PlatformNotSupportedException (); }
  111. public virtual System.Threading.Tasks.Task ShutdownAsync() { throw new PlatformNotSupportedException (); }
  112. public void Write(byte[] buffer) { throw new PlatformNotSupportedException (); }
  113. public override void Write(byte[] buffer, int offset, int count) { throw new PlatformNotSupportedException (); }
  114. }
  115. }