Search code examples
javascriptx509certificatepublic-keyx509certificate2

Extract public key from certificate x509


I am looking for a way to extract public key from certificate x509 (PEM format) in javascript like this one:

openssl x509 -in cert.cer -pubkey -noout > pub.txt

Solution

  • You need something that can parse ASN.1 structure. You could use pkijs.

    Demo can be found here