example: encrypt file

* Fixed typo in second encryption call.
This commit is contained in:
Ben McGinnes 2018-03-20 09:39:48 +11:00
parent 7ab42e79ad
commit f0790f224d

View File

@ -58,7 +58,7 @@ with gpg.Context(armor=True) as ca:
fa.write(ciphertext) fa.write(ciphertext)
with gpg.Context() as cg: with gpg.Context() as cg:
ciphertext, result, sign_result = ca.encrypt(text, recipients=rkey, ciphertext, result, sign_result = cg.encrypt(text, recipients=rkey,
sign=False) sign=False)
with open("{0}.gpg".format(filename), "wb") as fg: with open("{0}.gpg".format(filename), "wb") as fg:
fg.write(ciphertext) fg.write(ciphertext)