aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java')
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java32
1 files changed, 32 insertions, 0 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 dddd80dd..fe26f097 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
@@ -235,9 +235,41 @@ public class ExternSignServlet extends HttpServlet {
IPlainSigner signer;
if (connector.equals("bku") || connector.equals("onlinebku") || connector.equals("mobilebku")) {
// start asynchronous signature creation
+
+ if(connector.equals("bku")) {
+ if(WebConfiguration.getLocalBKUURL() == null) {
+ throw new PdfAsWebException("Invalid connector bku is not supported");
+ }
+ }
+
+ if(connector.equals("onlinebku")) {
+ if(WebConfiguration.getLocalBKUURL() == null) {
+ throw new PdfAsWebException("Invalid connector onlinebku is not supported");
+ }
+ }
+
+ if(connector.equals("mobilebku")) {
+ if(WebConfiguration.getLocalBKUURL() == null) {
+ throw new PdfAsWebException("Invalid connector mobilebku is not supported");
+ }
+ }
+
PdfAsHelper.startSignature(request, response, getServletContext(), pdfData);
} else if (connector.equals("jks") || connector.equals("moa")) {
// start synchronous siganture creation
+
+ if(connector.equals("jks")) {
+ if(!WebConfiguration.getKeystoreEnabled()) {
+ throw new PdfAsWebException("Invalid connector jks is not supported");
+ }
+ }
+
+ if(connector.equals("moa")) {
+ if(!WebConfiguration.getMOASSEnabled()) {
+ throw new PdfAsWebException("Invalid connector moa is not supported");
+ }
+ }
+
byte[] pdfSignedData = PdfAsHelper.synchornousSignature(request,
response, pdfData);
PdfAsHelper.setSignedPdf(request, response, pdfSignedData);