You won't remember the OpenSSL options, so here's bash shortcuts for everything
1–10 of 10 posts
Re: You won't remember the OpenSSL options, so here's bash shortcuts for everything
#2function 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 }
Re: You won't remember the OpenSSL options, so here's bash shortcuts for everything
#3Re: You won't remember the OpenSSL options, so here's bash shortcuts for everything
#4On the other hand, I've learned more from continuing to read the manpages than probably anything else. And the OpenSSL commands that I use frequently, such as connecting to a site with TLS, or checking a certificate chain, can now be easily recalled from memory, and I feel I'm better off for it, especially if I'm at a terminal where my OpenSSL functions might not be installed.
Re: You won't remember the OpenSSL options, so here's bash shortcuts for everything
#5 function openssl-encrypt() {
openssl enc -aes-256-cbc -salt -in "${1}" -out "${2}"
}Re: You won't remember the OpenSSL options, so here's bash shortcuts for everything
#6function 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 }
Re: You won't remember the OpenSSL options, so here's bash shortcuts for everything
#7function 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 }
Awesome - for HPKP?
Would probably be more verbose if named:
openssl-key-to-hpkp-pin
openssl-website-to-hpkp-pin