From be27da36e9b1e319bf8910228cdbcdd502afbc9d Mon Sep 17 00:00:00 2001 From: emusic Date: Tue, 18 Sep 2018 10:16:56 +0200 Subject: changes in pdfurl --- .../at/gv/egiz/pdfas/web/helper/PdfAsHelper.java | 42 +++++++++++++++------- 1 file changed, 29 insertions(+), 13 deletions(-) (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas') diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java index 23e16ec3..8aeda417 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java @@ -1224,19 +1224,35 @@ public class PdfAsHelper { byte[] data = PDFUtils.blackOutSignature(statusRequest.getSignatureData(), statusRequest.getSignatureDataByteRange()); - - JsonObject createCAdESSigParams = - SL20JSONBuilderUtils.createCreateCAdESCommandParameters( - pack.getRequestType().getKeyboxIdentifier(), - null, - generateNSPdfURL(request,response), - SL20Constants.SL20_COMMAND_PARAM_CREATE_SIG_CADES_CONTENTMODE_DETACHED, - pack.getRequestType().getDataObject().getMetaInfo().getMimeType(), - padesCompatibel , - byteRanges, - SL20Constants.SL20_COMMAND_PARAM_CREATE_SIG_CADES_CADESLEVEL_BASIC, - generateDataURLSL20(request, response), - x5cEnc) ; + JsonObject createCAdESSigParams; + if(data.length>20000000) { + createCAdESSigParams = + SL20JSONBuilderUtils.createCreateCAdESCommandParameters( + pack.getRequestType().getKeyboxIdentifier(), + null, + generateNSPdfURL(request, response), + SL20Constants.SL20_COMMAND_PARAM_CREATE_SIG_CADES_CONTENTMODE_DETACHED, + pack.getRequestType().getDataObject().getMetaInfo().getMimeType(), + padesCompatibel, + byteRanges, + SL20Constants.SL20_COMMAND_PARAM_CREATE_SIG_CADES_CADESLEVEL_BASIC, + generateDataURLSL20(request, response), + x5cEnc); + } else + { + createCAdESSigParams = + SL20JSONBuilderUtils.createCreateCAdESCommandParameters( + pack.getRequestType().getKeyboxIdentifier(), + data, + null, + SL20Constants.SL20_COMMAND_PARAM_CREATE_SIG_CADES_CONTENTMODE_DETACHED, + pack.getRequestType().getDataObject().getMetaInfo().getMimeType(), + padesCompatibel, + byteRanges, + SL20Constants.SL20_COMMAND_PARAM_CREATE_SIG_CADES_CADESLEVEL_BASIC, + generateDataURLSL20(request, response), + x5cEnc); + } JsonObject sl20CreateCAdES = null; String reqId = UUID.randomUUID().toString(); -- cgit v1.2.3