-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Improvement] Exporting x509 certs/keys as PEM #122
Comments
Hi essentially you are asking for a feature, that allows to Export the certificate as PEM, right? The PEM parts are covered, since I store the original certificate (and also X509Certificate2 has an export function, which allows to create the Base64 Encoded contents for the cert). |
There seems to be an easy way - but it's only available in .NET Core and thus PS Core 7. |
There's some good info on these pieces here: From working through those & using a bit of reverse engineering I've come up with the code below. It's not there yet; but getting close (sorry it's a bit of a mess; I've been hacking away trying to figure things out & haven't yet tidied it into a more usable piece). I'll try to progress further, but sharing this attempt so far for now as I don't have much time this week / this may help someone else progress further... Side note: the code I developed below was based on Scott's example which is an RSA key; whilst I'd been testing with a regular private key...
|
Well executed, sir! If you like to do the heavy lifting, I'll happily include it in the module (don't forget ecdsa then ;)). |
We are using the modules on stand-alone windows machines that are running FileMaker Server. Our scripting is setup to download a new certificate about every 53 days and then install the certificate on the following Sunday.
In the current implementation we are exporting the certificate as a PFX then parsing the client and chain certs and also the key. One client we have fails to get the chain certificate from the PFX. This prompted some investigating on my part and I see that there are functions for getting the entire PEM using the State 'GetOrderCertificate' function. Is there a similar function that I can use to export the certificate key? I do not see a similar function for the AcmePSKey class and am not sure how to use any of the AcmePSKey's export functions.
Thanks
The text was updated successfully, but these errors were encountered: