An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Unknown format in Input when creating X509Certificate2?
Benjamin Salerno
6
Reputation points
I am attempting to create a X509CertificateCollection to use for validating my Nest client for ElasticSearch. I am attempting to create the first certificate like this:
private static readonly string Certificate = "mycert.cert";
private static X509Certificate2 cert = new X509Certificate2(Certificate);
However this is giving me the error
Interop.AppleCrypto.AppleCommonCryptoCryptographicException : Unknown format in import.
This is confusing me because having checked the documentation I thought I could create a X509Certificate using a file path. What am I doing wrong and how can I fix this issue?
Developer technologies | C#
Developer technologies | C#
Sign in to answer