Revert "Revert "Add possibility to filter out invalid keys""

This reverts commit aeb2f056 but
does it in a way that it still works with older GPGME Versions.
2 jobs for master
Status Job ID Name Coverage
  Build
canceled #76155
build_clazy_clang_tidy

canceled #76154
linux kf5-qt5 qt5.12