I have a Public shared to me and I'm loading it as shown below:
key_path = os.environ.get('ESB_FILES_PUBLIC_KEY')
key, _ = pgpy.PGPKey.from_file(key_path)
I try to decrypt the file using this key
message_from_file = pgpy.PGPMessage.from_file(filepath)
raw_message = key.decrypt(message_from_file).message
print(raw_message)
It doesn't work and I get this error instead pgpy.errors.PGPError: Expected: is_public == False. Got: True
Any idea on how to decrypt an PGP file in Python with only the Public Key. For reference: I'm currently using this library https://pgpy.readthedocs.io/en/latest/examples.html.
Thanks