Skip to content

Instantly share code, notes, and snippets.

@dsprenkels
Created March 8, 2017 23:22
Show Gist options
  • Save dsprenkels/4e16fc360c009a8238132f934a9f3814 to your computer and use it in GitHub Desktop.
Save dsprenkels/4e16fc360c009a8238132f934a9f3814 to your computer and use it in GitHub Desktop.
#!/bin/sh
KEYNAME="$1"
SERIAL="$2"
openssl genrsa -des3 -out $KEYNAME.key 4096
openssl req -new -key $KEYNAME.key -out $KEYNAME.csr
openssl x509 -req -days 365 -in $KEYNAME.csr -CA ca.crt -CAkey ca.key -set_serial $SERIAL -out $KEYNAME.crt
openssl pkcs12 -export -clcerts -in $KEYNAME.crt -inkey $KEYNAME.key -out $KEYNAME.p12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment