mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
check-certificates: include SANs in information
This commit is contained in:
parent
706e4de6d1
commit
4073daa139
2 changed files with 11 additions and 0 deletions
|
@ -38,9 +38,20 @@
|
|||
:return [ $CharacterReplace [ $CharacterReplace [ :tostr $1 ] "w" "w " ] "d" "d " ];
|
||||
}
|
||||
|
||||
:local FormatSANs do={
|
||||
:local SANs $1;
|
||||
:local Return "";
|
||||
|
||||
:foreach SAN in=$SANs do={
|
||||
:set Return ($Return . "\n " . $SAN);
|
||||
}
|
||||
:return $Return;
|
||||
}
|
||||
|
||||
:return ( \
|
||||
"Name: " . ($CertVal->"name") . "\n" . \
|
||||
[ $IfThenElse ([ :len ($CertVal->"common-name") ] > 0) ("CommonName: " . ($CertVal->"common-name") . "\n") ] . \
|
||||
[ $IfThenElse ([ :len ($CertVal->"subject-alt-name") ] > 0) ("SubjectAltNames:" . [ $FormatSANs ($CertVal->"subject-alt-name") ] . "\n") ] . \
|
||||
"Private key: " . [ $IfThenElse (($CertVal->"private-key") = true) "available" "missing" ] . "\n" . \
|
||||
"Fingerprint: " . ($CertVal->"fingerprint") . "\n" . \
|
||||
"Issuer: " . ($CertVal->"ca") . ([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN") . "\n" . \
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue