Skip to content

Instantly share code, notes, and snippets.

@vasily-kirichenko
Created September 18, 2020 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vasily-kirichenko/219df2fd8b5f26f0abb063ccf0063e81 to your computer and use it in GitHub Desktop.
Save vasily-kirichenko/219df2fd8b5f26f0abb063ccf0063e81 to your computer and use it in GitHub Desktop.
// download https://drive.google.com/file/d/1kXYcIkDMX25km5YtSBfFa9Xxx2dx8cNB/view?usp=sharing locally
using System;
using System.IO;
using System.Security.Cryptography.X509Certificates;
namespace EccSigNet5
{
static class Program
{
static void Main()
{
var cert = new X509Certificate2(File.ReadAllBytes("<path to the downloaded certificate>"));
Console.WriteLine(cert.PublicKey.Key);
}
}
}
// Unhandled exception. System.NotSupportedException: The certificate key algorithm is not supported.
// at System.Security.Cryptography.X509Certificates.PublicKey.get_Key()
// at EccSigNet5.Program.Main() in C:\WLCR\github\EccSig\EccSigNet5\Program.cs:line 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment