Last active
September 10, 2024 09:06
-
-
Save pollux-/696657b75b45f1755f9105580b125c08 to your computer and use it in GitHub Desktop.
Generating SHA256 hash of a public key from remote server certificate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Creating certificate from remote URL and writing to file (mycertfile.pem) | |
openssl s_client -showcerts -connect gist.github.com:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >mycertfile.pem | |
Generating SHA256 hash of public key from a certificate (mycertfile.pem) | |
openssl x509 -in mycertfile.pem -pubkey -noout | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment