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.
Asked
Active
Viewed 1,482 times
1 Answers
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
-
Is it not possible to extract the p12 from certificate store programatically? – AnOldSoul Jun 19 '16 at 00:33
-
In my knowledge , you can not. It could be a security hole to allow apps to download your personal certificates – pedrofb Jun 19 '16 at 18:54