Help with python library

Ben McGinnes ben at adversary.org
Mon Mar 5 00:05:30 CET 2018


On Thu, Mar 01, 2018 at 05:33:32PM +0100, Marcel Fest wrote:
> Hey all,
> 
> I use ArchLinux and the latest gpg python library from gnupg.org
> 
> Is their a function like 
>     gpg --list-packets --list-only path/to/file
> 
> in the python library?
> I need this information at the moment to verify if a file is correctly encrypted.
> This will be checked against our ldap and our ansible repository.

Do you mean you need to check whether a file you are encrypting has
been encrypted correctly or do you mean you need to check whether a
file you have received has been encrypted to the correct key(s) by a
third party?

> Is their a similar function in the python GPGme Wrapper?

The Python bindings are a complete match for the implemented functions
in GPGME.  GPGME can detect the data types and packet types contained
in an encrypted message, otherwise a lot of things simply wouldn't
work and each operation would be more akin to playing darts
blindfolded.

However, gpg --list-packets is a debugging tool, so I'd need to
double-check whether there was a full implementation of that in the
API.

Still, depending on the answer to my first question, there may be a
more efficient means of solving the issue you have, without resorting
to human readable debugging tools.


Regards,
Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20180305/56911c9d/attachment.sig>


More information about the Gnupg-devel mailing list