Not null requirement for Keyring Config
mkmeral opened this issue · 5 comments
Keyring config requires private key public key and password to be not null, even when they are not used. For example, even to only encrypt with public key (not signing) it requires those to be non null. Current workaround I found is to give empty string for password and random file for private key (because it creates an input stream from file).
The problem I specifically have is at (public class Rfc4880KeySelectionStrategy implements KeySelectionStrategy:137) and the reason it gives an error is, it tries to get secret keyrings before checking what the purpose is, So a simple solution for this specific problem would be to move line 137 inside the switch statement. However, I don't have extended knowledge of this project, so I am not sure if that is the optimal solution
I moved getSecretKeyRings
into the conditional in commit aa35a82
Can you test with the version in GitHub?
Or with 2.2.0
@neuhalje : Yeah, I have later changed it to InMemoryKeyring, and I am using it like that right now. I won't be able to test it right now, since that would require for me to revert commits. I will be able to test probably in 2 weeks, I will write back on the results.
Since InMemoryKeyring is the future I am inclined to close this