Skip to content

Instantly share code, notes, and snippets.

@dweinstein
Created August 23, 2013 14:06
Show Gist options
  • Save dweinstein/6319690 to your computer and use it in GitHub Desktop.
Save dweinstein/6319690 to your computer and use it in GitHub Desktop.
little script to generate client cert (based on http://qemu.weilnetz.de/qemu-doc.html#vnc_005fsecurity)
#!/usr/bin/env bash
client_dir=client-$1
if [ -z $1 ]; then
echo "must pass the client name"
exit
fi
if [ ! -d $1 ]; then
mkdir $client_dir
fi
pushd .
cd $client_dir
read -p "edit the client info template, ok?"
vi ../client.info
certtool --sec-param high \
--generate-privkey > client-key.pem
certtool --generate-certificate \
--load-ca-certificate ../ca-cert.pem \
--load-ca-privkey ../ca-key.pem \
--load-privkey client-key.pem \
--template ../client.info \
--outfile client-cert.pem
cp ../server-cert.pem .
popd
zip -r ${client_dir}.zip ${client_dir}
echo "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment