Linux: Set a static/fixed IP with Network Manager Cli, Java Error: Failed to validate certificate. Checks to see if the certificate matches the provided host name. But opting out of some of these cookies may affect your browsing experience. }. I am trying to export a cert without the private key as as BASE-64 encoded file, same as exporting it from windows. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. The private key is not what you would pass into the X509Certificate2 constructor. Retrieve the certificate in PFX or PEM format. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. You can find some helpful code to do so inside Mono.Security.dll (MIT.X11 licensed code from the Mono project). Without manipulating with bytes at low level? An example to export the machine certificate (with Thumbprint: 1C0381278083E3CB026E46A7FF09FC4B79543D) of an computer, Or load a certificate from a file and convert it to pem format,