GPGKey creates a new, temporary GPG home directory and a public/private key pair. It returns the GPG home directory, the ID of the created key, and a cleanup function to be called after the caller is finished with this key. Since GPG uses /dev/random, this may block while waiting for entropy to become available.
ImportGPGKey imports a gpg key into a temporary home directory. It returns the gpg home directory and a cleanup function to be called after the caller is finished with this key.