aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web-client/src/test/java
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-05-06 13:26:59 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-05-06 13:26:59 +0200
commita2b5bfc1203dfe53de937820d8b8dc59afbf56c3 (patch)
tree5f186cfffdf130371ae8c591714d9a55cb0ca082 /pdf-as-web-client/src/test/java
parent83ce097056ba90a2685fddaf384655cae39bd66b (diff)
downloadpdf-as-4-a2b5bfc1203dfe53de937820d8b8dc59afbf56c3.tar.gz
pdf-as-4-a2b5bfc1203dfe53de937820d8b8dc59afbf56c3.tar.bz2
pdf-as-4-a2b5bfc1203dfe53de937820d8b8dc59afbf56c3.zip
added web-client, java SOAP client library
Diffstat (limited to 'pdf-as-web-client/src/test/java')
-rw-r--r--pdf-as-web-client/src/test/java/at/gv/egiz/pdfas/web/client/test/SimpleTest.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/pdf-as-web-client/src/test/java/at/gv/egiz/pdfas/web/client/test/SimpleTest.java b/pdf-as-web-client/src/test/java/at/gv/egiz/pdfas/web/client/test/SimpleTest.java
new file mode 100644
index 00000000..954d0e2e
--- /dev/null
+++ b/pdf-as-web-client/src/test/java/at/gv/egiz/pdfas/web/client/test/SimpleTest.java
@@ -0,0 +1,39 @@
+package at.gv.egiz.pdfas.web.client.test;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.net.URL;
+
+import at.gv.egiz.pdfas.api.ws.PDFASSignParameters;
+import at.gv.egiz.pdfas.api.ws.PDFASSignParameters.Connector;
+import at.gv.egiz.pdfas.web.client.RemotePDFSigner;
+import sun.misc.IOUtils;
+
+public class SimpleTest {
+
+ public static void main(String[] args) {
+ try {
+ FileInputStream fis = new FileInputStream("/home/afitzek/simple.pdf");
+ byte[] inputData = IOUtils.readFully(fis, -1, true);
+
+ PDFASSignParameters signParameters = new PDFASSignParameters();
+ signParameters.setConnector(Connector.JKS);
+ signParameters.setPosition(null);
+ signParameters.setProfile("SIGNATURBLOCK_DE");
+
+ URL endpoint = new URL("http://localhost:8080/pdf-as-web/wssign?wsdl");
+
+ RemotePDFSigner signer = new RemotePDFSigner(endpoint, false);
+
+ byte[] outputFile = signer.signPDFDokument(inputData, signParameters);
+
+ FileOutputStream fos = new FileOutputStream("/home/afitzek/signed.pdf");
+ fos.write(outputFile);
+ fos.close();
+
+ } catch(Throwable e) {
+ e.printStackTrace();
+ }
+ }
+
+}