This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this snippet can be easily used in any normal c# project as well by simply removing the .Dump() methods | |
// and saving the output into a variable / file of your choice. | |
// you'll need to add BouncyCastle.Crypto nuget to use this. | |
// tested on 1.8.1 | |
// OUTPUTS: CSR, Private Key, Public Key, Self-signed Certificate | |
using Org.BouncyCastle.Asn1; | |
using Org.BouncyCastle.Asn1.Cms; | |
using Org.BouncyCastle.Asn1.Pkcs; | |
using Org.BouncyCastle.Asn1.X509; |