Blame SOURCES/make-dummy-cert

9b88be
#!/bin/sh
9b88be
umask 077
9b88be
9b88be
answers() {
9b88be
	echo --
9b88be
	echo SomeState
9b88be
	echo SomeCity
9b88be
	echo SomeOrganization
9b88be
	echo SomeOrganizationalUnit
9b88be
	echo localhost.localdomain
9b88be
	echo root@localhost.localdomain
9b88be
}
9b88be
9b88be
if [ $# -eq 0 ] ; then
9b88be
	echo $"Usage: `basename $0` filename [...]"
9b88be
	exit 0
9b88be
fi
9b88be
9b88be
for target in $@ ; do
9b88be
	PEM1=`/bin/mktemp /tmp/openssl.XXXXXX`
9b88be
	PEM2=`/bin/mktemp /tmp/openssl.XXXXXX`
9b88be
	trap "rm -f $PEM1 $PEM2" SIGINT
9b88be
	answers | /usr/bin/openssl req -newkey rsa:2048 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 2> /dev/null
9b88be
	cat $PEM1 >  ${target}
9b88be
	echo ""   >> ${target}
9b88be
	cat $PEM2 >> ${target}
9b88be
	rm -f $PEM1 $PEM2
9b88be
done