summaryrefslogtreecommitdiff
path: root/src/share/ma/list_certifiers
blob: d8b8f339bf7bdf1cbd9ef49e265a2a17c2db7147 (plain)
  1. # -*-shell-script-*-
  2. # This should be sourced by bash (though we welcome changes to make it POSIX sh compliant)
  3. # Monkeysphere authentication list-certifiers subcommand
  4. #
  5. # The monkeysphere scripts are written by:
  6. # Jameson Rollins <jrollins@fifthhorseman.net>
  7. # Jamie McClelland <jm@mayfirst.org>
  8. # Daniel Kahn Gillmor <dkg@fifthhorseman.net>
  9. #
  10. # They are Copyright 2008-2009, and are all released under the GPL,
  11. # version 3 or later.
  12. # list the host certifiers
  13. list_certifiers() {
  14. local keys
  15. local key
  16. # find trusted keys in sphere keychain
  17. log debug "finding trusted keys..."
  18. # NOTE: looking for only 'f' keys here (used to be '(u|f)'), since the
  19. # only key that should be 'u' is the core key, which is not
  20. # technically a certifier in the sense we're worried about. Is this
  21. # not correct? Should we be sorting out the certifier keys in a
  22. # different way?
  23. keys=$(gpg_sphere "--list-keys --with-colons --fingerprint" | \
  24. grep ^pub: | cut -d: -f2,5 | egrep '^f:' | cut -d: -f2)
  25. # output keys
  26. for key in $keys ; do
  27. gpg_sphere "--list-key --fingerprint 0x${key}!"
  28. done
  29. }