Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save BurgerZ/f176d2e057a7f20e3bb0720db52d81f0 to your computer and use it in GitHub Desktop.

Select an option

Save BurgerZ/f176d2e057a7f20e3bb0720db52d81f0 to your computer and use it in GitHub Desktop.
openSSL public key extract

OpenSSL Extract Public Key from Cert

With the leaf certificate from Stackoverflow.com, you can extract the public key that is embedded inside of the cert with this command: openssl x509 -pubkey -noout -in stackexchangecom.crt > pubkey.pem Print your cert information.. openssl x509 -in stackexchangecom.crt -text -noout Print your public key... openssl rsa -inform PEM -pubin -in pubkey.pem -text -noout now you can compare the Modulus of the cert and public key to see they are the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment