Creating a self-signed certificate with Bouncy Castle for .NET

This is the source code to go with my series of blog postings on how
to use Bouncy Castle to create X509 certificates from a .NET application.