diff options
Diffstat (limited to 'pdf-as-web/src/main/java')
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java index a462480e..b70539a4 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java @@ -287,6 +287,10 @@ public class ExternSignServlet extends HttpServlet { protected void doSignature(HttpServletRequest request, HttpServletResponse response, byte[] pdfData, StatisticEvent statisticEvent) throws Exception { + if(pdfData == null) { + throw new PdfAsException("No Signature data available"); + } + if(pdfData[0] != 0x25 || pdfData[1] != 0x50 || pdfData[2] != 0x44 || pdfData[3] != 0x46) { throw new PdfAsWebException( "Received data is not a valid PDF-Document"); @@ -325,10 +329,6 @@ public class ExternSignServlet extends HttpServlet { PdfAsHelper.setPDFFileName(request, filename); } - if(pdfData == null) { - throw new PdfAsException("No Signature data available"); - } - String pdfDataHash = DigestHelper.getHexEncodedHash(pdfData); PdfAsHelper.setSignatureDataHash(request, pdfDataHash); |