cfg/bin/list_gpg_trust
Knut Ahlers 92e66d42e0
Add GPG management scripts
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-08-17 11:52:10 +02:00

21 lines
494 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
trustmap=(
"unused"
"unused"
"I don't know or won't say"
"I do NOT trust"
"I trust marginally"
"I trust fully"
"I trust ultimately"
)
for trust in $(gpg --export-ownertrust | grep '^[^#]'); do
fp=$(echo "${trust}" | cut -d : -f 1)
score=$(echo "${trust}" | cut -d : -f 2)
echo "# $(gpg --list-keys "${fp}" 2>/dev/null | grep ^uid | head -n1 | sed -E 's/^uid\s+\[[a-z ]+\] //' || echo "Key / UID not found") (${trustmap[score]})"
echo "${trust}"
done