Description
Describe the bug
Assuming a private key file protected by a password exists, it can be loaded with the EVPPkey
constructor accepting empty pubkey name, private key name, and passphrase. If The passphrase is empty, the program will prompt the user to type in the key
with a message like Enter PEM pass phrase:
. This is unsuitable for library code, since this cannot be reacted to unless the program is running in an interactive terminal.
It would be better to raise an exception, which happens e.g. when the wrong password is supplied.
To Reproduce
Attached an MVP with an encrypted openssl key
Expected behavior
Poco raises an exception when the key requires a passphrase, but none was supplied
Logs
n/a
Screenshots
Please add relevant environment information:
- OS Type and Version: macos ARM 12.7.5
- POCO Version: 1.13.3 (homebrew)
Additional context
I know this probably comes from OpenSSL, but can this be worked around somehow?