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
* effective
* factorize
* ca
* dns
* locales
* handle errors

View file

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