pgpy decrypt files

Asked

Viewed 53 times

0

I’m trying to decrypt a gpg file with the pgpy library in python 3.7, but I can’t get the Output file of the description, follow the code:

import pgpy

efile = pgpy.PGPMessage.from_file('Path do arquivo criptografado')
key,_  = pgpy.PGPKey.from_file('Path da chave privada')
with key.unlock('Senha'):
    file = key.decrypt(efile)

How do I turn this variable into a file on disk?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.