Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Net.​Security.​NegotiateStream
Assembly: System.Net.Security
Inheritance: object → MarshalByRefObject → IO.​Stream → AuthenticatedStream → NegotiateStream
Implemented Interfaces
- IAsyncDisposable Implemented by: Stream
- IDisposable Implemented by: Stream
Provides a stream that uses the Negotiate security protocol to authenticate the client, and optionally the server, in client-server communication.
Properties
public
bool
CanRead
Gets a <see cref="T:System.Boolean" /> value that indicates whether the underlying stream is readable.
public
bool
CanSeek
Gets a <see cref="T:System.Boolean" /> value that indicates whether the underlying stream is seekable.
public
bool
CanTimeout
Gets a <see cref="T:System.Boolean" /> value that indicates whether the underlying stream supports time-outs.
public
bool
CanWrite
Gets a <see cref="T:System.Boolean" /> value that indicates whether the underlying stream is writable.
ImpersonationLevel
Gets a value that indicates how the server can use the client's credentials.
public
bool
IsAuthenticated
Gets a <see cref="T:System.Boolean" /> value that indicates whether authentication was successful.
public
bool
IsEncrypted
Gets a <see cref="T:System.Boolean" /> value that indicates whether this <see cref="T:System.Net.Security.NegotiateStream" /> uses data encryption.
public
bool
IsMutuallyAuthenticated
Gets a <see cref="T:System.Boolean" /> value that indicates whether both the server and the client have been authenticated.
public
bool
IsServer
Gets a <see cref="T:System.Boolean" /> value that indicates whether the local side of the connection used by this <see cref="T:System.Net.Security.NegotiateStream" /> was authenticated as the server.
public
bool
IsSigned
Gets a <see cref="T:System.Boolean" /> value that indicates whether the data sent using this stream is signed.
public
long
Length
Gets the length of the underlying stream.
public
long
Position
Gets or sets the current position in the underlying stream.
public
int
ReadTimeout
Gets or sets the amount of time a read operation blocks waiting for data.
RemoteIdentity
Gets information about the identity of the remote party sharing this authenticated stream.
public
int
WriteTimeout
Gets or sets the amount of time a write operation blocks waiting for data.
protected
IO.​Stream
InnerStream
Gets the stream used by this <see cref="T:System.Net.Security.AuthenticatedStream" /> for sending and receiving data.
public
bool
LeaveInnerStreamOpen
Gets whether the stream used by this <see cref="T:System.Net.Security.AuthenticatedStream" /> for sending and receiving data has been left open.
Methods
public
void
AuthenticateAsClient​()
Called by clients to authenticate the client, and optionally the server, in a client-server connection.
public
void
AuthenticateAsClient​(NetworkCredential credential,
Security.​Authentication.​ExtendedProtection.​ChannelBinding? binding,
string targetName)
Called by clients to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified client credential and the channel binding.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
binding
The <see cref="T:System.Security.Authentication.ExtendedProtection.ChannelBinding" /> that is used for extended protection.
targetName
The Service Principal Name (SPN) that uniquely identifies the server to authenticate.
public
void
AuthenticateAsClient​(NetworkCredential credential,
Security.​Authentication.​ExtendedProtection.​ChannelBinding? binding,
string targetName,
ProtectionLevel requiredProtectionLevel,
Security.​Principal.​TokenImpersonationLevel allowedImpersonationLevel)
Called by clients to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified credential, authentication options, and channel binding.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
binding
The <see cref="T:System.Security.Authentication.ExtendedProtection.ChannelBinding" /> that is used for extended protection.
targetName
The Service Principal Name (SPN) that uniquely identifies the server to authenticate.
requiredProtectionLevel
One of the <see cref="T:System.Net.Security.ProtectionLevel" /> values, indicating the security services for the stream.
allowedImpersonationLevel
One of the <see cref="T:System.Security.Principal.TokenImpersonationLevel" /> values, indicating how the server can use the client's credentials to access resources.
public
void
AuthenticateAsClient​(NetworkCredential credential,
string targetName)
Called by clients to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified client credential.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
targetName
The Service Principal Name (SPN) that uniquely identifies the server to authenticate.
public
void
AuthenticateAsClient​(NetworkCredential credential,
string targetName,
ProtectionLevel requiredProtectionLevel,
Security.​Principal.​TokenImpersonationLevel allowedImpersonationLevel)
Called by clients to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified credentials and authentication options.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
targetName
The Service Principal Name (SPN) that uniquely identifies the server to authenticate.
requiredProtectionLevel
One of the <see cref="T:System.Net.Security.ProtectionLevel" /> values, indicating the security services for the stream.
allowedImpersonationLevel
One of the <see cref="T:System.Security.Principal.TokenImpersonationLevel" /> values, indicating how the server can use the client's credentials to access resources.
AuthenticateAsClientAsync​()
Called by clients to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation.
Returns The task object representing the asynchronous operation.
AuthenticateAsClientAsync​(NetworkCredential credential,
Security.​Authentication.​ExtendedProtection.​ChannelBinding? binding,
string targetName)
Called by clients to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. The authentication process uses the specified client credential and the channel binding.
Returns The task object representing the asynchronous operation.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
binding
The <see cref="T:System.Security.Authentication.ExtendedProtection.ChannelBinding" /> that is used for extended protection.
targetName
The Service Principal Name (SPN) that uniquely identifies the server to authenticate.
AuthenticateAsClientAsync​(NetworkCredential credential,
Security.​Authentication.​ExtendedProtection.​ChannelBinding? binding,
string targetName,
ProtectionLevel requiredProtectionLevel,
Security.​Principal.​TokenImpersonationLevel allowedImpersonationLevel)
Called by clients to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. The authentication process uses the specified credential, authentication options, and channel binding.
Returns The task object representing the asynchronous operation.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
binding
The <see cref="T:System.Security.Authentication.ExtendedProtection.ChannelBinding" /> that is used for extended protection.
targetName
The Service Principal Name (SPN) that uniquely identifies the server to authenticate.
requiredProtectionLevel
One of the <see cref="T:System.Net.Security.ProtectionLevel" /> values, indicating the security services for the stream.
allowedImpersonationLevel
One of the <see cref="T:System.Security.Principal.TokenImpersonationLevel" /> values, indicating how the server can use the client's credentials to access resources.
AuthenticateAsClientAsync​(NetworkCredential credential,
string targetName)
Called by clients to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. The authentication process uses the specified client credential.
Returns The task object representing the asynchronous operation.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
targetName
The Service Principal Name (SPN) that uniquely identifies the server to authenticate.
AuthenticateAsClientAsync​(NetworkCredential credential,
string targetName,
ProtectionLevel requiredProtectionLevel,
Security.​Principal.​TokenImpersonationLevel allowedImpersonationLevel)
Called by clients to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. The authentication process uses the specified credentials and authentication options.
Returns The task object representing the asynchronous operation.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
targetName
The Service Principal Name (SPN) that uniquely identifies the server to authenticate.
requiredProtectionLevel
One of the <see cref="T:System.Net.Security.ProtectionLevel" /> values, indicating the security services for the stream.
allowedImpersonationLevel
One of the <see cref="T:System.Security.Principal.TokenImpersonationLevel" /> values, indicating how the server can use the client's credentials to access resources.
public
void
AuthenticateAsServer​()
Called by servers to authenticate the client, and optionally the server, in a client-server connection.
public
void
AuthenticateAsServer​(NetworkCredential credential,
ProtectionLevel requiredProtectionLevel,
Security.​Principal.​TokenImpersonationLevel requiredImpersonationLevel)
Called by servers to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified server credentials and authentication options.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the server.
requiredProtectionLevel
One of the <see cref="T:System.Net.Security.ProtectionLevel" /> values, indicating the security services for the stream.
requiredImpersonationLevel
One of the <see cref="T:System.Security.Principal.TokenImpersonationLevel" /> values, indicating how the server can use the client's credentials to access resources.
public
void
AuthenticateAsServer​(NetworkCredential credential,
Security.​Authentication.​ExtendedProtection.​ExtendedProtectionPolicy? policy,
ProtectionLevel requiredProtectionLevel,
Security.​Principal.​TokenImpersonationLevel requiredImpersonationLevel)
Called by servers to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified server credentials, authentication options, and extended protection policy.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
policy
The <see cref="T:System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy" /> that is used for extended protection.
requiredProtectionLevel
One of the <see cref="T:System.Net.Security.ProtectionLevel" /> values, indicating the security services for the stream.
requiredImpersonationLevel
One of the <see cref="T:System.Security.Principal.TokenImpersonationLevel" /> values, indicating how the server can use the client's credentials to access resources.
public
void
AuthenticateAsServer​(Security.​Authentication.​ExtendedProtection.​ExtendedProtectionPolicy policy)
Called by servers to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified extended protection policy.
policy
The <see cref="T:System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy" /> that is used for extended protection.
AuthenticateAsServerAsync​()
Called by servers to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation.
Returns The task object representing the asynchronous operation.
AuthenticateAsServerAsync​(NetworkCredential credential,
ProtectionLevel requiredProtectionLevel,
Security.​Principal.​TokenImpersonationLevel requiredImpersonationLevel)
Called by servers to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. The authentication process uses the specified server credentials and authentication options.
Returns The task object representing the asynchronous operation.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the server.
requiredProtectionLevel
One of the <see cref="T:System.Net.Security.ProtectionLevel" /> values, indicating the security services for the stream.
requiredImpersonationLevel
One of the <see cref="T:System.Security.Principal.TokenImpersonationLevel" /> values, indicating how the server can use the client's credentials to access resources.
AuthenticateAsServerAsync​(NetworkCredential credential,
Security.​Authentication.​ExtendedProtection.​ExtendedProtectionPolicy? policy,
ProtectionLevel requiredProtectionLevel,
Security.​Principal.​TokenImpersonationLevel requiredImpersonationLevel)
Called by servers to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. The authentication process uses the specified server credentials, authentication options, and extended protection policy.
Returns The task object representing the asynchronous operation.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
policy
The <see cref="T:System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy" /> that is used for extended protection.
requiredProtectionLevel
One of the <see cref="T:System.Net.Security.ProtectionLevel" /> values, indicating the security services for the stream.
requiredImpersonationLevel
One of the <see cref="T:System.Security.Principal.TokenImpersonationLevel" /> values, indicating how the server can use the client's credentials to access resources.
AuthenticateAsServerAsync​(Security.​Authentication.​ExtendedProtection.​ExtendedProtectionPolicy? policy)
Called by servers to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. The authentication process uses the specified extended protection policy.
Returns The task object representing the asynchronous operation.
policy
The <see cref="T:System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy" /> that is used for extended protection.
public
IAsyncResult
BeginAuthenticateAsClient​(AsyncCallback asyncCallback,
object asyncState)
Called by clients to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. This method does not block.
Returns An <see cref="T:System.IAsyncResult" /> object indicating the status of the asynchronous operation.
asyncCallback
An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the authentication is complete.
asyncState
A user-defined object containing information about the operation. This object is passed to the <paramref name="asyncCallback" /> delegate when the operation completes.
public
IAsyncResult
BeginAuthenticateAsClient​(NetworkCredential credential,
Security.​Authentication.​ExtendedProtection.​ChannelBinding? binding,
string targetName,
AsyncCallback? asyncCallback,
object asyncState)
Called by clients to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified credentials and channel binding. This method does not block.
Returns An <see cref="T:System.IAsyncResult" /> object indicating the status of the asynchronous operation.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
binding
The <see cref="T:System.Security.Authentication.ExtendedProtection.ChannelBinding" /> that is used for extended protection.
targetName
The Service Principal Name (SPN) that uniquely identifies the server to authenticate.
asyncCallback
An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the authentication is complete.
asyncState
A user-defined object containing information about the write operation. This object is passed to the <paramref name="asyncCallback" /> delegate when the operation completes.
public
IAsyncResult
BeginAuthenticateAsClient​(NetworkCredential credential,
Security.​Authentication.​ExtendedProtection.​ChannelBinding? binding,
string targetName,
ProtectionLevel requiredProtectionLevel,
Security.​Principal.​TokenImpersonationLevel allowedImpersonationLevel,
AsyncCallback? asyncCallback,
object asyncState)
Called by clients to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified credentials, authentication options, and channel binding. This method does not block.
Returns An <see cref="T:System.IAsyncResult" /> object indicating the status of the asynchronous operation.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
binding
The <see cref="T:System.Security.Authentication.ExtendedProtection.ChannelBinding" /> that is used for extended protection.
targetName
The Service Principal Name (SPN) that uniquely identifies the server to authenticate.
requiredProtectionLevel
One of the <see cref="T:System.Net.Security.ProtectionLevel" /> values, indicating the security services for the stream.
allowedImpersonationLevel
One of the <see cref="T:System.Security.Principal.TokenImpersonationLevel" /> values, indicating how the server can use the client's credentials to access resources.
asyncCallback
An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the authentication is complete.
asyncState
A user-defined object containing information about the write operation. This object is passed to the <paramref name="asyncCallback" /> delegate when the operation completes.
public
IAsyncResult
BeginAuthenticateAsClient​(NetworkCredential credential,
string targetName,
AsyncCallback? asyncCallback,
object asyncState)
Called by clients to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified credentials. This method does not block.
Returns An <see cref="T:System.IAsyncResult" /> object indicating the status of the asynchronous operation.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
targetName
The Service Principal Name (SPN) that uniquely identifies the server to authenticate.
asyncCallback
An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the authentication is complete.
asyncState
A user-defined object containing information about the write operation. This object is passed to the <paramref name="asyncCallback" /> delegate when the operation completes.
public
IAsyncResult
BeginAuthenticateAsClient​(NetworkCredential credential,
string targetName,
ProtectionLevel requiredProtectionLevel,
Security.​Principal.​TokenImpersonationLevel allowedImpersonationLevel,
AsyncCallback? asyncCallback,
object asyncState)
Called by clients to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified credentials and authentication options. This method does not block.
Returns An <see cref="T:System.IAsyncResult" /> object indicating the status of the asynchronous operation.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
targetName
The Service Principal Name (SPN) that uniquely identifies the server to authenticate.
requiredProtectionLevel
One of the <see cref="T:System.Net.Security.ProtectionLevel" /> values, indicating the security services for the stream.
allowedImpersonationLevel
One of the <see cref="T:System.Security.Principal.TokenImpersonationLevel" /> values, indicating how the server can use the client's credentials to access resources.
asyncCallback
An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the authentication is complete.
asyncState
A user-defined object containing information about the write operation. This object is passed to the <paramref name="asyncCallback" /> delegate when the operation completes.
public
IAsyncResult
BeginAuthenticateAsServer​(AsyncCallback asyncCallback,
object asyncState)
Called by servers to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. This method does not block.
Returns An <see cref="T:System.IAsyncResult" /> object indicating the status of the asynchronous operation.
asyncCallback
An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the authentication is complete.
asyncState
A user-defined object containing information about the operation. This object is passed to the <paramref name="asyncCallback" /> delegate when the operation completes.
public
IAsyncResult
BeginAuthenticateAsServer​(NetworkCredential credential,
ProtectionLevel requiredProtectionLevel,
Security.​Principal.​TokenImpersonationLevel requiredImpersonationLevel,
AsyncCallback? asyncCallback,
object asyncState)
Called by servers to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified server credentials and authentication options. This method does not block.
Returns An <see cref="T:System.IAsyncResult" /> object indicating the status of the asynchronous operation.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
requiredProtectionLevel
One of the <see cref="T:System.Net.Security.ProtectionLevel" /> values, indicating the security services for the stream.
requiredImpersonationLevel
One of the <see cref="T:System.Security.Principal.TokenImpersonationLevel" /> values, indicating how the server can use the client's credentials to access resources.
asyncCallback
An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the authentication is complete.
asyncState
A user-defined object containing information about the operation. This object is passed to the <paramref name="asyncCallback" /> delegate when the operation completes.
public
IAsyncResult
BeginAuthenticateAsServer​(NetworkCredential credential,
Security.​Authentication.​ExtendedProtection.​ExtendedProtectionPolicy policy,
ProtectionLevel requiredProtectionLevel,
Security.​Principal.​TokenImpersonationLevel requiredImpersonationLevel,
AsyncCallback asyncCallback,
object asyncState)
Called by servers to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified server credentials, authentication options, and extended protection policy. This method does not block.
Returns An <see cref="T:System.IAsyncResult" /> object indicating the status of the asynchronous operation.
credential
The <see cref="T:System.Net.NetworkCredential" /> that is used to establish the identity of the client.
policy
The <see cref="T:System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy" /> that is used for extended protection.
requiredProtectionLevel
One of the <see cref="T:System.Net.Security.ProtectionLevel" /> values, indicating the security services for the stream.
requiredImpersonationLevel
One of the <see cref="T:System.Security.Principal.TokenImpersonationLevel" /> values, indicating how the server can use the client's credentials to access resources.
asyncCallback
An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the authentication is complete.
asyncState
A user-defined object containing information about the write operation. This object is passed to the <paramref name="asyncCallback" /> delegate when the operation completes.
public
IAsyncResult
BeginAuthenticateAsServer​(Security.​Authentication.​ExtendedProtection.​ExtendedProtectionPolicy policy,
AsyncCallback asyncCallback,
object asyncState)
Called by servers to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified extended protection policy. This method does not block.
Returns An <see cref="T:System.IAsyncResult" /> object indicating the status of the asynchronous operation.
policy
The <see cref="T:System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy" /> that is used for extended protection.
asyncCallback
An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the authentication is complete.
asyncState
A user-defined object containing information about the write operation. This object is passed to the <paramref name="asyncCallback" /> delegate when the operation completes.
public
IAsyncResult
BeginRead​(byte[] buffer,
int offset,
int count,
AsyncCallback? asyncCallback,
object asyncState)
Begins an asynchronous read operation that reads data from the stream and stores it in the specified array.
Returns An <see cref="T:System.IAsyncResult" /> object indicating the status of the asynchronous operation.
buffer
A <see cref="T:System.Byte" /> array that receives the bytes read from the stream.
offset
The zero-based location in <paramref name="buffer" /> at which to begin storing the data read from this stream.
count
The maximum number of bytes to read from the stream.
asyncCallback
An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the read operation is complete.
asyncState
A user-defined object containing information about the read operation. This object is passed to the <paramref name="asyncCallback" /> delegate when the operation completes.
public
IAsyncResult
BeginWrite​(byte[] buffer,
int offset,
int count,
AsyncCallback? asyncCallback,
object asyncState)
Begins an asynchronous write operation that writes <see cref="T:System.Byte" /> s from the specified buffer to the stream.
Returns An <see cref="T:System.IAsyncResult" /> object indicating the status of the asynchronous operation.
buffer
A <see cref="T:System.Byte" /> array that supplies the bytes to be written to the stream.
offset
The zero-based location in <paramref name="buffer" /> at which to begin reading bytes to be written to the stream.
count
An <see cref="T:System.Int32" /> value that specifies the number of bytes to read from <paramref name="buffer" /> .
asyncCallback
An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the write operation is complete.
asyncState
A user-defined object containing information about the write operation. This object is passed to the <paramref name="asyncCallback" /> delegate when the operation completes.
protected
void
Dispose​(bool disposing)
Releases the unmanaged resources used by the <see cref="T:System.Net.Security.NegotiateStream" /> and optionally releases the managed resources.
disposing
<see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.
DisposeAsync​()
Asynchronously releases the unmanaged and managed resources used by the <see cref="T:System.Net.Security.NegotiateStream" /> .
Returns A task that represents the asynchronous dispose operation.
public
void
EndAuthenticateAsClient​(IAsyncResult asyncResult)
Ends a pending asynchronous client authentication operation that was started with a call to <see cref="Overload:System.Net.Security.NegotiateStream.BeginAuthenticateAsClient" /> .
asyncResult
An <see cref="T:System.IAsyncResult" /> instance returned by a call to <see cref="Overload:System.Net.Security.NegotiateStream.BeginAuthenticateAsClient" /> .
public
void
EndAuthenticateAsServer​(IAsyncResult asyncResult)
Ends a pending asynchronous client authentication operation that was started with a call to <see cref="Overload:System.Net.Security.NegotiateStream.BeginAuthenticateAsServer" /> .
asyncResult
An <see cref="T:System.IAsyncResult" /> instance returned by a call to <see cref="Overload:System.Net.Security.NegotiateStream.BeginAuthenticateAsServer" /> .
public
int
EndRead​(IAsyncResult asyncResult)
Ends an asynchronous read operation that was started with a call to <see cref="M:System.Net.Security.NegotiateStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> .
Returns A <see cref="T:System.Int32" /> value that specifies the number of bytes read from the underlying stream.
asyncResult
An <see cref="T:System.IAsyncResult" /> instance returned by a call to <see cref="M:System.Net.Security.NegotiateStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> .
public
void
EndWrite​(IAsyncResult asyncResult)
Ends an asynchronous write operation that was started with a call to <see cref="M:System.Net.Security.NegotiateStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> .
asyncResult
An <see cref="T:System.IAsyncResult" /> instance returned by a call to <see cref="M:System.Net.Security.NegotiateStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> .
public
void
Flush​()
Causes any buffered data to be written to the underlying device.
FlushAsync​(Threading.​CancellationToken cancellationToken)
Asynchronously writes any buffered data to the underlying device.
Returns A task that represents the asynchronous flush operation.
cancellationToken
The token to monitor for cancellation requests.
public
int
Read​(byte[] buffer,
int offset,
int count)
Reads data from this stream and stores it in the specified array.
Returns An <see cref="T:System.Int32" /> value that specifies the number of bytes read from the underlying stream. When there is no more data to be read, returns 0.
buffer
A <see cref="T:System.Byte" /> array that receives the bytes read from the stream.
offset
A <see cref="T:System.Int32" /> containing the zero-based location in <paramref name="buffer" /> at which to begin storing the data read from this stream.
count
A <see cref="T:System.Int32" /> containing the maximum number of bytes to read from the stream.
public
Threading.​Tasks.​Task<​int>
ReadAsync​(byte[] buffer,
int offset,
int count,
Threading.​CancellationToken cancellationToken)
Reads data asynchronously from this stream and stores it in the specified array.
Returns An <see cref="T:System.Int32" /> value that specifies the number of bytes read from the underlying stream. When there is no more data to be read, returns 0.
buffer
A <see cref="T:System.Byte" /> array that receives the bytes read from the stream.
offset
A <see cref="T:System.Int32" /> containing the zero-based location in <paramref name="buffer" /> at which to begin storing the data read from this stream.
count
A <see cref="T:System.Int32" /> containing the maximum number of bytes to read from the stream.
cancellationToken
The token to monitor for cancellation requests.
public
Threading.​Tasks.​ValueTask<​int>
ReadAsync​(Memory<​byte> buffer,
Threading.​CancellationToken cancellationToken = null)
Reads data asynchronously from the <see cref="T:System.Net.Security.NegotiateStream" /> and stores it in a byte memory range as an asynchronous operation.
Returns A <see cref="T:System.Threading.Tasks.ValueTask`1" /> that represents the asynchronous read operation. The value of its <see cref="P:System.Threading.Tasks.ValueTask`1.Result" /> property contains the total number of bytes read into <paramref name="buffer" /> .
buffer
The buffer to write the data to.
cancellationToken
The token to monitor for cancellation requests.
public
long
Seek​(long offset,
IO.​SeekOrigin origin)
Throws <see cref="T:System.NotSupportedException" /> .
Returns Always throws a <see cref="T:System.NotSupportedException" /> .
offset
This value is ignored.
origin
This value is ignored.
public
void
SetLength​(long value)
Sets the length of the underlying stream.
value
An <see cref="T:System.Int64" /> value that specifies the length of the stream.
public
void
Write​(byte[] buffer,
int offset,
int count)
Write the specified number of <see cref="T:System.Byte" /> s to the underlying stream using the specified buffer and offset.
buffer
A <see cref="T:System.Byte" /> array that supplies the bytes written to the stream.
offset
An <see cref="T:System.Int32" /> containing the zero-based location in <paramref name="buffer" /> at which to begin reading bytes to be written to the stream.
count
A <see cref="T:System.Int32" /> containing the number of bytes to read from <paramref name="buffer" /> .
WriteAsync​(byte[] buffer,
int offset,
int count,
Threading.​CancellationToken cancellationToken)
Write asynchronously the specified number of <see cref="T:System.Byte" /> s to the underlying stream.
Returns A <see cref="T:System.Threading.Tasks.Task" /> that represents the asynchronous read operation.
buffer
A <see cref="T:System.Byte" /> array that supplies the bytes written to the stream.
offset
An <see cref="T:System.Int32" /> containing the zero-based location in <paramref name="buffer" /> at which to begin reading bytes to be written to the stream.
count
A <see cref="T:System.Int32" /> containing the number of bytes to read from <paramref name="buffer" /> .
WriteAsync​(ReadOnlyMemory<​byte> buffer,
Threading.​CancellationToken cancellationToken = null)
Write asynchronously the specified number of <see cref="T:System.Byte" /> s to the underlying stream.
Returns A <see cref="T:System.Threading.Tasks.ValueTask" /> that represents the asynchronous read operation.
buffer
A region of memory that contains the data to write to the <see cref="T:System.Net.Security.NegotiateStream" /> .
cancellationToken
The token to monitor for cancellation requests.
public
void
CopyTo​(IO.​Stream destination)
Inherited from IO.​Stream
public
void
CopyTo​(IO.​Stream destination,
int bufferSize)
Inherited from IO.​Stream
CopyToAsync​(IO.​Stream destination)
Inherited from IO.​Stream
CopyToAsync​(IO.​Stream destination,
int bufferSize)
Inherited from IO.​Stream
CopyToAsync​(IO.​Stream destination,
int bufferSize,
Threading.​CancellationToken cancellationToken)
Inherited from IO.​Stream
CopyToAsync​(IO.​Stream destination,
Threading.​CancellationToken cancellationToken)
Inherited from IO.​Stream
protected
Threading.​WaitHandle
CreateWaitHandle​()
Inherited from IO.​Stream
public
int
Read​(Span<​byte> buffer)
Inherited from IO.​Stream
public
Threading.​Tasks.​Task<​int>
ReadAsync​(byte[] buffer,
int offset,
int count)
Inherited from IO.​Stream
public
int
ReadAtLeast​(Span<​byte> buffer,
int minimumBytes,
bool throwOnEndOfStream = true)
Inherited from IO.​Stream
public
Threading.​Tasks.​ValueTask<​int>
ReadAtLeastAsync​(Memory<​byte> buffer,
int minimumBytes,
bool throwOnEndOfStream = true,
Threading.​CancellationToken cancellationToken = null)
Inherited from IO.​Stream
public
void
ReadExactly​(byte[] buffer,
int offset,
int count)
Inherited from IO.​Stream
public
void
ReadExactly​(Span<​byte> buffer)
Inherited from IO.​Stream
ReadExactlyAsync​(byte[] buffer,
int offset,
int count,
Threading.​CancellationToken cancellationToken = null)
Inherited from IO.​Stream
ReadExactlyAsync​(Memory<​byte> buffer,
Threading.​CancellationToken cancellationToken = null)
Inherited from IO.​Stream
public
void
Write​(ReadOnlySpan<​byte> buffer)
Inherited from IO.​Stream
WriteAsync​(byte[] buffer,
int offset,
int count)
Inherited from IO.​Stream
protected
MarshalByRefObject
MemberwiseClone​(bool cloneIdentity)
Inherited from MarshalByRefObject
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object