0

Is it possible to download the p12 certificate back again from the certificate store? I have this requirement where the private key and the certificate have been put together in a p12 certificate and this p12 certificate has been installed in the windows certificate store. Now I need to get the private key back again from this certificate installed in certificate store. Since its not possible, is it possible to download the p12 certificate from the cert store? If I can do that, I can then read the private key from the downloaded p12 certificate. Please assist with some example using javascript/nodejs.

AnOldSoul
  • 4,017
  • 12
  • 57
  • 118

1 Answers1

0

You can manually extract a certificate from windows store if you have marked as extractable when importing.

The certificate can be saved as p12 using a password. After this you need a third party library to decrypt the p12 file, parse the content and extract the private or public key

The unique library I know to perform this operación is forge https://github.com/digitalbazaar/forge

See my response at How to load a PKCS#12 Digital Certificate with Javascript WebCrypto API to see a full example and also, some key conversions if you need them

Community
  • 1
  • 1
pedrofb
  • 37,271
  • 5
  • 94
  • 142