summaryrefslogtreecommitdiff
path: root/bin/pgp-list-keyids
blob: 1807faa92e2ed2f62ee912f847e584435b49c793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env ruby
# Usage: pgp-list-keyids

load "#{File.dirname(__FILE__)}/common.rb"

load_all_users.each do |user|
	if user["groups"]
		if user["groups"].include?("keyring-trusted")
			puts "trusted/#{user["username"]} #{user["pgp_keyid"]}"
		elsif user["groups"].include?("keyring-secondary")
			puts "secondary/#{user["username"]} #{user["pgp_keyid"]}"
		elsif user["pgp_keyid"]
			puts "revoked/#{user["username"]} #{user["pgp_keyid"]}"
		end
	end
	if user["pgp_revoked_keyids"]
		user["pgp_revoked_keyids"].each do |keyid|
			puts "revoked/#{user["username"]} #{keyid}"
		end
	end
end