How to use certutil -exportPFX to export certificates from "Certifiate Enrollment Requests" store?

I have Windows Server 2008. I am trying to write a script to export my certificate request private keys. I wanted to use the powershell cmdlet Export-PfxCertificate to export my certificate request's private keys, but it seems that cmdlet is missing from Server 2008. So I tried the certutil command, but I keep getting the error:

CertUtil: -exportPFX command FAILED: 0x80070002 (WIN32: 2)
CertUtil: The system cannot find the file specified.

I know the particular serial number and thumbprint, but it seems like I am not specifying the [CertificateStoreName] correctly. In powershell, the location is cert:\LocalMachine\REQUEST, but I cannot get the format for certutil.

I have tried many versions of

certutil -f -enterprise -exportpfx 05..hexdigits...0a C:\private.pfx

But no success. certutil -store -? was not in figuring out the correct format.

How can I do this?

Thanks!

1 Answer

Certificate Signing Requests are stored in a separate store (named REQUEST) from normal certificates. Use this:

certutil -exportPFX -user -p "password" REQUEST $SerialNumber "a.pfx"

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like