Implementing SSL Connections

This topic discusses how to implement secure data transfer in the .NET Micro Framework using Secure Sockets Layer (SSL).
The .Net Micro Framework includes cryptographic software written by Eric Young (email:

SSL protocols help to provide confidentiality and integrity checking for messages transmitted using an SslStream. An SSL connection, such as that provided by SslStream, should be used when communicating sensitive information between a client and a server. Using an SslStream helps to prevent anyone from reading and tampering with information while it is in transit on the network.

An SslStream attaches to an underlying Socket to provide secure data transfer. The SslStream object manages the lifetime of the underlying Socket. When an SslStream class is disposed the underlying TCP socket will be closed.

After creating an SslStream, the server and optionally, the client must be authenticated. The server provides an X509Certificate that establishes proof of its identity and can request that the client also do so. Authentication must be performed before transmitting information using an SslStream. Clients initiate authentication using the synchronous AuthenticateAsClient methods, which block until the authentication completes. Servers initiate authentication using the synchronous AuthenticateAsServer. Both client and server must initiate the authentication.

After a successful authentication, you can send data using the Write methods. You can receive data using the Read methods.