:
# NAME:
#	mkcert - generate a signed certificate
#
# SYNOPSIS:
#	mkcert [-nodes][-keybits "bits"]
#
# DESCRIPTION:
#	This script runs req, to produce a certificate request file,
#	and a private key, then calls ca to sign it, and finally
#	outputs the issued certificat and private key to stdout.
#
# SEE ALSO:
#	SSLeay FAQ.
#
# AUTHOR:
#	Simon J. Gerraty <sjg@quick.com.au>
#

# RCSid:
#	$Id: mkcert,v 1.5 1997/04/19 03:26:35 sjg Exp $
#
#	@(#) Copyright (c) 1996 Simon J. Gerraty
#
#	This file is provided in the hope that it will
#	be of use.  There is absolutely NO WARRANTY.
#	Permission to copy, redistribute or otherwise
#	use this file is hereby granted provided that 
#	the above copyright notice and this notice are
#	left intact. 
#      
#	Please send copies of changes and bug-fixes to:
#	sjg@quick.com.au
#

umask 077
TF=/tmp/cr$$
/usr/local/ssl/bin/req -new -keyout $TF.key -out $TF.req $* &&
/usr/local/ssl/bin/ca -verbose -in $TF.req -out $TF.cert &&
cat $TF.cert $TF.key | sed -n '/BEGIN/,$p' 
rm -f $TF.*

