aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main/java/at/gv
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-01-28 13:49:33 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-01-28 13:49:33 +0100
commite210f9d25fb530a2650059390f12a7e8ecec48b3 (patch)
tree39c889c93bfaf94691524cf541185b736fd63ade /pdf-as-lib/src/main/java/at/gv
parentf2d16430b03c38a55009bf5d157e41bfe04fcdf9 (diff)
downloadpdf-as-4-e210f9d25fb530a2650059390f12a7e8ecec48b3.tar.gz
pdf-as-4-e210f9d25fb530a2650059390f12a7e8ecec48b3.tar.bz2
pdf-as-4-e210f9d25fb530a2650059390f12a7e8ecec48b3.zip
PDF-AS cleanups
Diffstat (limited to 'pdf-as-lib/src/main/java/at/gv')
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java11
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java15
2 files changed, 21 insertions, 5 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java
index 284573e0..3f5888fc 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java
@@ -1,5 +1,6 @@
package at.gv.egiz.pdfas.lib.api;
+import iaik.cms.IaikCCProvider;
import iaik.security.ec.provider.ECCelerate;
import iaik.security.provider.IAIK;
@@ -40,16 +41,18 @@ public class PdfAsFactory {
static {
- System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
- System.out.println("+ PDF-AS: " + getVersion());
- System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
-
/*
* PropertyConfigurator.configure(ClassLoader
* .getSystemResourceAsStream("resources/log4j.properties"));
*/
IAIK.addAsProvider();
ECCelerate.addAsProvider();
+
+ System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
+ System.out.println("+ PDF-AS: " + getVersion());
+ System.out.println("+ IAIK-JCE Version: " + IAIK.getVersionInfo());
+ System.out.println("+ ECCelerate Version: " + ECCelerate.getInstance().getVersion());
+ System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
}
private static boolean log_configured = false;
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java
index 04b385f7..540fd572 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java
@@ -87,6 +87,14 @@ public class PdfAsImpl implements PdfAs, IConfigurationConstants {
}
}
+ if(parameter.getDataSource() == null || parameter.getDataSource().getByteData() == null) {
+ throw new PdfAsValidationException("error.pdf.sig.10", null);
+ }
+
+ if(parameter.getOutput() == null) {
+ throw new PdfAsValidationException("error.pdf.sig.11", null);
+ }
+
// TODO: verify Sign Parameter
}
@@ -96,6 +104,10 @@ public class PdfAsImpl implements PdfAs, IConfigurationConstants {
if (!(parameter.getConfiguration() instanceof ISettings)) {
throw new PdfAsSettingsException("Invalid settings object!");
}
+
+ if(parameter.getDataSource() == null || parameter.getDataSource().getByteData() == null) {
+ throw new PdfAsValidationException("error.pdf.verify.01", null);
+ }
// TODO: verify Verify Parameter
}
@@ -279,7 +291,8 @@ public class PdfAsImpl implements PdfAs, IConfigurationConstants {
public StatusRequest startSign(SignParameter parameter)
throws PdfAsException {
- // TODO: VERIFY PARAMETERS
+ verifySignParameter(parameter);
+
StatusRequestImpl request = new StatusRequestImpl();
try {