From 4ca185fd96dfd3c7a8d89d3afd8093a26acf178b Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 24 Dec 2023 07:12:32 -0500 Subject: Remove --disable-signatures; incorporate into --remove-restrictions Rather than adding yet another flag that is almost never useful on its own, just have --remove-restrictions disable digital signatures. The operations are still separate in the API. --- include/qpdf/QPDF.hh | 4 +++- include/qpdf/QPDFAcroFormDocumentHelper.hh | 3 ++- include/qpdf/QPDFJob.hh | 1 - include/qpdf/auto_job_c_main.hh | 1 - 4 files changed, 5 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index 0d8b5f91..615803d3 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -600,7 +600,9 @@ class QPDF // Return the previously computed or retrieved encryption key for this file QPDF_DLL std::string getEncryptionKey() const; - // Remove security restrictions associated with digitally signed files. + // Remove security restrictions associated with digitally signed files. From qpdf 11.7.0, this + // is called by QPDFAcroFormDocumentHelper::disableDigitalSignatures and is more useful when + // called from there than when just called by itself. QPDF_DLL void removeSecurityRestrictions(); diff --git a/include/qpdf/QPDFAcroFormDocumentHelper.hh b/include/qpdf/QPDFAcroFormDocumentHelper.hh index f9ad0091..9e0ad51e 100644 --- a/include/qpdf/QPDFAcroFormDocumentHelper.hh +++ b/include/qpdf/QPDFAcroFormDocumentHelper.hh @@ -164,7 +164,8 @@ class QPDFAcroFormDocumentHelper: public QPDFDocumentHelper void generateAppearancesIfNeeded(); // Disable Digital Signature Fields. Remove all digital signature fields from the document, - // leaving any annotation showing the content of the field intact. + // leaving any annotation showing the content of the field intact. This also calls + // QPDF::removeSecurityRestrictions. QPDF_DLL void disableDigitalSignatures(); diff --git a/include/qpdf/QPDFJob.hh b/include/qpdf/QPDFJob.hh index 21045019..b9c8ba50 100644 --- a/include/qpdf/QPDFJob.hh +++ b/include/qpdf/QPDFJob.hh @@ -557,7 +557,6 @@ class QPDFJob bool linearize{false}; bool decrypt{false}; bool remove_restrictions{false}; - bool disable_signatures{false}; int split_pages{0}; bool progress{false}; std::function progress_handler{nullptr}; diff --git a/include/qpdf/auto_job_c_main.hh b/include/qpdf/auto_job_c_main.hh index 024f8469..6c661404 100644 --- a/include/qpdf/auto_job_c_main.hh +++ b/include/qpdf/auto_job_c_main.hh @@ -11,7 +11,6 @@ QPDF_DLL Config* checkLinearization(); QPDF_DLL Config* coalesceContents(); QPDF_DLL Config* decrypt(); QPDF_DLL Config* deterministicId(); -QPDF_DLL Config* disableSignatures(); QPDF_DLL Config* externalizeInlineImages(); QPDF_DLL Config* filteredStreamData(); QPDF_DLL Config* flattenRotation(); -- cgit v1.2.3-54-g00ecf