aloopkin / WinCertes

An ACMEv2 client for Windows
GNU General Public License v3.0
118 stars 28 forks source link

Allow private keys to be exportable #13

Closed Adambean closed 5 years ago

Adambean commented 5 years ago

Could we have an option to allow private keys to be exportable from the certificate store?

This is required to make the certificate and key available to other software that needs them in PEM formats, such as Apache and hMailServer. What I'd typically export in PEM format:

I did look into the PowerShell script option but that only runs if a certificate is really issued on that run. (You can't run it again for already issued certificates until they're renewed.) There also seems to be absolutely no documentation around the object structure returned by `Get-PfxData. (Microsoft's docs are next to useless on this.)

An alternative could be to have an option in WinCertes save a PFX (or PKCS#12) file to a specified location instead of needing to go through PowerShell. I could then give that file to OpenSSL for the PEM file generation.

aloopkin commented 5 years ago

Please see issue #9

Adambean commented 5 years ago

What a star! Looks like a hefty job to get this working in PowerShell, but the answer is definitely there.