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/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;
}