From 0b663afa4d0167df1e838e1f37bb5862e8951037 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 15 Oct 2014 18:07:20 +0200 Subject: PDF-AS Errorhandling redesign only PDFASError Exceptions are returned ! --- .../src/main/java/at/gv/egiz/pdfas/moa/MOAConnector.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'pdf-as-moa/src/main/java') diff --git a/pdf-as-moa/src/main/java/at/gv/egiz/pdfas/moa/MOAConnector.java b/pdf-as-moa/src/main/java/at/gv/egiz/pdfas/moa/MOAConnector.java index 405c02a6..d79320e3 100644 --- a/pdf-as-moa/src/main/java/at/gv/egiz/pdfas/moa/MOAConnector.java +++ b/pdf-as-moa/src/main/java/at/gv/egiz/pdfas/moa/MOAConnector.java @@ -49,6 +49,8 @@ import at.gv.e_government.reference.namespace.moa._20020822.MetaInfoType; import at.gv.e_government.reference.namespace.moa._20020822_.MOAFault; import at.gv.e_government.reference.namespace.moa._20020822_.SignatureCreationPortType; import at.gv.e_government.reference.namespace.moa._20020822_.SignatureCreationService; +import at.gv.egiz.pdfas.common.exceptions.PDFASError; +import at.gv.egiz.pdfas.common.exceptions.PdfAsErrorCarrier; import at.gv.egiz.pdfas.common.exceptions.PdfAsException; import at.gv.egiz.pdfas.common.exceptions.PdfAsMOAException; import at.gv.egiz.pdfas.common.exceptions.PdfAsSignatureException; @@ -194,8 +196,13 @@ public class MOAConnector implements ISignatureConnector, // done the signature! byte[] cmsSignatureData = (byte[])resp; - VerifyResult verifyResult = SignatureUtils - .verifySignature(cmsSignatureData, input); + VerifyResult verifyResult; + try { + verifyResult = SignatureUtils + .verifySignature(cmsSignatureData, input); + } catch (PDFASError e) { + throw new PdfAsErrorCarrier(e); + } if (!StreamUtils.dataCompare(requestedSignature .getCertificate().getFingerprintSHA(), -- cgit v1.2.3