aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/pdfas
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java2
-rw-r--r--src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java15
2 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java b/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java
index dda4919..332974b 100644
--- a/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java
+++ b/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java
@@ -34,6 +34,7 @@ public final class ErrorCode
public static final int COULDNT_VERIFY = 310;
+ public static final int CERTIFICATE_NOT_FOUND = 313;
public static final int NOT_SEMANTICALLY_EQUAL = 314;
public static final int WEB_EXCEPTION = 330;
@@ -44,6 +45,7 @@ public final class ErrorCode
public static final int SESSION_EXPIRED = 600;
public static final int PLACEHOLDER_EXCEPTION = 700;
+
}
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java b/src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java
index 6c6ba29..b1f1cea 100644
--- a/src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java
+++ b/src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java
@@ -38,6 +38,7 @@ import at.knowcenter.wag.egov.egiz.PdfAS;
import at.knowcenter.wag.egov.egiz.PdfASID;
import at.knowcenter.wag.egov.egiz.exceptions.PDFDocumentException;
import at.knowcenter.wag.egov.egiz.exceptions.PresentableException;
+import at.knowcenter.wag.egov.egiz.exceptions.SignatureException;
import at.knowcenter.wag.egov.egiz.framework.SignatorFactory;
import at.knowcenter.wag.egov.egiz.pdf.BinarySignature;
import at.knowcenter.wag.egov.egiz.pdf.IncrementalUpdateInformation;
@@ -51,6 +52,7 @@ import at.knowcenter.wag.egov.egiz.sig.SignatureFieldDefinition;
import at.knowcenter.wag.egov.egiz.sig.SignatureObject;
import at.knowcenter.wag.egov.egiz.sig.SignatureTypes;
import at.knowcenter.wag.egov.egiz.sig.connectors.bku.SignSignatureObjectHelper;
+import at.knowcenter.wag.egov.egiz.sig.signatureobject.SignatureObjectHelper;
import at.knowcenter.wag.exactparser.ByteArrayUtils;
import com.lowagie.text.pdf.PdfPTable;
@@ -128,6 +130,8 @@ public class BinarySignator_1_0_0 implements Signator
}
IncrementalUpdateInformation iui = IncrementalUpdateHelper.writeIncrementalUpdate(pdfDataSource, pdf_table, pi, variable_field_definitions, all_field_definitions);
+
+ iui.signProfile = profile;
String temp_string = iui.temp_ir_number + " " + iui.temp_ir_generation + " obj"; //$NON-NLS-1$//$NON-NLS-2$
byte[] temp_bytes = temp_string.getBytes("US-ASCII"); //$NON-NLS-1$
@@ -194,6 +198,17 @@ public class BinarySignator_1_0_0 implements Signator
// PdfAS.prefixID(iui.signed_signature_object, PdfAS.BINARY_ID);
fillReplacesWithValues(iui);
+
+ // This is needed so that certificates are stored
+ try
+ {
+ iui.signed_signature_object.kz = getMyId().toString();
+ SignatureObject so = SignatureObjectHelper.convertSignSignatureObjectToSignatureObject(iui.signed_signature_object, iui.signProfile);
+ }
+ catch (PresentableException e)
+ {
+ throw new SignatorException(e);
+ }
BinarySignature.replaceCertificate(iui);
BinarySignature.replacePlaceholders(iui);