Example certificate generation and signing for C#


To download the example code associated with this post on PKI boot camp click here. Why make a nominal charge? It took a while to figure out how to create certificates in C# so I know if you are looking to be able to generate certificates, generate and verify signatures then this example is going to save you time. If you’re learning about PKI in C# and example code you can run with is not worth $5 to you that’s OK.

The download package contains full examples of creating:

  • Master (root), intermediate and functional X.509 certificates
  • A certificate chain
  • Code-signing, email signature and time-stamp functional certificates
  • Examples of adding extented certificate usage features such policies, friendly names, certificate and revocation locations
  • A PKCS12 keystore containing one or more private keys and certificate chains
  • Certificates and keys from a PKCS12 keystore

Also includes utility functions which show how to:

  • Verify the signature on a portabe executable (.exe/.dll) file
  • Generate key pairs
  • Generate timestamps
  • List or dump the content of a certificate
  • Read .pem and .cer/crt files
  • Generate revocation lists

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts

Reader Comments

Sorry, comments are closed.