Conversation
GPG has the issue that finding a key for bar@example.com, also returns a key for foobar@example.com. This can be restricted by adding <> around the address: <bar@example.com>. Hence GPGME::Key.find_exact simply wraps <> around each email you passed to the method and delegates the rest to GPGME::Key.find
|
well, though you seem to have use cases, I'm still not convinced that the new method will improve usability. actually: |
|
While I agree it is shorter, you will often have different kind of inputs (keyid, input from a config file, from a user) to the find method. So with what I ended up so far, is to the same thing I do in the find_exact method right before the find method and if I had that at multiple places write a wrapper for it, which is exactly what the find_exact is. So my point is that I have the following options:
I can live with each of them, but imho the last one is the nicest one. But if you think that ruby-gpgme gets to messy with that, I will go with one of the other options. Improving documentation would be good, because a lot of tools are just passing the plain email-address and so might end up encrypting things with the wrong key. |
|
OK, that makes sense. However, I feel the method itself a bit too specific. I'd suggest:
How does this sound? |
|
Sounds good to me. Will do such an implementation. |
GPG has the issue that finding a key for bar@example.com, also returns a key
for foobar@example.com.
This can be restricted by adding <> around the address: bar@example.com.
Hence GPGME::Key.find_exact simply wraps <> around each email you passed to the method
and delegates the rest to GPGME::Key.find
This is quite a common use case and I used this already in a couple of projects. So it would be nice to have it upstream, to not always re-add this stuff. And just a seperate gem for that code part would be silly.
There was some discussion about it regarding the complexity with @mrsimo mrsimo#3 (comment)
What do you think? I can improve it if you have any suggestions or dislikes regarding the code structure.