function __query {
(
cd $KEYS && find -name '*.pub' | sed -e 's/.pub$//' | grep -v decomissioned | while read line; do
- handle="`echo $line | cut -d '/' -f 3`"
- type="`echo $line | cut -d '/' -f 2`"
- echo "$handle ($type)"
+ # See https://security.stackexchange.com/questions/129724/how-to-check-if-an-ssh-private-key-has-passphrase-or-not#129727
+ if grep -q ',ENCRYPTED' $line; then
+ handle="`echo $line | cut -d '/' -f 3`"
+ type="`echo $line | cut -d '/' -f 2`"
+ echo "$handle ($type)"
+ fi
done
)
}