aboutsummaryrefslogtreecommitdiff
path: root/signature-standards/sigs-pades/src/main/java/at/gv/egiz
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-11-24 15:45:18 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-11-24 15:45:18 +0100
commit7b402478784fe7237ade7c32d07f034fd7083bb7 (patch)
tree28244a16c2699a8e06d86aae90707bb5c846a3f7 /signature-standards/sigs-pades/src/main/java/at/gv/egiz
parent2ff0b5d7489909561b2122284bd7e60fee8c5baf (diff)
downloadpdf-as-4-7b402478784fe7237ade7c32d07f034fd7083bb7.tar.gz
pdf-as-4-7b402478784fe7237ade7c32d07f034fd7083bb7.tar.bz2
pdf-as-4-7b402478784fe7237ade7c32d07f034fd7083bb7.zip
verification changes
Diffstat (limited to 'signature-standards/sigs-pades/src/main/java/at/gv/egiz')
-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);
}
}