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... "
28 idchars=$(echo $GPGID | wc -m)
29 if [ "$idchars" -ne 17 ] ; then
30 echo "GPGID is not 16 characters ($idchars)."
36 gpg --export-secret-key --export-options export-reset-subkey-passwd $GPGID | GNUPGHOME=$FOO gpg --import
38 GNUPGHOME=$FOO gpg --edit-key $GPGID
40 GNUPGHOME=$FOO gpg --export-secret-key $GPGID | openpgp2ssh $GPGID | ssh-add -c /dev/stdin