diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-10-15 18:07:20 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-10-15 18:07:20 +0200 |
commit | 0b663afa4d0167df1e838e1f37bb5862e8951037 (patch) | |
tree | 1b962dedd3c2e1eba042c89fbf6191b42218bd36 /pdf-as-lib/src/main/java/at/gv/egiz/sl/util | |
parent | d9dcd54eae2b3a8e46dce69c96eca7c97f1be429 (diff) | |
download | pdf-as-4-0b663afa4d0167df1e838e1f37bb5862e8951037.tar.gz pdf-as-4-0b663afa4d0167df1e838e1f37bb5862e8951037.tar.bz2 pdf-as-4-0b663afa4d0167df1e838e1f37bb5862e8951037.zip |
PDF-AS Errorhandling redesign only PDFASError Exceptions are returned
!
Diffstat (limited to 'pdf-as-lib/src/main/java/at/gv/egiz/sl/util')
-rw-r--r-- | pdf-as-lib/src/main/java/at/gv/egiz/sl/util/ISignatureConnectorSLWrapper.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/ISignatureConnectorSLWrapper.java b/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/ISignatureConnectorSLWrapper.java index 82dc0602..19dc3d76 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/ISignatureConnectorSLWrapper.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/sl/util/ISignatureConnectorSLWrapper.java @@ -27,17 +27,17 @@ import iaik.x509.X509Certificate; import java.security.cert.CertificateException; import java.util.Iterator; -import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +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.PdfAsSignatureException; import at.gv.egiz.pdfas.common.utils.StreamUtils; 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.SignResultImpl; import at.gv.egiz.pdfas.lib.impl.status.RequestedSignature; import at.gv.egiz.pdfas.lib.util.SignatureUtils; import at.gv.egiz.sl.schema.CreateCMSSignatureResponseType; @@ -90,7 +90,12 @@ public class ISignatureConnectorSLWrapper implements ISignatureConnector { CreateCMSSignatureResponseType response = connector .sendCMSRequest(pack, parameter); - VerifyResult verifyResult = SignatureUtils.verifySignature(response.getCMSSignature(), input); + VerifyResult verifyResult; + try { + verifyResult = SignatureUtils.verifySignature(response.getCMSSignature(), input); + } catch (PDFASError e) { + throw new PdfAsErrorCarrier(e); + } if(!StreamUtils.dataCompare(requestedSignature.getCertificate().getFingerprintSHA(), ((X509Certificate)verifyResult.getSignerCertificate()).getFingerprintSHA())) { |