diff options
Diffstat (limited to 'signcsr.sh')
-rwxr-xr-x | signcsr.sh | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -28,7 +28,13 @@ fi # Gen signed key mkdir -pv "$CA"/signed "$CA"/temp "$CA"/certs SERIAL=$(cat "$CA"/ca/"$CA".serial) -openssl ca -config "$OPENSSL_CONFIG" -in "$1" + +if [[ "$1" =~ \.spkac$ ]]; then # SPKAC HTML5 <keygen> standard + openssl ca -config "$OPENSSL_CONFIG" -spkac "$1" -notext +else # x509 CSR + openssl ca -config "$OPENSSL_CONFIG" -in "$1" +fi + if [ -e "$CA"/certs/"$SERIAL".pem ]; then # openssl lacks useful exit status codes, so we check to see if it actually did anything instead. mv -i "$1" "$CA"/signed/$NAME.csr ln "$CA"/certs/"$SERIAL".pem "$CA"/signed/"$NAME".crt # so we can find the certificate by name as well as serial |