When using multiple keys and one of the keys is a public only key, a null pointer exception occurs when attempting to decrypt a password file.
In my setup, the password files are encrypted with two public keys, allowing either associated private key to decrypt the file. So a user needs their private key for decryption and both their public key and the other public key for encryption. Private key files contain both the private and public keys. A public key file contains only the public key. It looks like the code is assuming that the key files always contain both private and public keys.
Steps to reproduce
Import a private key
Import public only key
Attempt to decrypt a password file using the private key password
The Password dialog will report "Wrong password"
The log file shows a null pointer exception in PGPSecretKeyRingCollection
Expected behavior
A password file should be able to be successfully decrypted when a public only key has been imported in addition to a private/public key.
Describe the bug
When using multiple keys and one of the keys is a public only key, a null pointer exception occurs when attempting to decrypt a password file.
In my setup, the password files are encrypted with two public keys, allowing either associated private key to decrypt the file. So a user needs their private key for decryption and both their public key and the other public key for encryption. Private key files contain both the private and public keys. A public key file contains only the public key. It looks like the code is assuming that the key files always contain both private and public keys.
Steps to reproduce
Expected behavior
A password file should be able to be successfully decrypted when a public only key has been imported in addition to a private/public key.
Screenshots
No response
Device information
Additional context
No response