Click here to Skip to main content
15,885,216 members
Articles / Programming Languages / C#

An Asynchronous Socket Server and Client

Rate me:
Please Sign up or sign in to vote.
4.89/5 (265 votes)
29 Apr 2009CPOL16 min read 4M   25.6K   1.1K  
An asynchronous socket server and client with encryption and compression.
Both CA and server certificate was created using Win32 OpenSSL (http://www.slproweb.com/products/Win32OpenSSL.html).
Download Win32 OpenSSL, install it and execute the following batch files in Win32 OpenSSL bin folder (openssl.exe location):

1) createCA.bat				- Create CA certificate
2) createCertandSign.bat	- Create server certificate and sign it using CA certificate
3) createPFX.bat			- Create PFX (P12) encrypted certificate to use with Windows

Files created:

ca.key / ca.crt	- CA key pair and certificate.
cert.csr		- server certificate request.

cert.crt		- server certificate (public key only)

	Only this file is deployed on client when using EncryptType.etRijndael. Load the file on OnSymmetricAuthenticate.
	If EncryptType.etSSL is used instead, there's no need to deploy this file in client.
	See EchoCryptService project for details.

cert.p12 		- server certificate (public/private key encrypted with password)

	This file will be always on server when using EncryptType.etRijndael or EncryptType.etSSL.
	If EncryptType.etSSL is used, load the file on OnSSLServerAuthenticate. If EncryptType.etRijndael is used, load the file on OnSymmetricAuthenticate.
	See EchoCryptService project for details.

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Brazil Brazil
- Living in São Paulo, Brazil
- Developing since 1994 with
* Clipper (Summer '87 and 5.02)
* FoxPro (DOS, 2.6), Visual Foxpro (6, 7, 8, 9)
* Delphi (1, 2, 5, 7, 2007)
* C# (2.0, 4.0)

Comments and Discussions