1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +00:00

LibPDF: Add implementation of the Standard security handler

Security handlers manage encryption and decription of PDF files. The
standard security handler uses RC4/MD5 to perform its crypto (AES as
well, but that is not yet implemented).
This commit is contained in:
Matthew Olsson 2022-03-20 14:24:23 -07:00 committed by Andreas Kling
parent c98bda8ce6
commit 5b316462b2
9 changed files with 522 additions and 3 deletions

View file

@ -16,6 +16,7 @@ TEST_CASE(linearized_pdf)
auto file = Core::MappedFile::map("linearized.pdf").release_value();
auto document = PDF::Document::create(file->bytes());
EXPECT(!document.is_error());
EXPECT(!document.value()->initialize().is_error());
EXPECT_EQ(document.value()->get_page_count(), 1U);
}
@ -24,6 +25,7 @@ TEST_CASE(non_linearized_pdf)
auto file = Core::MappedFile::map("non-linearized.pdf").release_value();
auto document = PDF::Document::create(file->bytes());
EXPECT(!document.is_error());
EXPECT(!document.value()->initialize().is_error());
EXPECT_EQ(document.value()->get_page_count(), 1U);
}
@ -32,6 +34,7 @@ TEST_CASE(complex_pdf)
auto file = Core::MappedFile::map("complex.pdf").release_value();
auto document = PDF::Document::create(file->bytes());
EXPECT(!document.is_error());
EXPECT(!document.value()->initialize().is_error());
EXPECT_EQ(document.value()->get_page_count(), 3U);
}