factorize/ca

This commit is contained in:
Marc Beninca 2024-09-03 18:11:51 +02:00
parent f54b515115
commit 095b343fde
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 15 additions and 22 deletions

View file

@ -230,7 +230,6 @@ Handle project workflows in a unified way:
* available * available
* effective * effective
* factorize * factorize
* ca
* dns * dns
* locales * locales
* handle errors * handle errors

View file

@ -200,33 +200,27 @@ _spcd_txt_pick() {
# ╰───────────╯ # ╰───────────╯
spcd_ca() { spcd_ca() {
local index name value
local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)" local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)"
case "${1}" in local index name value
"list") local root="${2}"
while true; do while true; do
index=$((index + 1)) index=$((index + 1))
name="SPCD_CA_${index}" name="SPCD_CA_${index}"
eval "value=\"\${${name}}\"" eval "value=\"\${${name}}\""
[ -n "${value}" ] || break [ -n "${value}" ] || break
case "${1}" in
"list")
echo "${name} =" echo "${name} ="
echo "${value}" | echo "${value}" |
openssl x509 -noout -text | openssl x509 -noout -text |
grep "${grep}" grep "${grep}"
done ;;
;; "write")
"write")
local root="${2}"
while true; do
index=$((index + 1))
name="SPCD_CA_${index}"
eval "value=\"\${${name}}\""
[ -n "${value}" ] || break
spcd_os_write "${root}/${index}.crt" "${value}" spcd_os_write "${root}/${index}.crt" "${value}"
done ;;
;; *) ;;
*) ;; esac
esac done
} }
spcd_dns() { spcd_dns() {