Added OpenPGP key support and refactored