Skip to content

The requested operation is not supported when exporting ECParameters with private parameters from X509Certificate2 #104294

Answered by bartonjs
joegoldman2 asked this question in Q&A
Discussion options

You must be logged in to vote

When Windows makes a key by loading a PFX it ends up in either the legacy CAPI system, or the newer CNG system. For CAPI Exportable means exportable, no ifs/ands/buts. But CNG has "Exportable" and "Plaintext Exportable". PFX:Exportable only maps to CNG:Exportable, but since we're asking for the key parameters directly that's a "plaintext export".

If you really want to work around it, you can export as encrypted PKCS8, then import that into a new key object (ECDsa.Create()). The new key object will have been set up as plaintext exportable.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by joegoldman2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants