- # NOTE: we supress this warning because we need the monkeysphere
- # user to be able to read the host pubring. we realize this might
- # be problematic, but it's the simplest solution, without too much
- # loss of security.
- gpg "$@"
+}
+
+# command for edit key scripts, takes scripts on stdin
+gpg_host_edit() {
+ gpg_host --quiet --command-fd 0 --edit-key \
+ "0x${HOST_FINGERPRINT}!" "$@"
+}
+
+# export the host key to stdout
+gpg_host_export() {
+ gpg_host --export --armor --export-options export-minimal \
+ "0x${HOST_FINGERPRINT}!"
+}
+
+# export the host key to the monkeysphere host file key
+gpg_host_export_to_ssh_file() {
+ log debug "exporting openpgp public key..."
+ gpg_host_export > "${MHDATADIR}/ssh_host_rsa_key.pub.gpg"
+ log info "SSH host public key in OpenPGP form: ${MHDATADIR}/ssh_host_rsa_key.pub.gpg"