summaryrefslogtreecommitdiff
path: root/src/share/common
diff options
context:
space:
mode:
authorJameson Graef Rollins <jrollins@finestructure.net>2009-02-19 01:20:44 -0500
committerJameson Graef Rollins <jrollins@finestructure.net>2009-02-19 01:20:44 -0500
commit4238a891582ba6c62fc062d24734536d029eb33a (patch)
tree3fdd00ef2a40b8d5745f0494955c719f111aaf88 /src/share/common
parent4465c13b93d3d4bc1cb59c5506775b4fc0274058 (diff)
parentdd1914ec0225cca711508dfd1351502040b6ec87 (diff)
Merge commit 'dkg/master'
Diffstat (limited to 'src/share/common')
-rw-r--r--src/share/common11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/share/common b/src/share/common
index 96fea77..d185fdd 100644
--- a/src/share/common
+++ b/src/share/common
@@ -1144,3 +1144,14 @@ process_authorized_user_ids() {
update_authorized_keys "${userIDs[@]}"
}
+
+# takes a gpg key or keys on stdin, and outputs a list of
+# fingerprints, one per line:
+list_primary_fingerprints() {
+ local file="$1"
+ local fake=$(msmktempdir)
+ GNUPGHOME="$fake" gpg --no-tty --quiet --import
+ GNUPGHOME="$fake" gpg --with-colons --fingerprint --list-keys | \
+ awk -F: '/^fpr:/{ print $10 }'
+ rm -rf "$fake"
+}