+KEY=$3
+PEM=$4
+DOMAIN=$5
+
+# Make sure completed certificate does not already exist
+if test -e "$PEM"; then
+ echo "Error: Refusing to overwrite existing certificate at"
+ echo " $PEM."
+ exit 1
+fi
+
+# Make sure that the key and request do exist
+if test ! -f "$REQUEST"; then
+ echo "Error: The given certificate request file does not exist."
+ exit 1
+fi
+if test ! -f "$KEY"; then
+ echo "Error: The given key file does not exist."
+ exit 1
+fi