Skip to content

Commit 3b8fdec

Browse files
committed
PDFBOX-6070: add test for 5521
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1928563 13f79535-47bb-0310-9956-ffa450edef68
1 parent 444dd23 commit 3b8fdec

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,34 @@ void testAddValidationInformation()
923923
checkLTV(outFile);
924924
}
925925

926+
/**
927+
* PDFBOX-5521: Check that UR3 signature doesn't interfere.
928+
*
929+
* @param externallySign
930+
*
931+
* @throws IOException
932+
* @throws GeneralSecurityException
933+
* @throws CMSException
934+
* @throws OperatorCreationException
935+
* @throws TSPException
936+
* @throws CertificateVerificationException
937+
*/
938+
@ParameterizedTest
939+
@MethodSource("signingTypes")
940+
void testPDFBox5521(boolean externallySign)
941+
throws IOException, GeneralSecurityException, CMSException,
942+
OperatorCreationException, TSPException, CertificateVerificationException
943+
{
944+
// sign PDF
945+
CreateSignature signing = new CreateSignature(keyStore, PASSWORD.toCharArray());
946+
signing.setExternalSigning(externallySign);
947+
948+
final String fileNameSigned = getOutputFileName("PDFBOX-5521-santander_freistellungsauftrag.pdf_signed{0}.pdf", externallySign);
949+
final File file = new File("target/pdfs", "PDFBOX-5521-santander_freistellungsauftrag.pdf");
950+
signing.signDetached(file, new File(OUT_DIR + fileNameSigned));
951+
checkSignature(file, new File(OUT_DIR, fileNameSigned), false);
952+
}
953+
926954
private void checkLTV(File outFile)
927955
throws IOException, GeneralSecurityException, OCSPException, OperatorCreationException,
928956
CMSException

0 commit comments

Comments
 (0)