global-functions: split off $FormatMultiLines ...

... to format multiple lines from an array.
This commit is contained in:
Christian Hesse 2023-09-15 22:50:32 +02:00
parent 557823c5c1
commit 4ddc6be585
2 changed files with 23 additions and 8 deletions

View file

@ -78,6 +78,7 @@
:local CertVal $1;
:global FormatLine;
:global FormatMultiLines;
:global IfThenElse;
:global ParseKeyValueStore;
@ -89,7 +90,7 @@
:return ( \
[ $FormatLine "Name" ($CertVal->"name") ] . "\n" . \
[ $IfThenElse ([ :len ($CertVal->"common-name") ] > 0) ([ $FormatLine "CommonName" ($CertVal->"common-name") ] . "\n") ] . \
[ $IfThenElse ([ :len ($CertVal->"subject-alt-name") ] > 0) ([ $FormatLine "SubjectAltNames" ($CertVal->"subject-alt-name") ] . "\n") ] . \
[ $IfThenElse ([ :len ($CertVal->"subject-alt-name") ] > 0) ([ $FormatMultiLines "SubjectAltNames" ($CertVal->"subject-alt-name") ] . "\n") ] . \
[ $FormatLine "Private key" [ $IfThenElse (($CertVal->"private-key") = true) "available" "missing" ] ] . "\n" . \
[ $FormatLine "Fingerprint" ($CertVal->"fingerprint") ] . "\n" . \
[ $FormatLine "Issuer" ($CertVal->"ca" . ([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN")) ] . "\n" . \