aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-01-06 15:58:16 +0100
committerJay Berkenbilt <ejb@ql.org>2019-01-06 15:58:16 +0100
commite27ac682e00be12e9c420c26c218ee2a01fbf232 (patch)
tree27805652f7431b869e25dd05b3c2e3988368d8ac /include
parent005675ed6b358530b0d416d28aeb14b178a127f8 (diff)
downloadqpdf-e27ac682e00be12e9c420c26c218ee2a01fbf232.tar.zst
Move encryption parameters into a class
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDF.hh40
1 files changed, 25 insertions, 15 deletions
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh
index 1b771278..120f3593 100644
--- a/include/qpdf/QPDF.hh
+++ b/include/qpdf/QPDF.hh
@@ -1160,6 +1160,30 @@ class QPDF
std::set<QPDFObjGen>& visited, bool top);
void filterCompressedObjects(std::map<int, int> const& object_stream_data);
+ class EncryptionParameters
+ {
+ friend class QPDF;
+ public:
+ EncryptionParameters();
+
+ private:
+ bool encrypted;
+ bool encryption_initialized;
+ int encryption_V;
+ int encryption_R;
+ bool encrypt_metadata;
+ std::map<std::string, encryption_method_e> crypt_filters;
+ encryption_method_e cf_stream;
+ encryption_method_e cf_string;
+ encryption_method_e cf_file;
+ std::string provided_password;
+ std::string user_password;
+ std::string encryption_key;
+ std::string cached_object_encryption_key;
+ int cached_key_objid;
+ int cached_key_generation;
+ };
+
class Members
{
friend class QPDF;
@@ -1176,26 +1200,12 @@ class QPDF
PointerHolder<InputSource> file;
std::string last_object_description;
bool provided_password_is_hex_key;
- bool encrypted;
- bool encryption_initialized;
bool ignore_xref_streams;
bool suppress_warnings;
std::ostream* out_stream;
std::ostream* err_stream;
bool attempt_recovery;
- int encryption_V;
- int encryption_R;
- bool encrypt_metadata;
- std::map<std::string, encryption_method_e> crypt_filters;
- encryption_method_e cf_stream;
- encryption_method_e cf_string;
- encryption_method_e cf_file;
- std::string provided_password;
- std::string user_password;
- std::string encryption_key;
- std::string cached_object_encryption_key;
- int cached_key_objid;
- int cached_key_generation;
+ PointerHolder<EncryptionParameters> encp;
std::string pdf_version;
std::map<QPDFObjGen, QPDFXRefEntry> xref_table;
std::set<int> deleted_objects;