aboutsummaryrefslogtreecommitdiff
path: root/signature-standards/sigs-pades/src/main/java/at
diff options
context:
space:
mode:
Diffstat (limited to 'signature-standards/sigs-pades/src/main/java/at')
-rw-r--r--signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java
index d50a2c95..99138714 100644
--- a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java
+++ b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java
@@ -65,8 +65,10 @@ import at.gv.egiz.pdfas.common.exceptions.PdfAsSignatureException;
import at.gv.egiz.pdfas.lib.api.PdfAsFactory;
import at.gv.egiz.pdfas.lib.api.sign.IPlainSigner;
import at.gv.egiz.pdfas.lib.api.sign.SignParameter;
+import at.gv.egiz.pdfas.lib.api.verify.VerifyResult;
import at.gv.egiz.pdfas.lib.impl.status.RequestedSignature;
import at.gv.egiz.pdfas.lib.util.CertificateUtils;
+import at.gv.egiz.pdfas.lib.util.SignatureUtils;
public class PAdESSignerKeystore implements IPlainSigner, PAdESConstants {
@@ -305,8 +307,12 @@ public class PAdESSignerKeystore implements IPlainSigner, PAdESConstants {
while ((r = dataIs.read(buf)) > 0)
; // skip data
ContentInfo ci = new ContentInfo(si);
-
- return ci.getEncoded();
+ byte[] signature = ci.getEncoded();
+
+ VerifyResult verifyResult = SignatureUtils.verifySignature(
+ signature, input);
+
+ return signature;
} catch (NoSuchAlgorithmException e) {
throw new PdfAsSignatureException("error.pdf.sig.01", e);
} catch (iaik.cms.CMSException e) {
@@ -317,6 +323,8 @@ public class PAdESSignerKeystore implements IPlainSigner, PAdESConstants {
throw new PdfAsSignatureException("error.pdf.sig.01", e);
} catch (CodingException e) {
throw new PdfAsSignatureException("error.pdf.sig.01", e);
+ } catch (PDFASError e) {
+ throw new PdfAsSignatureException("error.pdf.sig.01", e);
}
}