Further python binding adventures.

gpg.Context.key_import, unlike what the docs claim, doesn't raise any Exception if you pass in the wrong kind of data, but rather just returns the string "ERROR" and neither return values nor what type of data the function expects are documented.

I continue to be amazed by how manages to be broken for pretty much every. single. thing.

It neither works with key objects nor with fingerprint strings.

So I'm at a complete loss on how to import keys.

I mean, I'd totally understand if some obscure subkey operations don't work easily out of the box, but holy hell GnuPG really manages to break the most basic shit continuously, all the time, in new and exciting ways.

Okay, it expects a bytes object that is either an ASCII-armored or binary export of the key – i.e. what's returned by gpg.Context.key_export.

Makes sense, but could be really do with being mentioned in the docs…

gpg.errors.GPGMEError: gpgme_op_trustlist_start: GPGME: Not implemented

So I can import keys, but I can't set trust on them without ignoring the bindings and have to call the gpg executable directly as is the case with key generation?

Some real production grade software right there. :tinking:

Sign in to participate in the conversation

The original server operated by the Mastodon gGmbH non-profit