isislovecruft / python-gnupg

A modified version of python-gnupg, including security patches, extensive documentation, and extra features.
Other
424 stars 172 forks source link

encrypt() doesn't work #232

Closed Lvl4Sword closed 6 years ago

Lvl4Sword commented 6 years ago
import gnupg
gpg = gnupg.GPG(gnupghome='/home/user/.gnupg')
print(gpg.encrypt('TEST', 'KEY_ID').data)
''

Am I doing something wrong here? KEY_ID is gpg.list_keys()[0]['fingerprint']

Lvl4Sword commented 6 years ago

Rather stupid on my part. .stderr rather than .data gave me "There is no assurance this key belongs to the named user", so I fixed this with the following:

gpg --edit-key <KEY_ID>
gpg> trust