-
Notifications
You must be signed in to change notification settings - Fork 59
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
Convert-PfxToPem fails with invalid provider type #81
Comments
Sounds like the key was loaded into key storage provider. KSP is not yet supported, because the code wasn't updated in a while. As workaround, you can modify PSPKI/PSPKI/Client/Convert-PfxToPem.ps1 Line 130 in c2d95a9
with this content:
and check if it works. Keep in mind that this change will break the signature on PS1 file. |
Thank you for the quick answer. Now the code gets a bit further, but still fails:
|
This confirms that the key is stored in KSP, not CSP. A bit more work is necessary for complete KSP support. I'll put this on my work list. I can provide you a temporary fix later. |
Oh, it would be great if you could provide a temporary fix. I'd really appreciate that! |
Things appear to be more complicated. For some reasons (I have no idea why), X509Certificate2 with "Exportable" flag doesn't enable private key plain text export for CNG keys. The call to |
Did you happen to get any further with this? I saw this post, which might help in the issue: https://stackoverflow.com/questions/54483371/cannot-export-rsa-private-key-parameters-the-requested-operation-is-not-support/54525572#54525572 |
nope. I was able to manage some p/invoke stuff, but yet it still doesn't work as expected.
again, no. Using legacy providers is discouraged and they don't support EC algorithms. |
When I use the Convert-PfxToPem cmdlet, it fails with an error.
Command:
Output:
This is on PowerShell 5.1 on Windows Server 2019.
Any idea why this is failing?
The text was updated successfully, but these errors were encountered: