refactoring of gpg-key parsing