-
Notifications
You must be signed in to change notification settings - Fork 20
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
Private Keys with No Passphrase #12
Comments
Thanks for pointing out this issue! I'm thinking the best way to handle this, since the JPGPJ API already uses an empty string for the passphrase to signal that the private part of the key should be ignored, is to formalize your dummy passphrase technique with a new Decryptor(
new Key(new File("path/to/my/keys/alice-pub.gpg")),
new Key(new File("path/to/my/keys/bob-sec.gpg"), Key.NO_PASSPHRASE)
).decrypt(
new File("path/to/ciphertext.txt.gpg"),
new File("path/back-to/plaintext.txt")
); Once I do that, I will update the Setting Passphrases documentation to describe how to handle passphrase-less keys with that technique. |
Add Key.NO_PASSPHRASE constant to signal that a key doesn't use a passphrase (as well as Key/Subkey.noPassphrase property), and add unit test to validate a passphrase-less key works for signing and decryption.
I added that constant to the code (plus a |
Thank you for this library. I just wanted to point out an interesting edge case. We are using a private key which has no passphrase and the only way I could get it to find and use the key was by putting in a dummy passphrase. Without the dummy passphrase I see the log output
org.c02e.jpgpj.Decryptor: not using decryption key sec ed XXXXXXX
after I put in a dummy pass phrase
org.c02e.jpgpj.Decryptor:using decryption key sec+ed XXXXXXX
The text was updated successfully, but these errors were encountered: