From 1b11b8777bb5f97277accd5d28851266d514211d Mon Sep 17 00:00:00 2001 From: ferbas Date: Thu, 10 Dec 2009 09:31:21 +0000 Subject: added atrust bku support git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@496 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../moa/MOASoapWithAttachmentConnector.java | 34 +++++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/knowcenter/wag') 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. * -- cgit v1.2.3