gpg-rs / gpgme

GPGme bindings for Rust
GNU Lesser General Public License v2.1
83 stars 13 forks source link

Allow empty list of user-ids so they can default. #14

Closed Byron closed 6 years ago

Byron commented 6 years ago

That way, all valid user ids are signed. For reference please have a look at https://www.gnupg.org/documentation/manuals/gpgme/Signing-Keys.html#Signing-Keys

Motivation for this PR was to have a minimal example and learn how to sign keys. So far I have not been very successful, even though I believe that the example generally works.

Please let me know if anything else should be changed to make it mergeable.

Byron commented 6 years ago

And I think it's not even working, maybe you have an idea what the problem is. It appears I am not getting anywhere with the code itself, even though signing generally works with my test-keys when using the gpg program itself.

Byron commented 6 years ago

It appears the gpg_op_keysign symbol is not found in one case.

Byron commented 6 years ago

Thanks for the fixes and improvements, too! @johnschug Have you ever successfully signed a key with that new example program? I still couldn't make it work, neither with add_signer nor without. This puzzles me.

Byron commented 6 years ago

The keysign test you added was very helpful, as I was at least able to see that I wasn't doing it totally wrong before. More testing showed that the problem was my run image, which used GPG1 instead of GPG2. It appears GPG1 doesn't support signing keys using gpgme bindings. Using GPG2 in my test images fixes the problem for me. (I am just leaving this note in case it's helpful to others, too)