- # export the new key to the host keyring
- log verbose "loading key $keyID..."
- su_monkeysphere_user "GNUPGHOME=$TMPLOC gpg --quiet --export 0x${keyID}!" \
- | gpg_host --import
-fi
-
-# get the full fingerprint of new revoker key
-log debug "getting fingerprint of revoker key..."
-fingerprint=$(gpg_host --list-key --with-colons --with-fingerprint "0x${keyID}!" \
- | grep '^fpr:' | grep "$keyID" | cut -d: -f10)
-
-if [ -z "$fingerprint" ] ; then
- failure "Key '$keyID' not found."
-fi
-
-log info "key found:"
-gpg_host --fingerprint "0x${fingerprint}!"
+ # get the full fingerprint of new revoker key
+ log debug "getting fingerprint of revoker key..."
+ fingerprint=$(su_monkeysphere_user "GNUPGHOME=$tmpDir gpg --list-key --with-colons --with-fingerprint 0x${keyID}!" \
+ | grep '^fpr:' | cut -d: -f10)
+
+ # test that there is only a single fingerprint
+ if (( $(echo "$fingerprint" | wc -l) != 1 )) ; then
+ cat <<EOF
+More than one fingerprint found:
+$fingerprint
+Please use a more specific key ID.
+EOF
+ failure
+ fi