-
- # get list of secret keys (to work around bug
- # https://bugs.g10code.com/gnupg/issue945):
- secretkeys=$(gpg_user --list-secret-keys --with-colons --fixed-list-mode \
- --fingerprint | \
- grep '^fpr:' | cut -f10 -d: | awk '{ print "0x" $1 "!" }')
-
- if [ -z "$secretkeys" ]; then
- failure "You have no secret keys in your keyring!
+
+ # if the MONKEYSPHERE_SUBKEYS_FOR_AGENT variable is set, use the
+ # keys specified there
+ if [ "$MONKEYSPHERE_SUBKEYS_FOR_AGENT" ] ; then
+ authsubkeys="$MONKEYSPHERE_SUBKEYS_FOR_AGENT"
+
+ # otherwise find all authentication-capable subkeys and use those
+ else
+ # get list of secret keys
+ # (to work around bug https://bugs.g10code.com/gnupg/issue945):
+ secretkeys=$(gpg_user --list-secret-keys --with-colons --fixed-list-mode \
+ --fingerprint | \
+ grep '^fpr:' | cut -f10 -d: | awk '{ print "0x" $1 "!" }')
+
+ if [ -z "$secretkeys" ]; then
+ failure "You have no secret keys in your keyring!