Unable to convert pfx to pem

Mar 21, 2016 at 12:32 PM
Hi,

I am trying to convert pfx to pem by using Convert-PfxToPem but I get the error below:
PS C:\Users\user\Desktop\CA> Convert-PfxToPem -InputFile C:\Users\user\Desktop\CA\test.pfx -Password (ConvertTo-SecureString 'test' -AsPlainText -Force) -OutputFile C:\Users\user\Desktop\CA\test.pem
Key not valid for use in specified state
At C:\Users\user\Documents\WindowsPowerShell\Modules\pspki\Client\Convert-PfxToPem.ps1:137 char:21
+             } else {throw New-Object ComponentModel.Win32Exception ([Runtime.Int ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], Win32Exception
    + FullyQualifiedErrorId : Key not valid for use in specified state
The private key is marked as exportable.

Thanks
Coordinator
Mar 21, 2016 at 5:07 PM
Is your key stored in the Key Storage Provider? Currently, the command do not support KSP, only legacy CSPs.
Mar 22, 2016 at 10:52 AM
No, certificate was requested with providername=Microsoft RSA SChannel Cryptographic Provider
Mar 24, 2016 at 12:10 PM
I currently have the same problem. Any news about that?
Coordinator
Mar 24, 2016 at 8:16 PM
It would be nice if you could send me a sample PFX that doesn't work for further debugging. You can contact me directly through email.
Mar 30, 2016 at 7:11 AM
Hi, did you get my email with the PFX?
Coordinator
Mar 30, 2016 at 8:23 AM
Sorry, I didn't get your email. Check my email: vpodans&sysadmins.lv
Mar 30, 2016 at 2:32 PM
Edited Mar 30, 2016 at 2:32 PM
I've just sent you the email again right now.
Coordinator
Mar 30, 2016 at 2:56 PM
Now I got your mail, thanks. I'll take a look.
Coordinator
Mar 30, 2016 at 3:56 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Mar 31, 2016 at 12:13 PM
Edited Mar 31, 2016 at 12:13 PM
Follow this workitem : https://pspki.codeplex.com/workitem/92 for further updates.