gpg: Use higher-level functions.