CA.pl (59191) | CA.pl (68651) |
---|---|
1#!/usr/local/bin/perl 2# 3# CA - wrapper around ca to make it easier to use ... basically ca requires 4# some setup stuff to be done before you can use it and this makes 5# things easier between now and when Eric is convinced to fix it :-) 6# 7# CA -newca ... will setup the right stuff 8# CA -newreq ... will generate a certificate request --- 22 unchanged lines hidden (view full) --- 31# 32# 33# Steve Henson 34# shenson@bigfoot.com 35 36# default openssl.cnf file has setup as per the following 37# demoCA ... where everything is stored 38 | 1#!/usr/local/bin/perl 2# 3# CA - wrapper around ca to make it easier to use ... basically ca requires 4# some setup stuff to be done before you can use it and this makes 5# things easier between now and when Eric is convinced to fix it :-) 6# 7# CA -newca ... will setup the right stuff 8# CA -newreq ... will generate a certificate request --- 22 unchanged lines hidden (view full) --- 31# 32# 33# Steve Henson 34# shenson@bigfoot.com 35 36# default openssl.cnf file has setup as per the following 37# demoCA ... where everything is stored 38 |
39$SSLEAY_CONFIG=$ENV{"SSLEAY_CONFIG"}; |
|
39$DAYS="-days 365"; 40$REQ="openssl req $SSLEAY_CONFIG"; 41$CA="openssl ca $SSLEAY_CONFIG"; 42$VERIFY="openssl verify"; 43$X509="openssl x509"; 44$PKCS12="openssl pkcs12"; 45 46$CATOP="./demoCA"; --- 64 unchanged lines hidden (view full) --- 111 } elsif (/^-xsign$/) { 112 system ("$CA -policy policy_anything -infiles newreq.pem"); 113 $RET=$?; 114 } elsif (/^(-sign|-signreq)$/) { 115 system ("$CA -policy policy_anything -out newcert.pem " . 116 "-infiles newreq.pem"); 117 $RET=$?; 118 print "Signed certificate is in newcert.pem\n"; | 40$DAYS="-days 365"; 41$REQ="openssl req $SSLEAY_CONFIG"; 42$CA="openssl ca $SSLEAY_CONFIG"; 43$VERIFY="openssl verify"; 44$X509="openssl x509"; 45$PKCS12="openssl pkcs12"; 46 47$CATOP="./demoCA"; --- 64 unchanged lines hidden (view full) --- 112 } elsif (/^-xsign$/) { 113 system ("$CA -policy policy_anything -infiles newreq.pem"); 114 $RET=$?; 115 } elsif (/^(-sign|-signreq)$/) { 116 system ("$CA -policy policy_anything -out newcert.pem " . 117 "-infiles newreq.pem"); 118 $RET=$?; 119 print "Signed certificate is in newcert.pem\n"; |
120 } elsif (/^(-signCA)$/) { 121 system ("$CA -policy policy_anything -out newcert.pem " . 122 "-extensions v3_ca -infiles newreq.pem"); 123 $RET=$?; 124 print "Signed CA certificate is in newcert.pem\n"; |
|
119 } elsif (/^-signcert$/) { 120 system ("$X509 -x509toreq -in newreq.pem -signkey newreq.pem " . 121 "-out tmp.pem"); 122 system ("$CA -policy policy_anything -out newcert.pem " . 123 "-infiles tmp.pem"); 124 $RET = $?; 125 print "Signed certificate is in newcert.pem\n"; 126 } elsif (/^-verify$/) { --- 36 unchanged lines hidden --- | 125 } elsif (/^-signcert$/) { 126 system ("$X509 -x509toreq -in newreq.pem -signkey newreq.pem " . 127 "-out tmp.pem"); 128 system ("$CA -policy policy_anything -out newcert.pem " . 129 "-infiles tmp.pem"); 130 $RET = $?; 131 print "Signed certificate is in newcert.pem\n"; 132 } elsif (/^-verify$/) { --- 36 unchanged lines hidden --- |