Convert .crt + .key files to X509Certificate2 programmatically in C#
问题 I have a .crt certificate and a .key private key file on a Linux machine. The private key is in encrypted PKCS#8 format (BEGIN ENCRYPTED PRIVATE KEY...). I would like to import these into an X509Certificate2 object for further use. Since we're on Linux, we're using .NET Core 2.2 (we cannot migrate to 3.0 yet). I have explored a few possible solutions, detailed below: Use openssl to convert the files to a .pfx and import that using X509Certificate2 I do not want to use this option since I don