NegotiateStream.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. //
  2. // System.Net.Security.NegotiateStream.cs
  3. //
  4. // Authors:
  5. // Tim Coleman ([email protected])
  6. //
  7. // Copyright (C) Tim Coleman, 2004
  8. // (c) 2004 Novell, Inc. (http://www.novell.com)
  9. //
  10. //
  11. // Permission is hereby granted, free of charge, to any person obtaining
  12. // a copy of this software and associated documentation files (the
  13. // "Software"), to deal in the Software without restriction, including
  14. // without limitation the rights to use, copy, modify, merge, publish,
  15. // distribute, sublicense, and/or sell copies of the Software, and to
  16. // permit persons to whom the Software is furnished to do so, subject to
  17. // the following conditions:
  18. //
  19. // The above copyright notice and this permission notice shall be
  20. // included in all copies or substantial portions of the Software.
  21. //
  22. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  25. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  26. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  27. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  28. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  29. //
  30. #if NET_2_0
  31. using System;
  32. using System.IO;
  33. using System.Net;
  34. using System.Security.Principal;
  35. namespace System.Net.Security
  36. {
  37. public class NegotiateStream : AuthenticatedStream
  38. {
  39. #region Fields
  40. int readTimeout;
  41. int writeTimeout;
  42. #endregion // Fields
  43. #region Constructors
  44. [MonoTODO]
  45. public NegotiateStream (Stream innerStream)
  46. : base (innerStream, false)
  47. {
  48. }
  49. [MonoTODO]
  50. public NegotiateStream (Stream innerStream, bool leaveStreamOpen)
  51. : base (innerStream, leaveStreamOpen)
  52. {
  53. }
  54. #endregion // Constructors
  55. #region Properties
  56. public override bool CanRead {
  57. get { return InnerStream.CanRead; }
  58. }
  59. public override bool CanSeek {
  60. get { return InnerStream.CanSeek; }
  61. }
  62. [MonoTODO]
  63. public override bool CanTimeout {
  64. get { throw new NotImplementedException (); }
  65. }
  66. public override bool CanWrite {
  67. get { return InnerStream.CanWrite; }
  68. }
  69. [MonoTODO]
  70. public virtual TokenImpersonationLevel ImpersonationLevel {
  71. get { throw new NotImplementedException (); }
  72. }
  73. [MonoTODO]
  74. public override bool IsAuthenticated {
  75. get { throw new NotImplementedException (); }
  76. }
  77. [MonoTODO]
  78. public override bool IsEncrypted {
  79. get { throw new NotImplementedException (); }
  80. }
  81. [MonoTODO]
  82. public override bool IsMutuallyAuthenticated {
  83. get { throw new NotImplementedException (); }
  84. }
  85. [MonoTODO]
  86. public override bool IsServer {
  87. get { throw new NotImplementedException (); }
  88. }
  89. [MonoTODO]
  90. public override bool IsSigned {
  91. get { throw new NotImplementedException (); }
  92. }
  93. public override long Length {
  94. get { return InnerStream.Length; }
  95. }
  96. public override long Position {
  97. get { return InnerStream.Position; }
  98. set { InnerStream.Position = value; }
  99. }
  100. public override int ReadTimeout {
  101. get { return readTimeout; }
  102. set { readTimeout = value; }
  103. }
  104. [MonoTODO]
  105. public virtual IIdentity RemoteIdentity {
  106. get { throw new NotImplementedException (); }
  107. }
  108. public override int WriteTimeout {
  109. get { return writeTimeout; }
  110. set { writeTimeout = value; }
  111. }
  112. #endregion // Properties
  113. #region Methods
  114. [MonoTODO]
  115. public virtual IAsyncResult BeginClientAuthenticate (AsyncCallback callback, object asyncState)
  116. {
  117. throw new NotImplementedException ();
  118. }
  119. [MonoTODO]
  120. public virtual IAsyncResult BeginClientAuthenticate (NetworkCredential credential, string targetName, AsyncCallback asyncCallback, object asyncState)
  121. {
  122. throw new NotImplementedException ();
  123. }
  124. [MonoTODO]
  125. public virtual IAsyncResult BeginClientAuthenticate (NetworkCredential credential, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback asyncCallback, object asyncState)
  126. {
  127. throw new NotImplementedException ();
  128. }
  129. [MonoTODO]
  130. public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
  131. {
  132. throw new NotImplementedException ();
  133. }
  134. [MonoTODO]
  135. public virtual IAsyncResult BeginServerAuthenticate (AsyncCallback callback, object asyncState)
  136. {
  137. throw new NotImplementedException ();
  138. }
  139. [MonoTODO]
  140. public virtual IAsyncResult BeginServerAuthenticate (NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel, AsyncCallback asyncCallback, object asyncState)
  141. {
  142. throw new NotImplementedException ();
  143. }
  144. [MonoTODO]
  145. public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
  146. {
  147. throw new NotImplementedException ();
  148. }
  149. [MonoTODO]
  150. public virtual void ClientAuthenticate ()
  151. {
  152. throw new NotImplementedException ();
  153. }
  154. [MonoTODO]
  155. public virtual void ClientAuthenticate (NetworkCredential credential, string targetName)
  156. {
  157. throw new NotImplementedException ();
  158. }
  159. [MonoTODO]
  160. public virtual void ClientAuthenticate (NetworkCredential credential, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel)
  161. {
  162. throw new NotImplementedException ();
  163. }
  164. [MonoTODO]
  165. public override void Close ()
  166. {
  167. InnerStream.Close ();
  168. }
  169. [MonoTODO]
  170. public virtual void EndClientAuthenticate (IAsyncResult asyncResult)
  171. {
  172. throw new NotImplementedException ();
  173. }
  174. [MonoTODO]
  175. public override int EndRead (IAsyncResult asyncResult)
  176. {
  177. throw new NotImplementedException ();
  178. }
  179. [MonoTODO]
  180. public virtual void EndServerAuthenticate (IAsyncResult asyncResult)
  181. {
  182. throw new NotImplementedException ();
  183. }
  184. [MonoTODO]
  185. public override void EndWrite (IAsyncResult asyncResult)
  186. {
  187. throw new NotImplementedException ();
  188. }
  189. [MonoTODO]
  190. public override void Flush ()
  191. {
  192. InnerStream.Flush ();
  193. }
  194. [MonoTODO]
  195. public override int Read (byte[] buffer, int offset, int count)
  196. {
  197. throw new NotImplementedException ();
  198. }
  199. [MonoTODO]
  200. public override long Seek (long offset, SeekOrigin origin)
  201. {
  202. throw new NotImplementedException ();
  203. }
  204. [MonoTODO]
  205. public virtual void ServerAuthenticate ()
  206. {
  207. throw new NotImplementedException ();
  208. }
  209. [MonoTODO]
  210. public virtual void ServerAuthenticate (NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel)
  211. {
  212. throw new NotImplementedException ();
  213. }
  214. [MonoTODO]
  215. public override void SetLength (long value)
  216. {
  217. throw new NotImplementedException ();
  218. }
  219. [MonoTODO]
  220. public override void Write (byte[] buffer, int offset, int count)
  221. {
  222. throw new NotImplementedException ();
  223. }
  224. #endregion // Methods
  225. }
  226. }
  227. #endif