Skip to content

Instantly share code, notes, and snippets.

@ian-r-rose
Created October 31, 2023 23:11
Show Gist options
  • Save ian-r-rose/1c714ee04be53f7a3fd80322e1a22c27 to your computer and use it in GitHub Desktop.
Save ian-r-rose/1c714ee04be53f7a3fd80322e1a22c27 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euxo pipefail
openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 des3 -inform PEM -out $1.p8 -passout pass:"${2}"
openssl rsa -in $1.p8 -pubout -out $1.pub -passin pass:"${2}"
cat $1.p8
cat $1.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment