Settings

Theme

You won't remember the OpenSSL options, so here's bash shortcuts for everything

certsimple.com

6 points by mikemaccana 10 years ago · 9 comments

Reader

atoponce 10 years ago

On the one hand, this is really quite good. I'm always interested in making my time at the command line more efficient. If I put this in my shell's config, and remember the function names, I'm golden.

On 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.

atoponce 10 years ago

Encrypting files should probably include a salt-per-file, otherwise the same file contents will produce the same ciphertext when the same passphrase is provided.

    function openssl-encrypt() {
        openssl enc -aes-256-cbc -salt -in "${1}" -out "${2}"
    }
blakesterz 10 years ago

This is great. Now I just need to remember the shortcuts! I have such a giant collection of bash short cuts in my .bashrc and other dotfiles that I can't seem to remember ANY of them and end up just typing everything out in the end :-)

gt99 10 years 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 }

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection