From 4924928d5ee16ada0a9dad0d3f78639680fbc800 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20D=C3=B6rre?= Date: Tue, 5 Aug 2014 21:57:15 +0200 Subject: [PATCH] fixup! [Keys] a certificate structure that looks like ... --- keys/generateKeys.sh | 16 ++++++++-------- keys/selfsign.config | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/keys/generateKeys.sh b/keys/generateKeys.sh index e316cb60..8db18bd5 100755 --- a/keys/generateKeys.sh +++ b/keys/generateKeys.sh @@ -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" diff --git a/keys/selfsign.config b/keys/selfsign.config index 2e3ea576..134e84a5 100644 --- a/keys/selfsign.config +++ b/keys/selfsign.config @@ -33,4 +33,4 @@ commonName = optional subjectAltName = optional organizationName = optional organizationalUnitName = optional -emailAddress = optional \ No newline at end of file +emailAddress = optional -- 2.39.2