| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383 |
- //
- // System.Net.Security.NegotiateStream.cs
- //
- // Authors:
- // Tim Coleman ([email protected])
- //
- // Copyright (C) Tim Coleman, 2004
- // (c) 2004 Novell, Inc. (http://www.novell.com)
- //
- //
- // Permission is hereby granted, free of charge, to any person obtaining
- // a copy of this software and associated documentation files (the
- // "Software"), to deal in the Software without restriction, including
- // without limitation the rights to use, copy, modify, merge, publish,
- // distribute, sublicense, and/or sell copies of the Software, and to
- // permit persons to whom the Software is furnished to do so, subject to
- // the following conditions:
- //
- // The above copyright notice and this permission notice shall be
- // included in all copies or substantial portions of the Software.
- //
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- //
- using System;
- using System.IO;
- using System.Net;
- using System.Security.Principal;
- using System.Security.Permissions;
- using System.Security.Authentication.ExtendedProtection;
- using System.Threading;
- using System.Threading.Tasks;
- namespace System.Net.Security
- {
- public class NegotiateStream : AuthenticatedStream
- {
- #region Fields
- int readTimeout;
- int writeTimeout;
- #endregion // Fields
- #region Constructors
- [MonoTODO]
- public NegotiateStream (Stream innerStream)
- : base (innerStream, false)
- {
- }
- [MonoTODO]
- public NegotiateStream (Stream innerStream, bool leaveInnerStreamOpen)
- : base (innerStream, leaveInnerStreamOpen)
- {
- }
- #endregion // Constructors
- #region Properties
- public override bool CanRead {
- get { return InnerStream.CanRead; }
- }
- public override bool CanSeek {
- get { return InnerStream.CanSeek; }
- }
- [MonoTODO]
- public override bool CanTimeout {
- get { throw new NotImplementedException (); }
- }
- public override bool CanWrite {
- get { return InnerStream.CanWrite; }
- }
- [MonoTODO]
- public virtual TokenImpersonationLevel ImpersonationLevel {
- get { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public override bool IsAuthenticated {
- get { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public override bool IsEncrypted {
- get { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public override bool IsMutuallyAuthenticated {
- get { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public override bool IsServer {
- get { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public override bool IsSigned {
- get { throw new NotImplementedException (); }
- }
- public override long Length {
- get { return InnerStream.Length; }
- }
- public override long Position {
- get { return InnerStream.Position; }
- set { InnerStream.Position = value; }
- }
- public override int ReadTimeout {
- get { return readTimeout; }
- set { readTimeout = value; }
- }
- [MonoTODO]
- public virtual IIdentity RemoteIdentity {
- get { throw new NotImplementedException (); }
- }
- public override int WriteTimeout {
- get { return writeTimeout; }
- set { writeTimeout = value; }
- }
- #endregion // Properties
- #region Methods
- [MonoTODO]
- public virtual IAsyncResult BeginAuthenticateAsClient (AsyncCallback asyncCallback, object asyncState)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual IAsyncResult BeginAuthenticateAsClient (NetworkCredential credential, ChannelBinding binding, string targetName, AsyncCallback asyncCallback, object asyncState)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual IAsyncResult BeginAuthenticateAsClient (NetworkCredential credential, string targetName, AsyncCallback asyncCallback, object asyncState)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual IAsyncResult BeginAuthenticateAsClient (NetworkCredential credential, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback asyncCallback, object asyncState)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual IAsyncResult BeginAuthenticateAsClient (NetworkCredential credential, ChannelBinding binding, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback asyncCallback, object asyncState)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual IAsyncResult BeginAuthenticateAsServer (AsyncCallback asyncCallback, object asyncState)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual IAsyncResult BeginAuthenticateAsServer (NetworkCredential credential, ExtendedProtectionPolicy policy, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel, AsyncCallback asyncCallback, object asyncState)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual IAsyncResult BeginAuthenticateAsServer (NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel, AsyncCallback asyncCallback, object asyncState)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual IAsyncResult BeginAuthenticateAsServer (ExtendedProtectionPolicy policy, AsyncCallback asyncCallback, object asyncState)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual void AuthenticateAsClient ()
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual void AuthenticateAsClient (NetworkCredential credential, string targetName)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual void AuthenticateAsClient (NetworkCredential credential, ChannelBinding binding, string targetName)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual void AuthenticateAsClient (NetworkCredential credential, ChannelBinding binding, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual void AuthenticateAsClient (NetworkCredential credential, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual void AuthenticateAsServer ()
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual void AuthenticateAsServer (ExtendedProtectionPolicy policy)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual void AuthenticateAsServer (NetworkCredential credential, ExtendedProtectionPolicy policy, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual void AuthenticateAsServer (NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected override void Dispose (bool disposing)
- {
- if (disposing){
- // TODO
- }
- }
- [MonoTODO]
- public virtual void EndAuthenticateAsClient (IAsyncResult asyncResult)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public override int EndRead (IAsyncResult asyncResult)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual void EndAuthenticateAsServer (IAsyncResult asyncResult)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public override void EndWrite (IAsyncResult asyncResult)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public override void Flush ()
- {
- InnerStream.Flush ();
- }
- [MonoTODO]
- public override int Read (byte[] buffer, int offset, int count)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public override long Seek (long offset, SeekOrigin origin)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public override void SetLength (long value)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public override void Write (byte[] buffer, int offset, int count)
- {
- throw new NotImplementedException ();
- }
- public virtual Task AuthenticateAsClientAsync()
- {
- return Task.Factory.FromAsync(BeginAuthenticateAsClient, EndAuthenticateAsClient, null);
- }
- public virtual Task AuthenticateAsClientAsync(NetworkCredential credential, string targetName)
- {
- return Task.Factory.FromAsync(BeginAuthenticateAsClient, EndAuthenticateAsClient, credential, targetName, null);
- }
- public virtual Task AuthenticateAsClientAsync(
- NetworkCredential credential, string targetName,
- ProtectionLevel requiredProtectionLevel,
- TokenImpersonationLevel allowedImpersonationLevel)
- {
- return Task.Factory.FromAsync((callback, state) => BeginAuthenticateAsClient(credential, targetName, requiredProtectionLevel, allowedImpersonationLevel, callback, state), EndAuthenticateAsClient, null);
- }
- public virtual Task AuthenticateAsClientAsync(NetworkCredential credential, ChannelBinding binding, string targetName)
- {
- throw new NotImplementedException ();
- }
- public virtual Task AuthenticateAsClientAsync(
- NetworkCredential credential, ChannelBinding binding,
- string targetName, ProtectionLevel requiredProtectionLevel,
- TokenImpersonationLevel allowedImpersonationLevel)
- {
- throw new NotImplementedException ();
- }
- public virtual Task AuthenticateAsServerAsync()
- {
- return Task.Factory.FromAsync(BeginAuthenticateAsServer, EndAuthenticateAsServer, null);
- }
- public virtual Task AuthenticateAsServerAsync(ExtendedProtectionPolicy policy)
- {
- throw new NotImplementedException ();
- }
- public virtual Task AuthenticateAsServerAsync(NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel)
- {
- throw new NotImplementedException ();
- }
- public virtual Task AuthenticateAsServerAsync(
- NetworkCredential credential, ExtendedProtectionPolicy policy,
- ProtectionLevel requiredProtectionLevel,
- TokenImpersonationLevel requiredImpersonationLevel)
- {
- throw new NotImplementedException ();
- }
- #endregion // Methods
- }
- }
|