2 # This should be sourced by bash (though we welcome changes to make it POSIX sh compliant)
4 # Monkeysphere host import-key subcommand
6 # The monkeysphere scripts are written by:
7 # Jameson Rollins <jrollins@finestructure.net>
8 # Jamie McClelland <jm@mayfirst.org>
9 # Daniel Kahn Gillmor <dkg@fifthhorseman.net>
11 # They are Copyright 2008-2009 and are all released under the GPL,
19 hostName=${1:-$(hostname -f)}
21 userID="ssh://${hostName}"
24 mkdir -p "$GNUPGHOME_HOST"
25 chmod 700 "$GNUPGHOME_HOST"
27 log verbose "importing ssh key..."
28 # translate ssh key to a private key
29 PEM2OPENPGP_USAGE_FLAGS=authenticate pem2openpgp "$userID" | \
32 # load the new host fpr into the fpr variable
33 load_fingerprint_secret
35 # export to gpg public key to file
38 # show info about new key