2 # This should be sourced by bash (though we welcome changes to make it POSIX sh compliant)
4 # Monkeysphere import-subkey 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,
14 # import an existing ssh key as a gpg subkey
17 local keyFile="~/.ssh/id_rsa"
35 if [ "$(echo "$1" | cut -c 1)" = '-' ] ; then
36 failure "Unknown option '$1'.
37 Type '$PGRM help' for usage."
44 log verbose "importing ssh key..."
45 fifoDir=$(msmktempdir)
46 (umask 077 && mkfifo "$fifoDir/pass")
47 ssh2openpgp | gpg --passphrase-fd 3 3< "$fifoDir/pass" --expert --command-fd 0 --import &
49 passphrase_prompt "Please enter your passphrase for $keyID: " "$fifoDir/pass"