From 11b7e91198296f9075a6eaebd0aec5ba83a3294a Mon Sep 17 00:00:00 2001 From: ferbas Date: Tue, 27 Oct 2009 11:05:24 +0000 Subject: 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 --- .../egiz/sig/connectors/ConnectorEnvironment.java | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/ConnectorEnvironment.java (limited to 'src') 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; + } + +} -- cgit v1.2.3