diff options
author | netconomy <netconomy@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2007-08-27 08:07:48 +0000 |
---|---|---|
committer | netconomy <netconomy@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2007-08-27 08:07:48 +0000 |
commit | 567b6e8f386b9b85e77beec16302c7afe37d041b (patch) | |
tree | ea6ccedc3d11548c1c6838f53fe079a1ec8276e6 /src/main/java/at/gv/egiz/pdfas | |
parent | 8dffa927aa50a1ff1924f554fe3534ebcd6d9278 (diff) | |
download | pdf-as-3-567b6e8f386b9b85e77beec16302c7afe37d041b.tar.gz pdf-as-3-567b6e8f386b9b85e77beec16302c7afe37d041b.tar.bz2 pdf-as-3-567b6e8f386b9b85e77beec16302c7afe37d041b.zip |
bigfix "add cert when signing"
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@203 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas')
-rw-r--r-- | src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java | 2 | ||||
-rw-r--r-- | src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java | 15 |
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);
|