I have an PFX Certificate file containing both Client Certificate and Private Key. Then I have imported this pfx file in Windows Personal Certificate Store.

Now I need to extract the certificate and Private Key bytes and passed to an openssl api.

I am able to extract the Certificate but not able to extract the private key bytes in Plain Text using windows Crypto API's .

I have searched for it but not got exactly what I need. So please help me in this.


Use "Jailbreak"

The "non exportable" attribute can be overridden with NCC's "Jailbreak".

  • Thanks for this. But i have to do this Programmatically – User1234 Dec 14 '15 at 9:04
  • I see. You're trying to override an explicit "don't do this" flag in Windows. I don't think there is an official API for this. What you could do is: (a) force export via jailbreak. (b) delete cert/privkey from Windows store. (c) reimport to store but this time with the "mark as non-exportable" attribute not set. – StackzOfZtuff Dec 14 '15 at 9:04

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.