Hacker News new | ask | show | jobs
by gt99 3821 days ago
function openssl-key-to-pin() { openssl rsa -in "${1}" -outform der -pubout | openssl dgst -sha256 -binary | openssl enc -base64 }

function openssl-website-to-pin() { openssl s_client -connect ${1}:443 | openssl x509 -pubkey -noout | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 }

1 comments

Awesome - for HPKP?
Yup, exactly. :)

Would probably be more verbose if named:

openssl-key-to-hpkp-pin

openssl-website-to-hpkp-pin

Added and credited :-)
Thanks! And thanks for the article! Lots of great shortcuts, they all made it to my .bashrc ;)
I just sent you an email, I have two more.