if [ -e intermediate.serial ]; then
((SERIAL=`cat intermediate.serial` + 1))
else
- SERIAL=1
+ SERIAL=$(date +%s)
fi
echo $SERIAL > intermediate.serial
DIR=intermediate_$SERIAL
chmod 700 $DIR/private
chmod 755 $DIR/certs $DIR/newcerts
touch $DIR/index.txt
+echo "unique_subject = no" > $DIR/index.txt.attr
+
if [ ! -e $DIR/serial ]; then
echo '01' > $DIR/serial
fi
$PASSPHRASE
EOF
- chmod 400 $DIR/private/$CN.key
+ chmod 400 $DIR/private/ca.key
openssl req -verify -text -noout -in $DIR/$CN.csr
# Sign it
openssl ca -config openssl.conf -extensions v3_intermediate_ca \
-days 1826 \
- -cert certs/ca.crt -keyfile private/ca.key -out $DIR/certs/ca.crt \
+ -cert certs/ca.crt -keyfile private/ca.key -out $DIR/certs/ca.crt \
-infiles $DIR/$CN.csr
- openssl x509 -text -noout -in $DIR/certs/ca.crt
-
+ openssl x509 -text -noout -in $DIR/certs/ca.crt
- openssl verify -CAfile certs/ca.crt $DIR/certs/ca.crt
+ openssl verify -CAfile certs/ca.crt $DIR/certs/ca.crt
# Create a Signer p12 script