Skip to content

Commit 8a51be2

Browse files
committed
Fix RSAKey constructor documentation.
The two RSAKey constructors which take existing keys (one from a stream, the other from a string) have incomplete and ambiguous documentation. This change improves the header documentation to reflect that: 1. Decryption is supported using a private key (existing doc says you can "only" sign if a private key is present), 2. Clarify that public key not needed when private key is present.
1 parent 18ffcdd commit 8a51be2

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

Crypto/include/Poco/Crypto/RSAKey.h

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,21 @@ class Crypto_API RSAKey
6464

6565
RSAKey(const std::string& publicKeyFile, const std::string& privateKeyFile = "", const std::string& privateKeyPassphrase = "");
6666
/// Creates the RSAKey, by reading public and private key from the given files and
67-
/// using the given passphrase for the private key. Can only by used for signing if
68-
/// a private key is available.
67+
/// using the given passphrase for the private key.
68+
///
69+
/// Cannot be used for signing or decryption unless a private key is available.
70+
///
71+
/// If a private key is specified, you don't need to specify a public key file.
72+
/// OpenSSL will auto-create the public key from the private key.
6973

7074
RSAKey(std::istream* pPublicKeyStream, std::istream* pPrivateKeyStream = 0, const std::string& privateKeyPassphrase = "");
71-
/// Creates the RSAKey. Can only by used for signing if pPrivKey
72-
/// is not null. If a private key file is specified, you don't need to
73-
/// specify a public key file. OpenSSL will auto-create it from the private key.
75+
/// Creates the RSAKey, by reading public and private key from the given streams and
76+
/// using the given passphrase for the private key.
77+
///
78+
/// Cannot be used for signing or decryption unless a private key is available.
79+
///
80+
/// If a private key is specified, you don't need to specify a public key file.
81+
/// OpenSSL will auto-create the public key from the private key.
7482

7583
~RSAKey();
7684
/// Destroys the RSAKey.

0 commit comments

Comments
 (0)