mkclient.sh 746 Bytes
Newer Older
1
#!/bin/sh
Leigh Stoller's avatar
Leigh Stoller committed
2 3 4 5 6
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group.
# All rights reserved.
#
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

prefix=$1

#
# Create a client side private key and certificate request.
#
openssl req -new -config ${prefix}.cnf \
	-keyout ${prefix}_key.pem -out ${prefix}_req.pem
	
#
# Sign the client cert request, creating a client certificate.
#
openssl ca -batch -policy policy_match -config ca.cnf \
	-out ${prefix}_cert.pem \
        -cert cacert.pem -keyfile cakey.pem \
	-infiles ${prefix}_req.pem

#
# Combine the key and the certificate into one file which is installed
# on each remote node and used by tmcc. Installed on boss too so
# we can test tmcc there.
#
cat ${prefix}_key.pem ${prefix}_cert.pem > ${prefix}.pem

exit 0