Created
December 12, 2016 17:49
-
-
Save nandotorres/e94d6dadf50f457e1742ca9115755702 to your computer and use it in GitHub Desktop.
Generate key.pem and cert.pem to use with packer
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 | |
KEY_NAME=$1 | |
PEM_NAME="${KEY_NAME}-key.pem" | |
CERTIFICATE_NAME="${KEY_NAME}-certificate.pem" | |
openssl genrsa 2048 > $PEM_NAME | |
openssl req -new -x509 -nodes -sha1 -days 365 -key $PEM_NAME -outform PEM > $CERTIFICATE_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment