small pixel drawing of a pufferfish dotfiles

bin/chef-keygen

1 2 3 4 5 6 7
#!/bin/sh

key=$(openssl genrsa 2048 2>/dev/null)
pubkey=$(printf "%s" "$key" | openssl rsa -pubout)
pubkey_newline=$(printf "%s\n" "$pubkey" | tr '\n' '}' | sed 's/}/\\n/g')

printf "%s\n%s\n%s\n" "$key" "$pubkey" "$pubkey_newline"