aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorferbas <ferbas@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2009-12-10 09:31:21 +0000
committerferbas <ferbas@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2009-12-10 09:31:21 +0000
commit1b11b8777bb5f97277accd5d28851266d514211d (patch)
tree8d2516662acfd20ca44cbc1ffeb83524e648c331
parent97f4037b8988d36ab791de20fe221dbabcd55ff1 (diff)
downloadpdf-as-3-1b11b8777bb5f97277accd5d28851266d514211d.tar.gz
pdf-as-3-1b11b8777bb5f97277accd5d28851266d514211d.tar.bz2
pdf-as-3-1b11b8777bb5f97277accd5d28851266d514211d.zip
added atrust bku support
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@496 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java
index 9cd8ccc..cece8ca 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java
@@ -9,7 +9,6 @@ import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import at.gv.egiz.pdfas.algorithmSuite.AlgorithmMapper;
import at.gv.egiz.pdfas.algorithmSuite.AlgorithmSuiteObject;
import at.gv.egiz.pdfas.algorithmSuite.AlgorithmSuiteUtil;
import at.gv.egiz.pdfas.exceptions.ErrorCode;
@@ -30,7 +29,6 @@ import at.knowcenter.wag.egov.egiz.sig.connectors.mocca.LocRefDetachedMOCCAConne
import at.knowcenter.wag.egov.egiz.sig.sigid.DetachedLocRefMOAIdFormatter;
import at.knowcenter.wag.egov.egiz.sig.sigkz.SigKZIDHelper;
import at.knowcenter.wag.egov.egiz.tools.CodingHelper;
-import at.knowcenter.wag.egov.egiz.tools.FileHelper;
/**
* Connects to MOA providing the Data detached as LocRef on a local resource.
@@ -39,7 +37,9 @@ import at.knowcenter.wag.egov.egiz.tools.FileHelper;
*/
public class MOASoapWithAttachmentConnector implements Connector
{
- /**
+ public static final String ATRUST_VERIFY_TEMPLATE_KEY = "atrust.verify.template.detached";
+
+/**
* The SIG_ID prefix.
*/
// public static final String SIG_ID_PREFIX = "etsi-bku-detached@"; //$NON-NLS-1$
@@ -197,7 +197,13 @@ public class MOASoapWithAttachmentConnector implements Connector
log.debug("Algorithm = " + algorithmId);
LocRefDetachedMOCCAConnector mocca_connector = new LocRefDetachedMOCCAConnector(this.params, "not needed here", algorithmId);
xml_content = mocca_connector.prepareXMLContent(data, so);
-
+
+ // ATrust
+ } else if (SigKZIDHelper.isATrustSigned(so)) {
+ log.debug("A-Trust signature detected.");
+ this.environment.reInitVerifyTemplate(ATRUST_VERIFY_TEMPLATE_KEY);
+ xml_content = prepareXMLContent(data, so);
+
// TD
} else {
log.debug("TD signature signature detected.");
@@ -348,6 +354,10 @@ public class MOASoapWithAttachmentConnector implements Connector
throw new ConnectorException(330, e);
}
}
+
+ public void reInitVerifyTemplate(String templatePropKey) throws ConnectorException {
+ this.environment.reInitVerifyTemplate(templatePropKey);
+ }
/**
* Holds environment configuration information like templates.
@@ -443,6 +453,22 @@ public class MOASoapWithAttachmentConnector implements Connector
protected String cert_alg_rsa = null;
+
+ public void reInitVerifyTemplate(String templatePropKey) throws ConnectorException {
+ SettingsReader settings = null;
+ try
+ {
+ settings = SettingsReader.getInstance();
+ }
+ catch (SettingsException e)
+ {
+ throw new ConnectorException(300, e);
+ }
+
+ String verify_request_filename = getConnectorValueFromProfile(settings, this.profile, templatePropKey);
+ this.verify_template = settings.readInternalResourceAsString(verify_request_filename);
+
+ }
/**
* Initializes the environment with a given profile.
*