aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-cli/src/main/java/at/gv
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-cli/src/main/java/at/gv')
-rw-r--r--pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/DeveloperMain.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/DeveloperMain.java b/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/DeveloperMain.java
index 4b9a4e33..0e114eae 100644
--- a/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/DeveloperMain.java
+++ b/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/DeveloperMain.java
@@ -15,8 +15,9 @@ import at.gv.egiz.pdfas.lib.api.PdfAs;
import at.gv.egiz.pdfas.lib.api.PdfAsFactory;
import at.gv.egiz.pdfas.lib.api.sign.IPlainSigner;
import at.gv.egiz.pdfas.lib.api.sign.SignParameter;
-import at.gv.egiz.pdfas.lib.impl.signing.IPdfSigner;
-import at.gv.egiz.pdfas.lib.impl.signing.sig_interface.JKSSigner;
+import at.gv.egiz.pdfas.lib.api.verify.VerifyParameter;
+import at.gv.egiz.pdfas.lib.impl.VerifyParameterImpl;
+import at.gv.egiz.pdfas.sigs.pkcs7detached.PKCS7DetachedSigner;
public class DeveloperMain {
@@ -34,7 +35,7 @@ public class DeveloperMain {
Configuration config = pdfas.getConfiguration();
byte[] data;
try {
- IPlainSigner signer = new JKSSigner(keyStoreFile, keyAlias, keyStorePass, keyPass, keyStoreType);
+ IPlainSigner signer = new PKCS7DetachedSigner(keyStoreFile, keyAlias, keyStorePass, keyPass, keyStoreType);
data = StreamUtils.inputStreamToByteArray(new FileInputStream("/home/afitzek/devel/pdfas_neu/simple.pdf"));
SignParameter parameter = PdfAsFactory.createSignParameter(config, new ByteArrayDataSource(data));
ByteArrayDataSink bads = new ByteArrayDataSink();
@@ -45,6 +46,10 @@ public class DeveloperMain {
FileOutputStream fos = new FileOutputStream("/home/afitzek/devel/pdfas_neu/simple_out.pdf");
fos.write(bads.getData());
fos.close();
+
+ VerifyParameter verify = new VerifyParameterImpl(config, new ByteArrayDataSource(bads.getData()));
+ pdfas.verify(verify);
+
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();