aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorferbas <ferbas@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2009-10-27 10:49:07 +0000
committerferbas <ferbas@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2009-10-27 10:49:07 +0000
commit274353659eb90707c1422151513c4937e4d9edb5 (patch)
tree88f1081e3b26e2023fbd1ab4268af7631b952ed3 /src/main/java/at
parent419d18a18f7475a4396f8b32a602ad9ff9c67ad2 (diff)
downloadpdf-as-3-274353659eb90707c1422151513c4937e4d9edb5.tar.gz
pdf-as-3-274353659eb90707c1422151513c4937e4d9edb5.tar.bz2
pdf-as-3-274353659eb90707c1422151513c4937e4d9edb5.zip
removed has_sig_id
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@350 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java29
1 files changed, 28 insertions, 1 deletions
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 10dc3d6..8be121a 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
@@ -17,14 +17,24 @@
*/
package at.gv.egiz.pdfas.impl.signator.binary;
+import iaik.pkcs.pkcs12.CertificateBag;
+
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
+import java.security.cert.Certificate;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import at.gv.egiz.pdfas.exceptions.ErrorCode;
import at.gv.egiz.pdfas.exceptions.framework.SignatorException;
import at.gv.egiz.pdfas.framework.input.DataSource;
@@ -51,10 +61,19 @@ 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.connectors.moa.MOAHelper;
import at.knowcenter.wag.egov.egiz.sig.signatureobject.SignatureObjectHelper;
import at.knowcenter.wag.exactparser.ByteArrayUtils;
+import com.lowagie.text.DocumentException;
+import com.lowagie.text.pdf.PdfDictionary;
+import com.lowagie.text.pdf.PdfName;
+import com.lowagie.text.pdf.PdfPKCS7;
import com.lowagie.text.pdf.PdfPTable;
+import com.lowagie.text.pdf.PdfReader;
+import com.lowagie.text.pdf.PdfSignatureAppearance;
+import com.lowagie.text.pdf.PdfStamper;
+import com.lowagie.text.pdf.PdfString;
/**
* Signs the document binary.
@@ -75,6 +94,9 @@ import com.lowagie.text.pdf.PdfPTable;
*/
public class BinarySignator_1_0_0 implements Signator
{
+
+ private static Log log = LogFactory.getLog(BinarySignator_1_0_0.class);
+
/**
* The Pdf-AS ID of this Signator.
*/
@@ -100,10 +122,13 @@ public class BinarySignator_1_0_0 implements Signator
* @see at.gv.egiz.pdfas.framework.signator.Signator#prepareSign(at.gv.egiz.pdfas.framework.input.PdfDataSource,
* java.lang.String, at.knowcenter.wag.egov.egiz.pdf.TablePos, boolean)
*/
- public SignatorInformation prepareSign(PdfDataSource pdfDataSource, String profile, TablePos pos, boolean has_SIG_ID) throws SignatorException
+ public SignatorInformation prepareSign(PdfDataSource pdfDataSource, String profile, TablePos pos) throws SignatorException
{
try
{
+ // dferbas: has to be true everytime
+ boolean has_SIG_ID = true;
+
SignatureObject signature_object = PdfAS.createSignatureObjectFromType(profile);
signature_object.fillValues((char) BinarySignature.LAYOUT_PLACEHOLDER, has_SIG_ID);
@@ -240,6 +265,8 @@ public class BinarySignator_1_0_0 implements Signator
os.write(iui.signed_pdf);
os.close();
+
+
//SignResult sign_result = new SignResult(PdfAS.PDF_MIME_TYPE, iui.signed_pdf);
//return sign_result;
}