Commit a04a835849d501aa0c0280ddc3b91ed6c49f41c7
1 parent
9261f3b9
Clarify methods to get user password
With newer encryption formats, it is no longer possible to recover the user password using the owner password.
Showing
1 changed file
with
7 additions
and
3 deletions
include/qpdf/QPDF.hh
| ... | ... | @@ -345,12 +345,16 @@ class QPDF |
| 345 | 345 | std::string& encryption_key, |
| 346 | 346 | std::string& O, std::string& U, |
| 347 | 347 | std::string& OE, std::string& UE, std::string& Perms); |
| 348 | - // Return the full user password as stored in the PDF file. If | |
| 349 | - // you are attempting to recover the user password in a | |
| 348 | + // Return the full user password as stored in the PDF file. For | |
| 349 | + // files encrypted with 40-bit or 128-bit keys, the user password | |
| 350 | + // can be recovered when the file is opened using the owner | |
| 351 | + // password. This is not possible with newer encryption formats. | |
| 352 | + // If you are attempting to recover the user password in a | |
| 350 | 353 | // user-presentable form, call getTrimmedUserPassword() instead. |
| 351 | 354 | QPDF_DLL |
| 352 | 355 | std::string const& getPaddedUserPassword() const; |
| 353 | - // Return human-readable form of user password. | |
| 356 | + // Return human-readable form of user password subject to same | |
| 357 | + // limitations as getPaddedUserPassword(). | |
| 354 | 358 | QPDF_DLL |
| 355 | 359 | std::string getTrimmedUserPassword() const; |
| 356 | 360 | // Return the previously computed or retrieved encryption key for | ... | ... |