aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-02-16 14:32:13 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-02-16 14:32:13 +0100
commitec99166bc7057eaa70aedcb183e0409ae0bee028 (patch)
tree74e020a64aabcfd238f2264e3e3563509dd5f4b4 /pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas
parent1a75185a668d84084f3be83837891db158eb8ef1 (diff)
downloadpdf-as-4-ec99166bc7057eaa70aedcb183e0409ae0bee028.tar.gz
pdf-as-4-ec99166bc7057eaa70aedcb183e0409ae0bee028.tar.bz2
pdf-as-4-ec99166bc7057eaa70aedcb183e0409ae0bee028.zip
configurable signature buffer size
Diffstat (limited to 'pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas')
-rw-r--r--pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java
index 8556ae9f..c853ee17 100644
--- a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java
+++ b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java
@@ -209,7 +209,17 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
signer.setPDSignature(signature);
- options.setPreferedSignatureSize(0x1000);
+ int signatureSize = 0x1000;
+ try {
+ String reservedSignatureSizeString = pdfObject.getStatus().getSettings().getValue(SIG_RESERVED_SIZE);
+ if(reservedSignatureSizeString != null) {
+ signatureSize = Integer.parseInt(reservedSignatureSizeString);
+ }
+ logger.debug("Reserving {} bytes for signature", signatureSize);
+ } catch(NumberFormatException e) {
+ logger.warn("Invalid configuration value: {} should be a number using 0x1000", SIG_RESERVED_SIZE);
+ }
+ options.setPreferedSignatureSize(signatureSize);
// Is visible Signature
if (requestedSignature.isVisual()) {