Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Net.Security.SslStream Class Reference

Public Member Functions

 SslStream (Stream innerStream)
 
 SslStream (Stream innerStream, bool leaveInnerStreamOpen)
 
 SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback? userCertificateValidationCallback)
 
 SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback? userCertificateValidationCallback, LocalCertificateSelectionCallback? userCertificateSelectionCallback)
 
 SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback? userCertificateValidationCallback, LocalCertificateSelectionCallback? userCertificateSelectionCallback, EncryptionPolicy encryptionPolicy)
 
virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback? asyncCallback, object? asyncState)
 
virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection? clientCertificates, bool checkCertificateRevocation, AsyncCallback? asyncCallback, object? asyncState)
 
virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection? clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback? asyncCallback, object? asyncState)
 
virtual void EndAuthenticateAsClient (IAsyncResult asyncResult)
 
virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback? asyncCallback, object? asyncState)
 
virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation, AsyncCallback? asyncCallback, object? asyncState)
 
virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback? asyncCallback, object? asyncState)
 
virtual void EndAuthenticateAsServer (IAsyncResult asyncResult)
 
virtual void AuthenticateAsClient (string targetHost)
 
virtual void AuthenticateAsClient (string targetHost, X509CertificateCollection? clientCertificates, bool checkCertificateRevocation)
 
virtual void AuthenticateAsClient (string targetHost, X509CertificateCollection? clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 
void AuthenticateAsClient (SslClientAuthenticationOptions sslClientAuthenticationOptions)
 
virtual void AuthenticateAsServer (X509Certificate serverCertificate)
 
virtual void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation)
 
virtual void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 
void AuthenticateAsServer (SslServerAuthenticationOptions sslServerAuthenticationOptions)
 
virtual Task AuthenticateAsClientAsync (string targetHost)
 
virtual Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection? clientCertificates, bool checkCertificateRevocation)
 
virtual Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection? clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 
Task AuthenticateAsClientAsync (SslClientAuthenticationOptions sslClientAuthenticationOptions, CancellationToken cancellationToken=default(CancellationToken))
 
virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
 
virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation)
 
virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 
Task AuthenticateAsServerAsync (SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken=default(CancellationToken))
 
Task AuthenticateAsServerAsync (ServerOptionsSelectionCallback optionsCallback, object? state, CancellationToken cancellationToken=default(CancellationToken))
 
virtual Task ShutdownAsync ()
 
override void SetLength (long value)
 
override long Seek (long offset, SeekOrigin origin)
 
override void Flush ()
 
override Task FlushAsync (CancellationToken cancellationToken)
 
virtual Task NegotiateClientCertificateAsync (CancellationToken cancellationToken=default(CancellationToken))
 
override async ValueTask DisposeAsync ()
 
override int ReadByte ()
 
override int Read (byte[] buffer, int offset, int count)
 
void Write (byte[] buffer)
 
override void Write (byte[] buffer, int offset, int count)
 
override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback? asyncCallback, object? asyncState)
 
override int EndRead (IAsyncResult asyncResult)
 
override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback? asyncCallback, object? asyncState)
 
override void EndWrite (IAsyncResult asyncResult)
 
override Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
 
override ValueTask WriteAsync (ReadOnlyMemory< byte > buffer, CancellationToken cancellationToken=default(CancellationToken))
 
override Task< int > ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
 
override ValueTask< int > ReadAsync (Memory< byte > buffer, CancellationToken cancellationToken=default(CancellationToken))
 
void Dispose ()
 
void CopyTo (Stream destination)
 
virtual void CopyTo (Stream destination, int bufferSize)
 
Task CopyToAsync (Stream destination)
 
Task CopyToAsync (Stream destination, int bufferSize)
 
Task CopyToAsync (Stream destination, CancellationToken cancellationToken)
 
virtual Task CopyToAsync (Stream destination, int bufferSize, CancellationToken cancellationToken)
 
virtual void Close ()
 
Task FlushAsync ()
 
Task< int > ReadAsync (byte[] buffer, int offset, int count)
 
Task WriteAsync (byte[] buffer, int offset, int count)
 
virtual int Read (Span< byte > buffer)
 
virtual void Write (ReadOnlySpan< byte > buffer)
 
virtual void WriteByte (byte value)
 
object GetLifetimeService ()
 
virtual object InitializeLifetimeService ()
 

Static Public Member Functions

static Stream Synchronized (Stream stream)
 

Static Public Attributes

static readonly Stream Null = new NullStream()
 

Protected Member Functions

override void Dispose (bool disposing)
 
