pocoproject/poco — pull request #568 by johnboy2 (2014-10-13 20:03:40+00:00)
Title: Don't require RSA key passphrases on save

Repro:
* Create a source file with the following content:
```c++
#include
using namespace Poco::Crypto;

int main(void) {
RSAKey key(RSAKey::KL_2048, RSAKey::EXP_LARGE);
key.save("", "privkey.txt");
}
```
* Compile
* Run

Expected: Private key is saved without DES encryption

Result: Console prompt for passphrase.

-------

The core issue appears to be that DES encryption is specified to OpenSSL under the hood even when no passphrase was given. Per OpenSSL documentation (https://www.openssl.org/docs/crypto/pem.html), specifying a DES encryption without specifying the passphrase triggers the default callback handler, which is what causes the console prompt.

Given that some applications do not run on a console, I'm don't think that insisting on DES encryption of private keys is appropriate. If no passphrase is specified, then the private key should not be DES encrypted, in my opinion.