Use hasX instead of canX to check key capabilities
In these cases we also want expired encryption keys to match. Therefore,
we need to use the new hasX capability queries. For example, canEncrypt()
returns false for an expired key with encryption subkey (if the primary
subkey does not support encryption).
- GnuPG-bug-id: T6743