Author: tilman
Date: Wed Sep 17 15:24:27 2025
New Revision: 1928563
Log:
PDFBOX-6070: add test for 5521
Modified:
pdfbox/trunk/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java
Modified:
pdfbox/trunk/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java
==============================================================================
---
pdfbox/trunk/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java
Wed Sep 17 15:24:06 2025 (r1928562)
+++
pdfbox/trunk/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java
Wed Sep 17 15:24:27 2025 (r1928563)
@@ -923,6 +923,34 @@ class TestCreateSignature
checkLTV(outFile);
}
+ /**
+ * PDFBOX-5521: Check that UR3 signature doesn't interfere.
+ *
+ * @param externallySign
+ *
+ * @throws IOException
+ * @throws GeneralSecurityException
+ * @throws CMSException
+ * @throws OperatorCreationException
+ * @throws TSPException
+ * @throws CertificateVerificationException
+ */
+ @ParameterizedTest
+ @MethodSource("signingTypes")
+ void testPDFBox5521(boolean externallySign)
+ throws IOException, GeneralSecurityException, CMSException,
+ OperatorCreationException, TSPException,
CertificateVerificationException
+ {
+ // sign PDF
+ CreateSignature signing = new CreateSignature(keyStore,
PASSWORD.toCharArray());
+ signing.setExternalSigning(externallySign);
+
+ final String fileNameSigned =
getOutputFileName("PDFBOX-5521-santander_freistellungsauftrag.pdf_signed{0}.pdf",
externallySign);
+ final File file = new File("target/pdfs",
"PDFBOX-5521-santander_freistellungsauftrag.pdf");
+ signing.signDetached(file, new File(OUT_DIR + fileNameSigned));
+ checkSignature(file, new File(OUT_DIR, fileNameSigned), false);
+ }
+
private void checkLTV(File outFile)
throws IOException, GeneralSecurityException, OCSPException,
OperatorCreationException,
CMSException