Mercurial > repos > other > usr-local-bin
view make-certificate @ 2:30145875d811
Update when we pull website code down
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 09 Nov 2014 09:27:00 +0000 |
parents | e85e3470a41e |
children | 14c88dd76d53 |
line wrap: on
line source
#! /bin/bash set -e if [ $# -ne 1 ]; then echo "Usage: $0 <key-name>" exit 1 fi if [ ! -d ~/Websites/certs/ ]; then echo "~/Websites/certs/ didn't exist - can't create certs" exit 1 fi pushd ~/Websites/certs/ #openssl genrsa -des3 -out $1.key 4096 #openssl req -new -key $1.key -out $1.csr #openssl x509 -req -days 365 -in $1.csr -CA ~/.ssh/CA/ca.crt -CAkey ~/.ssh/CA/ca.key -CAserial ~/.ssh/CA/ca.srl -out $1.crt #-set_serial $serial #openssl rsa -in $1.key -out $1.key.insecure #mv $1.key $1.key.secure #mv $1.key.insecure $1.key #echo $(($serial + 1)) > ~/.ssh/CA/next-serial.dat openssl req -nodes -newkey rsa:2048 -keyout $1.key -out $1.csr -subj "/C=GB/ST=Worcestershire/O=$1/CN=$1" openssl x509 -req -days 365 -in $1.csr -CA ~/.ssh/CA/ca.crt -CAkey ~/.ssh/CA/ca.key -CAserial ~/.ssh/CA/ca.srl -out $1.crt popd