diff options
Diffstat (limited to 'src/main/java/demo')
-rw-r--r-- | src/main/java/demo/SignatureVerificationDemo.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/demo/SignatureVerificationDemo.java b/src/main/java/demo/SignatureVerificationDemo.java index d794028..e89c394 100644 --- a/src/main/java/demo/SignatureVerificationDemo.java +++ b/src/main/java/demo/SignatureVerificationDemo.java @@ -20,6 +20,7 @@ import at.gv.egiz.pdfas.api.verify.VerifyResult; import at.gv.egiz.pdfas.api.verify.VerifyResults;
import at.gv.egiz.pdfas.commandline.Main;
import at.gv.egiz.pdfas.exceptions.ErrorCode;
+import at.gv.egiz.pdfas.exceptions.ErrorCodeHelper;
import at.gv.egiz.pdfas.framework.config.SettingsHelper;
import at.gv.egiz.pdfas.framework.vfilter.VerificationFilterParameters;
import at.gv.egiz.pdfas.io.FileBasedDataSource;
@@ -120,6 +121,14 @@ public class SignatureVerificationDemo { counter++;
VerifyResult result = (VerifyResult) it.next();
out.println("\n------------------------ SIGNATURE #" + counter + " ------------------------\n");
+
+ // check if signature verification of the current signature was successfully completed (independent from result)
+ if (!result.isVerificationDone()) {
+ PdfAsException ex = result.getVerificationException();
+ out.println(ErrorCodeHelper.formErrorMessage(ex));
+ continue;
+ }
+
Main.formatVerifyResult(result, out);
// check if there are timestamps
|