18 lines
403 B
Bash
Executable File
18 lines
403 B
Bash
Executable File
#!/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 -rs 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
|
|
|