aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/knowcenter/wag/egov/egiz/framework/SignatorFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/framework/SignatorFactory.java')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/framework/SignatorFactory.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/framework/SignatorFactory.java b/src/main/java/at/knowcenter/wag/egov/egiz/framework/SignatorFactory.java
index fbba7dc..a9bc144 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/framework/SignatorFactory.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/framework/SignatorFactory.java
@@ -21,6 +21,7 @@ import at.knowcenter.wag.egov.egiz.PdfASID;
import at.knowcenter.wag.egov.egiz.exceptions.SignatorFactoryException;
import at.knowcenter.wag.egov.egiz.framework.signators.BinarySignator_1_0_0;
import at.knowcenter.wag.egov.egiz.framework.signators.DetachedSignator_1_0_0;
+import at.knowcenter.wag.egov.egiz.framework.signators.DetachedfTextualSignator_1_0_0;
import at.knowcenter.wag.egov.egiz.framework.signators.TextualSignator_1_0_0;
/**
@@ -50,6 +51,11 @@ public abstract class SignatorFactory
* This signator is only for testing the framework.
*/
public static final String TYPE_TEST = "testalgo";
+
+ /**
+ * This signator is only for testing the framework.
+ */
+ public static final String TYPE_DETACHED_TEXTUAL = "detachedtext";
/**
* This application's current algorithm versions.
@@ -72,6 +78,12 @@ public abstract class SignatorFactory
public static final PdfASID MOST_RECENT_DETACHED_SIGNATOR_ID = DetachedSignator_1_0_0.MY_ID;
/**
+ * The most recent test algorithm this application provides.
+ */
+ public static final PdfASID MOST_RECENT_DETACHEDTEXT_SIGNATOR_ID = DetachedfTextualSignator_1_0_0.MY_ID;
+
+
+ /**
* Creates a Signator for the given ID.
*
* @param id
@@ -116,6 +128,16 @@ public abstract class SignatorFactory
throw new SignatorFactoryException("The version '" + id.getVersion() + "' of type '" + id.getType() + "' is not supported by this SignatorFactory. (id='" + id + "')");
}
+
+ if (id.getType().equals(TYPE_DETACHED_TEXTUAL))
+ {
+ if (id.getVersion().equals(VERSION_1_0_0))
+ {
+ return new DetachedfTextualSignator_1_0_0();
+ }
+
+ throw new SignatorFactoryException("The version '" + id.getVersion() + "' of type '" + id.getType() + "' is not supported by this SignatorFactory. (id='" + id + "')");
+ }
throw new SignatorFactoryException("The type '" + id.getType() + "' is not supported by this SignatorFactory. (id='" + id + "')");
}