Permalink
Browse files

-signCA got parameters -file -out -name -policy

-signCA's behaiviour can now be modified with -file=<filename> to change
from the default input file, -out=<filename> to move the default output
filename, -name=<prefix> modifies the default filenames for input and
output where they are unspecified, -policy=<section> determines which
policy to use and defaults to policy_anything when unspecified.
  • Loading branch information...
CarbonLifeForm committed Dec 13, 2011
1 parent de5735b commit 607d1679fd4459542def1462ce9a1ed00d557cf0
Showing with 19 additions and 3 deletions.
  1. +19 −3 CA.sh
View
22 CA.sh
@@ -274,12 +274,28 @@ case $1 in
RET=$?
cat $outfile
echo "Signed certificate is in $outfile"
- unset polset infile fileprefix outfile
+ unset polset infile fileprefix outfile ext
;;
-signCA)
- $CA -policy policy_anything -out newcert.pem -extensions v3_ca -infiles newreq.pem
+ until (is_mode $2)
+ do
+ shift
+ case $1 in
+ -policy=*) polset="${1#-*=}"
+ ;;
+ -out=*) outfile="${1#-*=}"
+ ;;
+ -file=*) infile="${1#-*=}"
+ ;;
+ -name=*) fileprefix="${1#-*=}"
+ ;;
+ esac
+ done
+
+ $CA -policy ${polset:-policy_anything} -out ${outfile:=${fileprefix:-new}cert.pem} -extensions v3_ca -infiles ${infile:-${fileprefix:-new}req.pem}
RET=$?
- echo "Signed CA certificate is in newcert.pem"
+ echo "Signed CA certificate is in $outfile"
+ unset polset outfile infile fileprefix
;;
-signcert)
echo "Cert passphrase will be requested twice - bug?"

0 comments on commit 607d167

Please sign in to comment.