+# output the key info, including the RSA fingerprint
+show_key_info() {
+ local keyid="$1"
+ local sshKeyGPGFile
+ local sshFingerprint
+ local gpgSigOut
+ local otherUids
+
+ # get the ssh key of the gpg key
+ sshKeyGPGFile=$(msmktempfile)
+ gpg2ssh "$keyid" >"$sshKeyGPGFile"
+ sshFingerprint=$(ssh-keygen -l -f "$sshKeyGPGFile" | \
+ awk '{ print $2 }')
+ rm -f "$sshKeyGPGFile"
+
+ # get the sigs for the matching key
+ gpgSigOut=$(gpg_user --check-sigs \
+ --list-options show-uid-validity \
+ "$keyid")
+
+ echo | log info
+
+ # output the sigs, but only those on the user ID
+ # we are looking for
+ echo "$gpgSigOut" | awk '
+{
+if (match($0,"^pub")) { print; }
+if (match($0,"^uid")) { ok=0; }
+if (match($0,"^uid.*'$userID'$")) { ok=1; print; }
+if (ok) { if (match($0,"^sig")) { print; } }
+}
+'
+
+ # output ssh fingerprint
+ cat <<EOF
+RSA key fingerprint is ${sshFingerprint}.
+EOF
+
+ # output the other user IDs for reference
+ otherUids=$(echo "$gpgSigOut" | grep "^uid" | grep -v "$userID")
+ if [ "$otherUids" ] ; then
+ log info <<EOF
+Other user IDs on this key:
+EOF
+ echo "$otherUids" | log info
+ fi
+
+}
+