From e27ac682e00be12e9c420c26c218ee2a01fbf232 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 6 Jan 2019 09:58:16 -0500 Subject: Move encryption parameters into a class --- include/qpdf/QPDF.hh | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'include') 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& visited, bool top); void filterCompressedObjects(std::map 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 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 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 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 encp; std::string pdf_version; std::map xref_table; std::set deleted_objects; -- cgit v1.2.3-54-g00ecf