kbpgp
kbpgp copied to clipboard
figuring out which keymanager was used from the keyring when unboxing/decrypting
I'm working with your example at: https://keybase.io/kbpgp/docs/decrypting
There you show how to figure out who signed the message. Could you also indicate how we can see which keymanager in the keyring was actually used to perform successful decryption? I'm in the scenario where I have multiple priv/pub key pairs in my keyring that might "receive" encrypted messages.
Thanks
By my read of the code, unbox
should callback with 4 arguments:
cb err, literals, warnings, esk
The fourth parameter is the "encryption subkey" used for decryption. Give that a shot and let me know if it's useful. If so, we'll update the docs.
Thanks.
Thanks, I did not see that one. esk will certainly help there.
It was not immediately clear for me how to go from the subkey to the parent keymanager. But after fiddling around I did something like this:
- when constructing the key ring add a parent_key property to the subkeys to hold the parent keymanager
- then use esk.parent_key
If you now of a better or cleaner way, please let me know.
Thanks
I think this is currently the best way, but I'll make a note to come up with something better.