SemaphoreSlim EnsureAsyncActiveSemaphoreInitialized ()
 
virtual WaitHandle CreateWaitHandle ()
 
virtual void ObjectInvariant ()
 
MarshalByRefObject MemberwiseClone (bool cloneIdentity)
 

Static Protected Member Functions

static void ValidateBufferArguments (byte[] buffer, int offset, int count)
 
static void ValidateCopyToArguments (Stream destination, int bufferSize)
 

Protected Attributes

SemaphoreSlim _asyncActiveSemaphore
 

Package Functions

IAsyncResult BeginAuthenticateAsClient (SslClientAuthenticationOptions sslClientAuthenticationOptions, CancellationToken cancellationToken, AsyncCallback asyncCallback, object asyncState)
 
ChannelBinding GetChannelBinding (ChannelBindingKind kind)
 
Task< int > BeginReadInternal (byte[] buffer, int offset, int count, AsyncCallback callback, object state, bool serializeAsynchronously, bool apm)
 
Task BeginWriteInternal (byte[] buffer, int offset, int count, AsyncCallback callback, object state, bool serializeAsynchronously, bool apm)
 

Package Attributes

RemoteCertificateValidationCallback _userCertificateValidationCallback
 
LocalCertificateSelectionCallback _userCertificateSelectionCallback
 
ServerCertificateSelectionCallback _userServerCertificateSelectionCallback
 
LocalCertSelectionCallback _certSelectionDelegate
 
EncryptionPolicy _encryptionPolicy
 
byte[] _internalBuffer
 
int _internalOffset
 
int _internalBufferCount
 
int _decryptedBytesOffset
 
int _decryptedBytesCount
 

Properties

SslApplicationProtocol NegotiatedApplicationProtocol [get]
 
TransportContext TransportContext [get]
 
override bool IsAuthenticated [get]
 
override bool IsMutuallyAuthenticated [get]
 
override bool IsEncrypted [get]
 
override bool IsSigned [get]
 
override bool IsServer [get]
 
virtual SslProtocols SslProtocol [get]
 
virtual bool CheckCertRevocationStatus [get]
 
virtual ? X509Certificate LocalCertificate [get]
 
virtual ? X509Certificate RemoteCertificate [get]
 
virtual TlsCipherSuite NegotiatedCipherSuite [get]
 
virtual CipherAlgorithmType CipherAlgorithm [get]
 
virtual int CipherStrength [get]
 
virtual HashAlgorithmType HashAlgorithm [get]
 
virtual int HashStrength [get]
 
virtual ExchangeAlgorithmType KeyExchangeAlgorithm [get]
 
virtual int KeyExchangeStrength [get]
 
string TargetHostName [get]
 
override bool CanSeek [get]
 
override bool CanRead [get]
 
override bool CanTimeout [get]
 
override bool CanWrite [get]
 
override int ReadTimeout [get, set]
 
override int WriteTimeout [get, set]
 
override long Length [get]
 
override long Position [get, set]
 
object _handshakeLock [get]
 
int MaxDataSize [get]
 
bool LeaveInnerStreamOpen [get]
 
Stream InnerStream [get]
 

Private Types

enum  Framing {
  Unknown , BeforeSSL3 , SinceSSL3 , Unified ,
  Invalid
}
 

Private Member Functions

void SetAndVerifyValidationCallback (RemoteCertificateValidationCallback callback)
 
void SetAndVerifySelectionCallback (LocalCertificateSelectionCallback callback)
 
X509Certificate UserCertSelectionCallbackWrapper (string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string[] acceptableIssuers)
 
X509Certificate ServerCertSelectionCallbackWrapper (string targetHost)
 
SslAuthenticationOptions CreateAuthenticationOptions (SslServerAuthenticationOptions sslServerAuthenticationOptions)
 
IAsyncResult BeginAuthenticateAsServer (SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken, AsyncCallback asyncCallback, object asyncState)
 
Task AuthenticateAsClientApm (SslClientAuthenticationOptions sslClientAuthenticationOptions, CancellationToken cancellationToken=default(CancellationToken))
 
Task AuthenticateAsServerApm (SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken=default(CancellationToken))
 
SslProtocols GetSslProtocolInternal ()
 
void ThrowIfExceptional ()
 
void ThrowIfExceptionalOrNotAuthenticated ()
 
void ThrowIfExceptionalOrNotHandshake ()
 
void ThrowIfExceptionalOrNotAuthenticatedOrShutdown ()
 
void ValidateCreateContext (SslClientAuthenticationOptions sslClientAuthenticationOptions, RemoteCertificateValidationCallback remoteCallback, LocalCertSelectionCallback localCallback)
 
