view make-certificate @ 17:ccb1f0a7bfe9

Remove unused script now that F-Spot is abandonned
author IBBoard <dev@ibboard.co.uk>
date Mon, 19 Mar 2018 19:34:56 +0000
parents 14c88dd76d53
children b8c7a89c4ebd
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 req -nodes -new -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