From 2630860e7ecfafe392fd73541648c9a39ef15718 Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 28 Aug 2026 11:45:50 +0200 Subject: [PATCH] test: add encryptedPdf.pdf test fixture with /Encrypt in trailer Minimal hand-crafted PDF containing a Standard encryption dictionary referenced from the trailer (/Encrypt 4 0 R). Used by DetectEncryption unit tests to verify byte-level encryption detection. Registered as EmbeddedResource in DocumentService.Tests.csproj. --- .../DocumentService.Tests.csproj | 2 ++ .../TestData/Pdfs/encryptedPdf.pdf | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 DocumentOperator.Tests/TestData/Pdfs/encryptedPdf.pdf diff --git a/DocumentOperator.Tests/DocumentService.Tests.csproj b/DocumentOperator.Tests/DocumentService.Tests.csproj index 8dc549d..f343f00 100644 --- a/DocumentOperator.Tests/DocumentService.Tests.csproj +++ b/DocumentOperator.Tests/DocumentService.Tests.csproj @@ -13,12 +13,14 @@ + + diff --git a/DocumentOperator.Tests/TestData/Pdfs/encryptedPdf.pdf b/DocumentOperator.Tests/TestData/Pdfs/encryptedPdf.pdf new file mode 100644 index 0000000..cd36c06 --- /dev/null +++ b/DocumentOperator.Tests/TestData/Pdfs/encryptedPdf.pdf @@ -0,0 +1,30 @@ +%PDF-1.4 +1 0 obj +<< /Type /Catalog /Pages 2 0 R >> +endobj + +2 0 obj +<< /Type /Pages /Kids [3 0 R] /Count 1 >> +endobj + +3 0 obj +<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] >> +endobj + +4 0 obj +<< /Filter /Standard /V 2 /R 3 /Length 128 /P -3904 /O (OwnerHash12345678901234567890123456) /U (UserHash12345678901234567890123456) >> +endobj + +xref +0 5 +0000000000 65535 f +0000000009 00000 n +0000000058 00000 n +0000000115 00000 n +0000000206 00000 n + +trailer +<< /Size 5 /Root 1 0 R /Encrypt 4 0 R >> +startxref +370 +%%EOF \ No newline at end of file