void ValidateCreateContext (SslAuthenticationOptions sslAuthenticationOptions)
 
void SetException (Exception e)
 
void CloseInternal ()
 
SecurityStatusPal EncryptData (ReadOnlyMemory< byte > buffer, ref byte[] outBuffer, out int outSize)
 
Task ProcessAuthenticationAsync (bool isAsync=false, bool isApm=false, CancellationToken cancellationToken=default(CancellationToken))
 
async Task ProcessAuthenticationWithTelemetryAsync (bool isAsync, bool isApm, CancellationToken cancellationToken)
 
async Task ReplyOnReAuthenticationAsync< TIOAdapter > (TIOAdapter adapter, byte[] buffer)
 
async Task RenegotiateAsync< TIOAdapter > (TIOAdapter adapter)
 
async Task ForceAuthenticationAsync< TIOAdapter > (TIOAdapter adapter, bool receiveFirst, byte[] reAuthenticationData, bool isApm=false)
 
async ValueTask< ProtocolTokenReceiveBlobAsync< TIOAdapter > (TIOAdapter adapter)
 
ProtocolToken ProcessBlob (int frameSize)
 
void SendAuthResetSignal (ProtocolToken message, ExceptionDispatchInfo exception)
 
bool CompleteHandshake (ref ProtocolToken alertToken, out SslPolicyErrors sslPolicyErrors, out X509ChainStatusFlags chainStatus)
 
void CompleteHandshake (SslAuthenticationOptions sslAuthenticationOptions)
 
async ValueTask WriteAsyncChunked< TIOAdapter > (TIOAdapter writeAdapter, ReadOnlyMemory< byte > buffer)
 
ValueTask WriteSingleChunk< TIOAdapter > (TIOAdapter writeAdapter, ReadOnlyMemory< byte > buffer)
 
 ~SslStream ()
 
void ReturnReadBufferIfEmpty ()
 
bool HaveFullTlsFrame (out int frameSize)
 
async ValueTask< int > EnsureFullTlsFrameAsync< TIOAdapter > (TIOAdapter adapter)
 
SecurityStatusPal DecryptData (int frameSize)
 
async ValueTask< int > ReadAsyncInternal< TIOAdapter > (TIOAdapter adapter, Memory< byte > buffer)
 
ValueTask< int > FillHandshakeBufferAsync< TIOAdapter > (TIOAdapter adapter, int minSize)
 
async ValueTask WriteAsyncInternal< TIOAdapter > (TIOAdapter writeAdapter, ReadOnlyMemory< byte > buffer)
 
void ConsumeBufferedBytes (int byteCount)
 
int CopyDecryptedData (Memory< byte > buffer)
 
void ResetReadBuffer ()
 
Framing DetectFraming (ReadOnlySpan< byte > bytes)
 
int GetFrameSize (ReadOnlySpan< byte > buffer)
 
bool HasOverriddenBeginEndRead ()
 
bool HasOverriddenBeginEndWrite ()
 
int GetCopyBufferSize ()
 
Task< int > BeginEndReadAsync (byte[] buffer, int offset, int count)
 
void FinishTrackingAsyncOperation (ReadWriteTask task)
 
Task BeginEndWriteAsync (byte[] buffer, int offset, int count)
 

Static Private Member Functions

static void ThrowNotAuthenticated ()
 
static void RunReadWriteTaskWhenReady (Task asyncWaiter, ReadWriteTask readWriteTask)
 
static void RunReadWriteTask (ReadWriteTask readWriteTask)
 
static async Task FinishWriteAsync (Task writeTask, byte[] localBuffer)
 

Private Attributes

readonly Stream _innerStream
 
SecureChannel _context
 
ExceptionDispatchInfo _exception
 
bool _shutdown
 
bool _handshakeCompleted
 
int _nestedWrite
 
int _nestedRead
 
SslAuthenticationOptions _sslAuthenticationOptions
 
int _nestedAuth
 
bool _isRenego
 
Framing _framing
 
TlsFrameHelper.TlsFrameInfo _lastFrame
 
volatile TaskCompletionSource< bool_handshakeWaiter
 
ArrayBuffer _handshakeBuffer
 
bool _receivedEOF
 
int _connectionOpenedStatus
 
readonly bool _leaveStreamOpen
 

Static Private Attributes

static readonly ExceptionDispatchInfo s_disposedSentinel = ExceptionDispatchInfo.Capture(new ObjectDisposedException("SslStream", (string?)null))
 

Detailed Description

Definition at line 15 of file SslStream.cs.


The documentation for this class was generated from the following file: