aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/knowcenter/wag/egov/egiz/sig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/sig')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/EnvelopingBase64MOAConnector.java13
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java13
2 files changed, 20 insertions, 6 deletions
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;