From 1ed2786b85d6f7dac5c83a1ba0474b7f33fa237c Mon Sep 17 00:00:00 2001 From: wprinz Date: Thu, 29 Jan 2009 13:47:42 +0000 Subject: api signatureKeyIdentifier override added, brz distribution assembly for maven, mime-type argument checking in SignResult constructor fixed git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@322 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../sig/connectors/moa/EnvelopingBase64MOAConnector.java | 13 ++++++++++--- .../sig/connectors/moa/MOASoapWithAttachmentConnector.java | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/sig') diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/EnvelopingBase64MOAConnector.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/EnvelopingBase64MOAConnector.java index 7d58d79..a6db63c 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/EnvelopingBase64MOAConnector.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/EnvelopingBase64MOAConnector.java @@ -63,7 +63,7 @@ public class EnvelopingBase64MOAConnector implements Connector public EnvelopingBase64MOAConnector(ConnectorParameters connectorParameters) throws ConnectorException { this.params = connectorParameters; - this.environment = new Environment(connectorParameters.getProfileId()); + this.environment = new Environment(connectorParameters.getProfileId(), connectorParameters.getSignatureKeyIdentifier()); } /** @@ -419,7 +419,7 @@ public class EnvelopingBase64MOAConnector implements Connector * @throws ConnectorException * f.e. */ - public Environment(String profile) throws ConnectorException + public Environment(String profile, String signKeyIdentifier) throws ConnectorException { this.profile = profile; @@ -433,7 +433,14 @@ public class EnvelopingBase64MOAConnector implements Connector throw new ConnectorException(300, e); } - this.sign_key_identifier = getConnectorValueFromProfile(settings, profile, SIGN_KEY_IDENTIFIER_KEY); + if (signKeyIdentifier != null) + { + this.sign_key_identifier = signKeyIdentifier; + } + else + { + this.sign_key_identifier = getConnectorValueFromProfile(settings, profile, SIGN_KEY_IDENTIFIER_KEY); + } String sign_request_filename = getConnectorValueFromProfile(settings, profile, SIGN_REQUEST_TEMPLATE_KEY); this.sign_request_template = FileHelper.readFromFile(SettingsReader.relocateFile(sign_request_filename)); 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 b45303d..7776698 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 @@ -77,7 +77,7 @@ public class MOASoapWithAttachmentConnector implements Connector public MOASoapWithAttachmentConnector(ConnectorParameters connectorParameters) throws ConnectorException { this.params = connectorParameters; - this.environment = new Environment(this.params.getProfileId(), MULTIPART_LOC_REF_CONTENT); + this.environment = new Environment(this.params.getProfileId(), this.params.getSignatureKeyIdentifier(), MULTIPART_LOC_REF_CONTENT); } protected String prepareSignRequest(SignatureData data) throws ConnectorException @@ -445,7 +445,7 @@ public class MOASoapWithAttachmentConnector implements Connector * @throws ConnectorException * f.e. */ - public Environment(String profile, String signature_data_url) throws ConnectorException + public Environment(String profile, String signKeyIdentifier, String signature_data_url) throws ConnectorException { this.profile = profile; @@ -461,7 +461,14 @@ public class MOASoapWithAttachmentConnector implements Connector throw new ConnectorException(300, e); } - this.sign_key_identifier = getConnectorValueFromProfile(settings, profile, SIGN_KEY_IDENTIFIER_KEY); + if (signKeyIdentifier != null) + { + this.sign_key_identifier = signKeyIdentifier; + } + else + { + this.sign_key_identifier = getConnectorValueFromProfile(settings, profile, SIGN_KEY_IDENTIFIER_KEY); + } String sign_request_filename = TEMPLATE_FILE_PREFIX + settings.getValueFromKey("default.moa.algorithm.id") + SIGN_TEMPLATE_FILE_SUFIX; -- cgit v1.2.3