aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorferbas <ferbas@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2009-10-27 11:05:24 +0000
committerferbas <ferbas@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2009-10-27 11:05:24 +0000
commit11b7e91198296f9075a6eaebd0aec5ba83a3294a (patch)
tree576cf825c0f6387c5f8638295de60434fcb238c2 /src/main
parentec73a69c7f87aa63564978b6a0579b589ccc429a (diff)
downloadpdf-as-3-11b7e91198296f9075a6eaebd0aec5ba83a3294a.tar.gz
pdf-as-3-11b7e91198296f9075a6eaebd0aec5ba83a3294a.tar.bz2
pdf-as-3-11b7e91198296f9075a6eaebd0aec5ba83a3294a.zip
introduced common base class for connector environments
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@359 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/ConnectorEnvironment.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/ConnectorEnvironment.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/ConnectorEnvironment.java
new file mode 100644
index 0000000..71fc16e
--- /dev/null
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/ConnectorEnvironment.java
@@ -0,0 +1,29 @@
+package at.knowcenter.wag.egov.egiz.sig.connectors;
+
+import java.security.cert.X509Certificate;
+
+/**
+ * Base class for connector environments
+ *
+ * @author dferbas
+ *
+ */
+public abstract class ConnectorEnvironment {
+
+ public abstract String getCertAlgEcdsa();
+
+ public abstract String getCertAlgRsa();
+
+ public abstract String getVerifyTemplate();
+
+ public String getDefaultAlgForCert(X509Certificate cert) {
+ String cert_alg;
+ cert_alg = getCertAlgEcdsa();
+ if (cert.getPublicKey().getAlgorithm().indexOf("RSA") >= 0) //$NON-NLS-1$
+ {
+ cert_alg = getCertAlgRsa();
+ }
+ return cert_alg;
+ }
+
+}