Skip to content

Instantly share code, notes, and snippets.

View qinxg's full-sized avatar
🏠
Working from home

qinxg qinxg

🏠
Working from home
View GitHub Profile
@Maverik
Maverik / CSRGenerator.cs
Last active August 4, 2020 10:56
CSR Generator Snippet for Linqpad (C#)
// 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;