- fingerprint_server_key >/dev/null \
- || failure "You don't appear to have a Monkeysphere host key on this server. Please run 'monkeysphere-server gen-key' first."
+ fingerprint_host_key >/dev/null \
+ || failure "You don't appear to have a Monkeysphere host key on this server. Please run 'monkeysphere-host import-key' first."
+}
+
+# show info about the host key
+show_key() {
+ local fingerprintPGP
+ local fingerprintSSH
+
+ # FIXME: you shouldn't have to be root to see the host key fingerprint
+ check_host_keyring
+ fingerprintPGP=$(fingerprint_host_key)
+
+ gpg_host --fingerprint --list-key --list-options show-unusable-uids "0x${fingerprintPGP}!" 2>/dev/null
+ echo "OpenPGP fingerprint: $fingerprintPGP"
+
+ if [ -f "${MHDATADIR}/ssh_host_rsa_key.pub" ] ; then
+ fingerprintSSH=$(ssh-keygen -l -f "${MHDATADIR}/ssh_host_rsa_key.pub" | \
+ awk '{ print $1, $2, $4 }')
+ echo "ssh fingerprint: $fingerprintSSH"
+ else
+ log info "SSH host key not found."
+ fi
+
+ # FIXME: show expiration date
+ # FIXME: other relevant key parameters?