summaryrefslogtreecommitdiff
path: root/pdf-over-signator
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-over-signator')
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java6
-rw-r--r--pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignerFactory.java2
2 files changed, 4 insertions, 4 deletions
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java
index 31cf18be..798788d2 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/Signator.java
@@ -18,6 +18,8 @@ package at.asit.pdfover.signator;
//Imports
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.InvocationTargetException;
import java.util.EnumMap;
import java.util.Map;
@@ -55,12 +57,12 @@ public class Signator {
// SignerFactory factory = (SignerFactory)pdfAsClass.newInstance();
// registerSigner(Signers.PDFAS, factory);
Class<?> pdfAs4Class = Class.forName("at.asit.pdfover.signer.pdfas.PdfAs4SignerFactory");
- SignerFactory factory = (SignerFactory)pdfAs4Class.newInstance();
+ SignerFactory factory = (SignerFactory)pdfAs4Class.getDeclaredConstructor().newInstance();
registerSigner(Signers.PDFAS4, factory);
} catch (ClassNotFoundException e) {
log.error("PDF Signer Factory not found", e);
throw new RuntimeException("PDF Signer Factory not found", e);
- } catch (InstantiationException e) {
+ } catch (InstantiationException | InvocationTargetException | NoSuchMethodException e) {
log.error("PDF Signer Factory could not be instantiated", e);
throw new RuntimeException("PDF Signer Factory could not be instantiated", e);
} catch (IllegalAccessException e) {
diff --git a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignerFactory.java b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignerFactory.java
index 24b86300..cde150f8 100644
--- a/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignerFactory.java
+++ b/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignerFactory.java
@@ -15,8 +15,6 @@
*/
package at.asit.pdfover.signator;
-import at.asit.pdfover.signator.Signer;
-
/**
* A Signer factory
* Creates Signer instances