]> WPIA git - gigi.git/commitdiff
fixup! [Keys] a certificate structure that looks like ...
authorFelix Dörre <felix@dogcraft.de>
Tue, 5 Aug 2014 19:57:15 +0000 (21:57 +0200)
committerFelix Dörre <felix@dogcraft.de>
Tue, 5 Aug 2014 21:30:30 +0000 (23:30 +0200)
keys/generateKeys.sh
keys/selfsign.config

index e316cb6087f98a792a7d84417e96fa3c590da03c..8db18bd545131257846b1b7d5c57078f65de25ab 100755 (executable)
@@ -1,10 +1,10 @@
-#!/bin/bash
+#!/bin/sh
 # this script generates a set of sample keys
 DOMAIN="cacert.local"
 KEYSIZE=4096
 PRIVATEPW="changeit"
 
-[ -f config ] && . config
+[ -f config ] && . ./config
 
 
 rm -Rf *.csr *.crt *.key *.pkcs12 *.ca *.crl
@@ -46,7 +46,7 @@ authorityKeyIdentifier = keyid:always,issuer:always
 TESTCA
 
 
-function genca(){ #subj, internalName
+genca(){ #subj, internalName
 
     openssl genrsa -out $2.key ${KEYSIZE}
     openssl req -new -key $2.key -out $2.csr -subj "$1/O=Test Environment CA Ltd./OU=Test Environment CAs"
@@ -59,17 +59,17 @@ function genca(){ #subj, internalName
 
 }
 
-function caSign(){ # key,ca,config
-    pushd $2.ca
+caSign(){ # key,ca,config
+    cd $2.ca
     openssl ca -cert ../$2.crt -keyfile ../$2.key -in ../$1.csr -out ../$1.crt -days 365 -batch -config ../selfsign.config -extfile ../$3
-    popd
+    cd ..
 }
 
-function rootSign(){ # key
+rootSign(){ # key
     caSign $1 root test_subca.cnf
 }
 
-function genserver(){ #key, subject, config
+genserver(){ #key, subject, config
     openssl genrsa -out $1.key ${KEYSIZE}
     openssl req -new -key $1.key -out $1.csr -subj "$2" -config selfsign.config
     caSign $1 env "$3"
index 2e3ea576c5008bf0dc038babd9e4cd601a9d2cab..134e84a50d797f2ddb053d4f0a31dd0d972c8bbc 100644 (file)
@@ -33,4 +33,4 @@ commonName              = optional
 subjectAltName          = optional
 organizationName       = optional
 organizationalUnitName = optional
-emailAddress           = optional
\ No newline at end of file
+emailAddress           = optional