add cert generator scripts, arrange scripts dir

This commit is contained in:
2019-01-12 20:28:45 +02:00
parent 6607a41c55
commit b0321589af
7 changed files with 104 additions and 0 deletions

17
scripts/certs/gen-ca.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR"
rm -f ca.crt
rm -f ca.key
if [ -z "$1" ]; then
read -s pass
else
pass=$1
fi
subj="/C=BG/ST=Bulgaria/L=Sofia/O=S.M.I.R.K.Y./CN=localhost"
openssl genrsa -des3 -out ca.key -passout pass:$pass 4096
openssl req -new -x509 -days 365 -key ca.key -subj $subj -passin pass:$pass -out ca.crt -passin pass:$pass