Created
November 25, 2016 09:35
-
-
Save scrooby/4415bc108858d7a70d5f2e5c010011dc to your computer and use it in GitHub Desktop.
Write a X509Certificate public key in PEM format
This file contains 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
var cert = Org.BouncyCastle.Security.DotNetUtilities.FromX509Certificate(x509certificate); | |
using (var stringWriter = new StringWriter()) | |
{ | |
var pemWriter = new Org.BouncyCastle.OpenSsl.PemWriter(stringWriter); | |
pemWriter.WriteObject(cert.GetPublicKey()); | |
var pem = stringWriter.ToString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment