Created
February 4, 2016 13:32
-
-
Save halfninja/6e6bbe9ed2d83025e5bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PRIVATE_PEM=$(openssl genrsa 2048 2>/dev/null) | |
PUBLIC_PEM=$(echo "$PRIVATE_PEM" | openssl rsa -pubout 2>/dev/null) | |
echo "Public key:" | |
echo "$PUBLIC_PEM" | openssl rsa -pubin -pubout -inform PEM -outform DER 2>/dev/null | base64 -w0 | |
echo | |
echo | |
echo "Private key:" | |
echo "$PRIVATE_PEM" | openssl rsa -inform PEM -outform DER 2>/dev/null | base64 -w0 | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment