#!/bin/bash # Support intermediate CAs PREFIX="" if [ -n "${1}" ]; then if [ ! -d "${1}" ]; then echo "Intermediate CA directory does not exist: ${1}" 1>&2 exit 1 fi echo "Using intermediate CA: ${1}" PREFIX="${1}/" fi export CA_DIR="." # Sign openssl ca -config "${CONF}" -policy "${INTER_POLICY}" -extensions "${INTER_CA_EXT}" \ -days "${DAYS}" -notext \ -in "${CERT}.csr" -out "${CERT}"