From 5e0264a94511844742b09eb4c61940e8b4e10fbd Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Thu, 23 Apr 2015 17:46:37 +0200 Subject: X14 handling MOA --- .../moa/MOASoapWithAttachmentConnector.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java') diff --git a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java index 99b39f7..3f24ec1 100644 --- a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java +++ b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java @@ -270,9 +270,11 @@ public class MOASoapWithAttachmentConnector implements Connector { log.debug("MOA signature detected."); return prepareXMLContent(data, so); } else if (SigKZIDHelper.isMOAXAdES14Signed(so)) { - log.debug("The signature is MOA XAdES 1.4 signed -> getting XML content from DetachedLocRefMOA connector."); + log.debug("The signature is MOA XAdES 1.4 signed -> getting different verify template"); + this.environment.loadXades14(); DetachedLocRefMOAConnector moa_conn = new DetachedLocRefMOAConnector( this.environment.getProfile(), "loc ref not needed here"); + moa_conn.loadXades14(); return moa_conn.prepareXMLContent(data, so); // ATRUST // MOCCA @@ -694,6 +696,24 @@ public class MOASoapWithAttachmentConnector implements Connector { } + public void loadXades14() throws ConnectorException { + + SettingsReader settings = null; + try { + settings = SettingsReader.getInstance(); + } catch (SettingsException e) { + throw new ConnectorException(300, e); + } + + String verify_filename = TEMPLATE_FILE_PREFIX + + DetachedLocRefMOAIdFormatter.SIG_ID_X14_PREFIX + + VERIFY_TEMPLATE_SUFIX; + // this.verify_template = + // FileHelper.readFromFile(SettingsReader.relocateFile(verify_filename)); + this.verify_template = settings + .readInternalResourceAsString(verify_filename); + } + public String getProfile() { return this.profile; } -- cgit v1.2.3