Created
November 30, 2015 09:56
-
-
Save siburu/bb162362a8ee9ae35bfe 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/sh | |
# This script explains how to generate a self signed certificate (DER format). | |
if [ $# = 0 ] | |
then | |
echo 'Usage: $0 <name>' | |
exit 1 | |
fi | |
name=$1 | |
tmpkey=`mktemp -t ca.key` | |
openssl genrsa -aes256 -out $tmpkey 2048 | |
openssl req -new -key $tmpkey -out $name.csr | |
openssl rsa -in $tmpkey -out $name.key -outform der | |
rm $tmpkey | |
openssl x509 -req -days 3650 -in $name.csr -signkey $name.key -keyform der -out $name.crt -outform der |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment