Output gpg information about host's OpenPGP key. `s' may be used in
place of `show-key'.
.TP
-.B fingerprint
-Output just the fingerprint for the host's OpenPGP key. `f' may be
-used in place of `fingerprint'.
-.TP
.B publish-key
Publish the host's OpenPGP key to the keyserver. `p' may be used in
place of `publish-key'.
add-hostname (n+) NAME[:PORT] add hostname user ID to server key
revoke-hostname (n-) NAME[:PORT] revoke hostname user ID
show-key (s) output all server host key information
- fingerprint (f) output just the key fingerprint
publish-key (p) publish server host key to keyserver
diagnostics (d) report on server monkeysphere status
# output key information
show_server_key() {
local fingerprint
+ local tmpkey
+
fingerprint=$(fingerprint_server_key)
- gpg_host --fingerprint --list-secret-key "$fingerprint"
+ gpg_authentication "--fingerprint --list-key $fingerprint"
+
+ # dumping to a file named ' ' so that the ssh-keygen output
+ # doesn't claim any potentially bogus hostname(s):
+ tmpkey=$(mktemp -d)
+ gpg_authentication "--export $fingerprint" | openpgp2ssh "$fingerprint" 2>/dev/null > "$tmpkey/ "
+ echo -n "ssh fingerprint: "
+ (cd "$tmpkey" && ssh-keygen -l -f ' ')
+ rm -rf "$tmpkey"
+ echo -n "OpenPGP fingerprint: "
+ echo "$fingerprint"
}
# update authorized_keys for users
show_server_key
;;
- 'show-fingerprint'|'fingerprint'|'f')
- fingerprint_server_key
- ;;
-
'publish-key'|'publish'|'p')
publish_server_key
;;