mirror of https://github.com/qpdf/qpdf.git
Remove deprecated (pre-8.4.0) encryption APIs
This commit is contained in:
parent
7608ff4e0b
commit
2213ed0c3d
|
@ -432,44 +432,6 @@ class QPDFWriter
|
|||
qpdf_r3_print_e print,
|
||||
bool encrypt_metadata_aes);
|
||||
|
||||
// Pre qpdf 8.4.0 API
|
||||
[[deprecated("see newer API above")]] QPDF_DLL void
|
||||
setR3EncryptionParameters(
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
bool allow_accessibility,
|
||||
bool allow_extract,
|
||||
qpdf_r3_print_e print,
|
||||
qpdf_r3_modify_e modify);
|
||||
[[deprecated("see newer API above")]] QPDF_DLL void
|
||||
setR4EncryptionParameters(
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
bool allow_accessibility,
|
||||
bool allow_extract,
|
||||
qpdf_r3_print_e print,
|
||||
qpdf_r3_modify_e modify,
|
||||
bool encrypt_metadata,
|
||||
bool use_aes);
|
||||
[[deprecated("see newer API above")]] QPDF_DLL void
|
||||
setR5EncryptionParameters(
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
bool allow_accessibility,
|
||||
bool allow_extract,
|
||||
qpdf_r3_print_e print,
|
||||
qpdf_r3_modify_e modify,
|
||||
bool encrypt_metadata);
|
||||
[[deprecated("see newer API above")]] QPDF_DLL void
|
||||
setR6EncryptionParameters(
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
bool allow_accessibility,
|
||||
bool allow_extract,
|
||||
qpdf_r3_print_e print,
|
||||
qpdf_r3_modify_e modify,
|
||||
bool encrypt_metadata_aes);
|
||||
|
||||
// Create linearized output. Disables qdf mode, content
|
||||
// normalization, and stream prefiltering.
|
||||
QPDF_DLL
|
||||
|
|
|
@ -524,51 +524,6 @@ extern "C" {
|
|||
enum qpdf_r3_print_e print,
|
||||
QPDF_BOOL encrypt_metadata);
|
||||
|
||||
/* Pre 8.4.0 encryption API */
|
||||
QPDF_DLL
|
||||
void qpdf_set_r3_encryption_parameters(
|
||||
qpdf_data qpdf,
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
QPDF_BOOL allow_accessibility,
|
||||
QPDF_BOOL allow_extract,
|
||||
enum qpdf_r3_print_e print,
|
||||
enum qpdf_r3_modify_e modify);
|
||||
|
||||
QPDF_DLL
|
||||
void qpdf_set_r4_encryption_parameters(
|
||||
qpdf_data qpdf,
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
QPDF_BOOL allow_accessibility,
|
||||
QPDF_BOOL allow_extract,
|
||||
enum qpdf_r3_print_e print,
|
||||
enum qpdf_r3_modify_e modify,
|
||||
QPDF_BOOL encrypt_metadata,
|
||||
QPDF_BOOL use_aes);
|
||||
|
||||
QPDF_DLL
|
||||
void qpdf_set_r5_encryption_parameters(
|
||||
qpdf_data qpdf,
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
QPDF_BOOL allow_accessibility,
|
||||
QPDF_BOOL allow_extract,
|
||||
enum qpdf_r3_print_e print,
|
||||
enum qpdf_r3_modify_e modify,
|
||||
QPDF_BOOL encrypt_metadata);
|
||||
|
||||
QPDF_DLL
|
||||
void qpdf_set_r6_encryption_parameters(
|
||||
qpdf_data qpdf,
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
QPDF_BOOL allow_accessibility,
|
||||
QPDF_BOOL allow_extract,
|
||||
enum qpdf_r3_print_e print,
|
||||
enum qpdf_r3_modify_e modify,
|
||||
QPDF_BOOL encrypt_metadata);
|
||||
|
||||
QPDF_DLL
|
||||
void qpdf_set_linearization(qpdf_data qpdf, QPDF_BOOL value);
|
||||
|
||||
|
|
|
@ -390,31 +390,6 @@ QPDFWriter::setR2EncryptionParameters(
|
|||
setEncryptionParameters(user_password, owner_password, 1, 2, 5, clear);
|
||||
}
|
||||
|
||||
void
|
||||
QPDFWriter::setR3EncryptionParameters(
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
bool allow_accessibility,
|
||||
bool allow_extract,
|
||||
qpdf_r3_print_e print,
|
||||
qpdf_r3_modify_e modify)
|
||||
{
|
||||
std::set<int> clear;
|
||||
interpretR3EncryptionParameters(
|
||||
clear,
|
||||
user_password,
|
||||
owner_password,
|
||||
allow_accessibility,
|
||||
allow_extract,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
print,
|
||||
modify);
|
||||
setEncryptionParameters(user_password, owner_password, 2, 3, 16, clear);
|
||||
}
|
||||
|
||||
void
|
||||
QPDFWriter::setR3EncryptionParameters(
|
||||
char const* user_password,
|
||||
|
@ -443,35 +418,6 @@ QPDFWriter::setR3EncryptionParameters(
|
|||
setEncryptionParameters(user_password, owner_password, 2, 3, 16, clear);
|
||||
}
|
||||
|
||||
void
|
||||
QPDFWriter::setR4EncryptionParameters(
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
bool allow_accessibility,
|
||||
bool allow_extract,
|
||||
qpdf_r3_print_e print,
|
||||
qpdf_r3_modify_e modify,
|
||||
bool encrypt_metadata,
|
||||
bool use_aes)
|
||||
{
|
||||
std::set<int> clear;
|
||||
interpretR3EncryptionParameters(
|
||||
clear,
|
||||
user_password,
|
||||
owner_password,
|
||||
allow_accessibility,
|
||||
allow_extract,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
print,
|
||||
modify);
|
||||
this->m->encrypt_use_aes = use_aes;
|
||||
this->m->encrypt_metadata = encrypt_metadata;
|
||||
setEncryptionParameters(user_password, owner_password, 4, 4, 16, clear);
|
||||
}
|
||||
|
||||
void
|
||||
QPDFWriter::setR4EncryptionParameters(
|
||||
char const* user_password,
|
||||
|
@ -504,34 +450,6 @@ QPDFWriter::setR4EncryptionParameters(
|
|||
setEncryptionParameters(user_password, owner_password, 4, 4, 16, clear);
|
||||
}
|
||||
|
||||
void
|
||||
QPDFWriter::setR5EncryptionParameters(
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
bool allow_accessibility,
|
||||
bool allow_extract,
|
||||
qpdf_r3_print_e print,
|
||||
qpdf_r3_modify_e modify,
|
||||
bool encrypt_metadata)
|
||||
{
|
||||
std::set<int> clear;
|
||||
interpretR3EncryptionParameters(
|
||||
clear,
|
||||
user_password,
|
||||
owner_password,
|
||||
allow_accessibility,
|
||||
allow_extract,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
print,
|
||||
modify);
|
||||
this->m->encrypt_use_aes = true;
|
||||
this->m->encrypt_metadata = encrypt_metadata;
|
||||
setEncryptionParameters(user_password, owner_password, 5, 5, 32, clear);
|
||||
}
|
||||
|
||||
void
|
||||
QPDFWriter::setR5EncryptionParameters(
|
||||
char const* user_password,
|
||||
|
@ -563,34 +481,6 @@ QPDFWriter::setR5EncryptionParameters(
|
|||
setEncryptionParameters(user_password, owner_password, 5, 5, 32, clear);
|
||||
}
|
||||
|
||||
void
|
||||
QPDFWriter::setR6EncryptionParameters(
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
bool allow_accessibility,
|
||||
bool allow_extract,
|
||||
qpdf_r3_print_e print,
|
||||
qpdf_r3_modify_e modify,
|
||||
bool encrypt_metadata)
|
||||
{
|
||||
std::set<int> clear;
|
||||
interpretR3EncryptionParameters(
|
||||
clear,
|
||||
user_password,
|
||||
owner_password,
|
||||
allow_accessibility,
|
||||
allow_extract,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
print,
|
||||
modify);
|
||||
this->m->encrypt_use_aes = true;
|
||||
this->m->encrypt_metadata = encrypt_metadata;
|
||||
setEncryptionParameters(user_password, owner_password, 5, 6, 32, clear);
|
||||
}
|
||||
|
||||
void
|
||||
QPDFWriter::setR6EncryptionParameters(
|
||||
char const* user_password,
|
||||
|
|
|
@ -805,130 +805,6 @@ qpdf_set_r6_encryption_parameters2(
|
|||
encrypt_metadata != QPDF_FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
qpdf_set_r3_encryption_parameters(
|
||||
qpdf_data qpdf,
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
QPDF_BOOL allow_accessibility,
|
||||
QPDF_BOOL allow_extract,
|
||||
qpdf_r3_print_e print,
|
||||
qpdf_r3_modify_e modify)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(disable : 4996)
|
||||
#endif
|
||||
#if (defined(__GNUC__) || defined(__clang__))
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
qpdf->qpdf_writer->setR3EncryptionParameters(
|
||||
user_password,
|
||||
owner_password,
|
||||
allow_accessibility != QPDF_FALSE,
|
||||
allow_extract != QPDF_FALSE,
|
||||
print,
|
||||
modify);
|
||||
#if (defined(__GNUC__) || defined(__clang__))
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
qpdf_set_r4_encryption_parameters(
|
||||
qpdf_data qpdf,
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
QPDF_BOOL allow_accessibility,
|
||||
QPDF_BOOL allow_extract,
|
||||
qpdf_r3_print_e print,
|
||||
qpdf_r3_modify_e modify,
|
||||
QPDF_BOOL encrypt_metadata,
|
||||
QPDF_BOOL use_aes)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(disable : 4996)
|
||||
#endif
|
||||
#if (defined(__GNUC__) || defined(__clang__))
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
qpdf->qpdf_writer->setR4EncryptionParameters(
|
||||
user_password,
|
||||
owner_password,
|
||||
allow_accessibility != QPDF_FALSE,
|
||||
allow_extract != QPDF_FALSE,
|
||||
print,
|
||||
modify,
|
||||
encrypt_metadata != QPDF_FALSE,
|
||||
use_aes != QPDF_FALSE);
|
||||
#if (defined(__GNUC__) || defined(__clang__))
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
qpdf_set_r5_encryption_parameters(
|
||||
qpdf_data qpdf,
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
QPDF_BOOL allow_accessibility,
|
||||
QPDF_BOOL allow_extract,
|
||||
qpdf_r3_print_e print,
|
||||
qpdf_r3_modify_e modify,
|
||||
QPDF_BOOL encrypt_metadata)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(disable : 4996)
|
||||
#endif
|
||||
#if (defined(__GNUC__) || defined(__clang__))
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
qpdf->qpdf_writer->setR5EncryptionParameters(
|
||||
user_password,
|
||||
owner_password,
|
||||
allow_accessibility != QPDF_FALSE,
|
||||
allow_extract != QPDF_FALSE,
|
||||
print,
|
||||
modify,
|
||||
encrypt_metadata != QPDF_FALSE);
|
||||
#if (defined(__GNUC__) || defined(__clang__))
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
qpdf_set_r6_encryption_parameters(
|
||||
qpdf_data qpdf,
|
||||
char const* user_password,
|
||||
char const* owner_password,
|
||||
QPDF_BOOL allow_accessibility,
|
||||
QPDF_BOOL allow_extract,
|
||||
qpdf_r3_print_e print,
|
||||
qpdf_r3_modify_e modify,
|
||||
QPDF_BOOL encrypt_metadata)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(disable : 4996)
|
||||
#endif
|
||||
#if (defined(__GNUC__) || defined(__clang__))
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
qpdf->qpdf_writer->setR6EncryptionParameters(
|
||||
user_password,
|
||||
owner_password,
|
||||
allow_accessibility != QPDF_FALSE,
|
||||
allow_extract != QPDF_FALSE,
|
||||
print,
|
||||
modify,
|
||||
encrypt_metadata != QPDF_FALSE);
|
||||
#if (defined(__GNUC__) || defined(__clang__))
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
qpdf_set_linearization(qpdf_data qpdf, QPDF_BOOL value)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue