summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2010-01-19 01:36:32 -0500
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2010-01-19 01:36:32 -0500
commit3a26707c0db3e33b5e244c4da9705ef213560750 (patch)
treea4cfb411d09eba7e12b7c9bd5034a33a7fd40a59 /src
parentc464b0782eb75ed293ffbe56ad8ed41122cf4c7b (diff)
add get_cert_info() to common
Diffstat (limited to 'src')
-rw-r--r--src/share/common12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/share/common b/src/share/common
index 0a7fe87..039c06c 100644
--- a/src/share/common
+++ b/src/share/common
@@ -1207,6 +1207,18 @@ list_primary_fingerprints() {
rm -rf "$fake"
}
+# takes an OpenPGP key or set of keys on stdin, a fingerprint or other
+# key identifier as $1, and outputs the gpg-formatted information for
+# the requested keys from the material on stdin
+get_cert_info() {
+ local fake=$(msmktempdir)
+ trap "rm -rf $fake" EXIT
+ GNUPGHOME="$fake" gpg --no-tty --quiet --import
+ GNUPGHOME="$fake" gpg --with-colons --fingerprint --list-keys "$1"
+ trap - EXIT
+ rm -rf "$fake"
+}
+
check_cruft_file() {
local loc="$1"