Share via


SslStream Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Provides a stream used for client-server communication that uses the Secure Socket Layer (SSL) security protocol to authenticate the server and optionally the client.

Inheritance Hierarchy

System. . :: . .Object
  System. . :: . .MarshalByRefObject
    System.IO. . :: . .Stream
      System.Net.Sockets. . :: . .NetworkStream
        Microsoft.SPOT.Net.Security..::..SslStream

Namespace:  Microsoft.SPOT.Net.Security
Assembly:  System.Net.Security (in System.Net.Security.dll)

Syntax

'Declaration
Public Class SslStream _
    Inherits NetworkStream
public class SslStream : NetworkStream
public ref class SslStream : public NetworkStream
type SslStream =  
    class
        inherit NetworkStream
    end
public class SslStream extends NetworkStream

The SslStream type exposes the following members.

Constructors

  Name Description
Public method SslStream Initializes a new instance of the SslStream class using the specified Socket.

Top

Properties

  Name Description
Public property CanRead Gets a value that indicates whether the NetworkStream supports reading. (Inherited from NetworkStream.)
Public property CanSeek Gets a value that indicates whether the stream supports seeking. This property is not currently supported.This property always returns false. (Inherited from NetworkStream.)
Public property CanTimeout Indicates whether timeout properties are usable for NetworkStream. (Inherited from NetworkStream.)
Public property CanWrite Gets a value that indicates whether the NetworkStream supports writing. (Inherited from NetworkStream.)
Public property DataAvailable Gets a value the indicates whether data is available in the stream. (Overrides NetworkStream. . :: . .DataAvailable.)
Public property IsServer Gets a value that indicates whether the local side of the connection used by this SslStream was authenticated as the server.
Public property Length Gets the length of the stream. (Overrides NetworkStream. . :: . .Length.)
Public property Position Gets or sets the current position in the stream. This property is not currently supported and always throws a NotSupportedException. (Inherited from NetworkStream.)
Public property ReadTimeout Gets or sets the amount of time that a read operation blocks waiting for data. (Inherited from NetworkStream.)
Public property WriteTimeout Gets or sets the amount of time that a write operation blocks waiting for data. (Inherited from NetworkStream.)

Top

Methods

  Name Description
Public method AuthenticateAsClient(String, array<SslProtocols> [] () [] []) Called by clients to authenticate the server and optionally the client in a client-server connection. The authentication process uses the specified SSL protocols.
Public method AuthenticateAsClient(String, X509Certificate, SslVerification, array<SslProtocols> [] () [] []) Called by clients to authenticate the server and optionally the client in a client-server connection. The authentication process uses the specified certificate collections and SSL protocols.
Public method AuthenticateAsClient(String, X509Certificate, array<X509Certificate> [] () [] [], SslVerification, array<SslProtocols> [] () [] []) Called by clients to authenticate the server and optionally the client in a client-server connection. The authentication process uses the specified certificate collections and SSL protocols.
Public method AuthenticateAsServer(X509Certificate, SslVerification, array<SslProtocols> [] () [] []) Called by servers to authenticate the server and optionally the client in a client-server connection using the specified certificate, requirements and security protocol.
Public method AuthenticateAsServer(X509Certificate, array<X509Certificate> [] () [] [], SslVerification, array<SslProtocols> [] () [] []) Called by servers to authenticate the server and optionally the client in a client-server connection using the specified certificate, verification requirements and security protocol.
Public method Close() () () () Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. Instead of calling this method, ensure that the stream is properly disposed. (Inherited from Stream.)
Public method Close(Int32) Closes the NetworkStream after waiting the specified time to allow data to be sent. (Inherited from NetworkStream.)
Public method Dispose() () () () Releases all resources used by the Stream. (Inherited from Stream.)
Protected method Dispose(Boolean) Releases the unmanaged resources used by the SslStream and optionally releases the managed resources. (Overrides NetworkStream. . :: . .Dispose(Boolean).)
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Performs cleanup operations. (Overrides Stream. . :: . .Finalize() () () ().)
Public method Flush Flushes data from the stream. This method is reserved for future use. (Inherited from NetworkStream.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Read Reads data from this stream and stores it in the specified array. (Overrides NetworkStream. . :: . .Read(array<Byte> [] () [] [], Int32, Int32).)
Public method ReadByte Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream. (Inherited from Stream.)
Public method Seek Sets the current position of the stream to the given value. This method is not currently supported and always throws a NotSupportedException. (Inherited from NetworkStream.)
Public method SetLength Sets the length of the stream. This method always throws a NotSupportedException. (Inherited from NetworkStream.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method UpdateCertificates Updates the SSL stack to use updated certificates.
Public method Write Write the specified number of bytes to the underlying stream using the specified buffer and offset. (Overrides NetworkStream. . :: . .Write(array<Byte> [] () [] [], Int32, Int32).)
Public method WriteByte Writes a byte to the current position in the stream and advances the position within the stream by one byte. (Inherited from Stream.)

Top

Fields

  Name Description
Protected field _disposed Indicates whether the NetworkStream has been disposed. (Inherited from NetworkStream.)
Protected field _remoteEndPoint Contains the stream's remote endpoint. (Inherited from NetworkStream.)
Protected field _socketType Contains the socket type. (Inherited from NetworkStream.)

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.SPOT.Net.Security Namespace