-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No (suitable) public key for encryption to [a provided recipient email address] found #50
Comments
just FYI, right now for short term solution, I just use Java subprocess to call python's gnupg library to do encryption. Once this is fixed, I will test it for you and will use it. |
I had the same issue. Checking the content of your key with: the key doesn't contain a KeyFlags subpacket (subpacket type 27). This section of the key indicates whether the key can be used for encryption, or signing, or other things. In this case Bouncy-gpg assumes the key cannot be used for encryption. An alternative to using a python call is to implement your own KeySelectionStrategy, so that it accepts keys that don't explicitly have an Encryption flag I attached an example for reference, which mimics GPG behaviour |
…ave a KeyFlags subpacket
Entered PR52 to fix the issue |
It doesn't look like it's been merged yet. I don't have write access to the repo and can only submit a PR, I think @neuhalje has to review and approve... But my comment above provides a workaround that doesn't require changing the library, if you really need it |
Can you provide an example of how to use the override with InMemoryKeyring? Not sure how to implement the override when the parent class is not an explicit instantiation. For example where to override the single use of "KeyringConfigCallbacks" below? keyring = KeyringConfigs.forGpgExportedKeys(KeyringConfigCallbacks.withPassword(passphrase)); BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(result); |
I’ll look into that shortly |
…mdesmons-master * 'master' of https://github.com/mdesmons/bouncy-gpg: added comment to extractPublicKeyFlags Fix for issue #50, where we cannot encrypt if a key doesn't have a KeyFlags subpacket
* mdesmons-master: added comment to extractPublicKeyFlags Fix for issue #50, where we cannot encrypt if a key doesn't have a KeyFlags subpacket
Please check - should be fixes |
Hi there! Was this ever put through? Getting the same issue here. Thanks! |
Same question here. |
we were able to resolve it by invoking selectUidByAnyUidPart() after initializing WithKeySelectionStrategy. ex: outputStream = BouncyGPG |
|
Is this still a problem? |
Hi,
I tested encryption out with gpg in commandline with no problem. When I test it out with Bouncy-gpg by using this code:
Then, It gives exception
This code works all other public key except this one. The interesting part is that it works in GPG commandline.
I have attached the public key in the following comment. I don't know if the recipient email address the "dot" in front of domain that causes the issue.
The text was updated successfully, but these errors were encountered: