aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2009-09-27 05:11:29 +0200
committerJay Berkenbilt <ejb@ql.org>2009-09-27 05:11:29 +0200
commit02333ba1e9670ff1f7fe7170d3e0cc229755dc7b (patch)
tree866d753a479c27c2d078d6eb62bb8c0af613aaab /qpdf
parent1285fa19d64ab5461c29dd9ec8a01b1a52757098 (diff)
downloadqpdf-02333ba1e9670ff1f7fe7170d3e0cc229755dc7b.tar.zst
checkpoint -- first crack at C API, minor refactoring of encryption functions
git-svn-id: svn+q:///qpdf/trunk@720 71b93d88-0707-0410-a8cf-f5a4172ac649
Diffstat (limited to 'qpdf')
-rw-r--r--qpdf/qpdf.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/qpdf/qpdf.cc b/qpdf/qpdf.cc
index bcf2e33e..40a83a87 100644
--- a/qpdf/qpdf.cc
+++ b/qpdf/qpdf.cc
@@ -168,18 +168,17 @@ void usage(std::string const& msg)
static void show_encryption(QPDF& pdf)
{
// Extract /P from /Encrypt
- QPDFObjectHandle trailer = pdf.getTrailer();
- QPDFObjectHandle encrypt = trailer.getKey("/Encrypt");
- if (encrypt.isNull())
+ if (! pdf.isEncrypted())
{
std::cout << "File is not encrypted" << std::endl;
}
else
{
+ QPDFObjectHandle trailer = pdf.getTrailer();
+ QPDFObjectHandle encrypt = trailer.getKey("/Encrypt");
QPDFObjectHandle P = encrypt.getKey("/P");
std::cout << "P = " << P.getIntValue() << std::endl;
- std::string user_password = pdf.getUserPassword();
- QPDF::trim_user_password(user_password);
+ std::string user_password = pdf.getTrimmedUserPassword();
std::cout << "User password = " << user_password << std::endl;
}
}