Skip to content

Instantly share code, notes, and snippets.

@maraca
Created March 6, 2014 21:29
Show Gist options
  • Save maraca/9400086 to your computer and use it in GitHub Desktop.
Save maraca/9400086 to your computer and use it in GitHub Desktop.
#!/bin/bash
KEY_NAME=$1
PEM_NAME="${KEY_NAME}-key.pem"
PEM_NAME_PCKS8="${KEY_NAME}-pem-PCKS8-format.pem"
CERTIFICATE_NAME="${KEY_NAME}-certificate.pem"
openssl genrsa 2048 > $PEM_NAME
openssl pkcs8 -topk8 -nocrypt -inform PEM -in $PEM_NAME -out $PEM_NAME_PCKS8
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