You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2021/04/13 06:11:12 UTC

svn commit: r1888705 - /pdfbox/branches/2.0/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java

Author: tilman
Date: Tue Apr 13 06:11:12 2021
New Revision: 1888705

URL: http://svn.apache.org/viewvc?rev=1888705&view=rev
Log:
PDFBOX-5157: refactor to extract LTV check

Modified:
    pdfbox/branches/2.0/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java

Modified: pdfbox/branches/2.0/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java?rev=1888705&r1=1888704&r2=1888705&view=diff
==============================================================================
--- pdfbox/branches/2.0/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java (original)
+++ pdfbox/branches/2.0/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java Tue Apr 13 06:11:12 2021
@@ -820,8 +820,15 @@ public class TestCreateSignature
         AddValidationInformation addValidationInformation = new AddValidationInformation();
         addValidationInformation.validateSignature(inFile, outFile);
 
-        PDDocument doc = PDDocument.load(outFile);
+        checkLTV(outFile);
+    }
 
+    private void checkLTV(File outFile)
+            throws IOException, GeneralSecurityException, OCSPException, OperatorCreationException,
+            CMSException
+    {
+        PDDocument doc = PDDocument.load(outFile);
+        
         PDSignature signature = doc.getLastSignatureDictionary();
         byte[] contents = signature.getContents();