e37485ead6bbba2e0ac2455c98c14361ea1f674b
[monkeysphere.git] / src / subcommands / ma / list-certifiers
1 # -*-shell-script-*-
2 # This should be sourced by bash (though we welcome changes to make it POSIX sh compliant)
3
4 # Monkeysphere authentication list-certifiers subcommand
5 #
6 # The monkeysphere scripts are written by:
7 # Jameson Rollins <jrollins@fifthhorseman.net>
8 # Jamie McClelland <jm@mayfirst.org>
9 # Daniel Kahn Gillmor <dkg@fifthhorseman.net>
10 #
11 # They are Copyright 2008-2009, and are all released under the GPL,
12 # version 3 or later.
13
14 # list the host certifiers
15
16 list_certifiers() {
17
18 local keys
19 local key
20
21 # find trusted keys in authentication keychain
22 keys=$(gpg_sphere "--no-options --list-options show-uid-validity --keyring ${GNUPGHOME_AUTHENTICATION}/pubring.gpg --list-keys --with-colons --fingerprint" | \
23     grep ^pub: | cut -d: -f2,5 | egrep '^(u|f):' | cut -d: -f2)
24
25 # output keys
26 for key in $keys ; do
27     gpg_sphere "--no-options --list-options show-uid-validity --keyring ${GNUPGHOME_AUTHENTICATION}/pubring.gpg --list-key --fingerprint $key"
28 done
29
30 }