I'm looking to retrieve public key from x509 certificate.
I receive a x509 certificate from the server and I need to retrieve public key from the x509 certificate using javascript(browser side) and encrypt the public key with hashed value and send back to the server.
I found some package for encryption.
But i have difficulties in finding a javascript package for retrieving public key from x509 certificate.
What are the javascript packages i should look to achieve this
Im okay to use other browser side languages to achieve this, if its not possible to do in the javascript.
For encryption im using 'Jsencrypt'
also i found 'node-forge' very useful, is that possible to use node modules on the browser side.
Asked
Active
Viewed 645 times
0

JoJo
- 67
- 8
-
Why? What are you trying to accomplish? – Ramesh Aug 23 '20 at 17:20
-
If you are trying to do whats shown in the image present in https://www.entrustdatacard.com/pages/ssl then tls/ssl i.e `https` in front of your domain will take care of it. If you are not using `http` then you must. – Ramesh Aug 23 '20 at 17:41
-
Thank you so much for the reply. There is a java code similar to this https://www.devglan.com/java8/rsa-encryption-decryption-java Im trying to use something like this in javascript. I saw this which is similar to what i needed https://stackoverflow.com/a/28928340/12955442 and from this answer i understood that x509 is a certificate and i need to retrieve public key from that certificate. So to do that i cant find a javascript module. – JoJo Aug 23 '20 at 18:19