3 # seckey2sshagent: this is a hack of a script to cope with the fact
4 # that openpgp2ssh currently cannot support encrypted secret keys.
6 # the basic operating principal is:
8 # export the secret key in encrypted format to a new keyring
10 # remove the passphrase in that keyring
12 # use that keyring with openpgp2ssh
14 # Authors: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
15 # Jameson Rollins <jrollins@fifthhorseman.net>
19 echo -n "removing temp gpg home... " 1>&2
27 GPGID=$(echo "$1" | cut -c 25-)
31 gpg --export-secret-key $GPGID | GNUPGHOME="$FOO" gpg --import
33 # idea to script the password stuff. not working.
34 # read -s -p "enter gpg password: " PASSWD; echo
45 # echo -e "$cmd" | GNUPGHOME="$FOO" gpg --command-fd 0 --edit-key $GPGID
47 GNUPGHOME="$FOO" gpg --edit-key $GPGID
49 ln -s /dev/stdin "$FOO"/openpgp
51 GNUPGHOME="$FOO" gpg --export-secret-key $GPGID | \
52 openpgp2ssh $GPGID | ssh-add -c "$FOO"/openpgp