aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/DetachedLocRefMOAConnector.java
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/DetachedLocRefMOAConnector.java')
-rw-r--r--pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/DetachedLocRefMOAConnector.java48
1 files changed, 28 insertions, 20 deletions
diff --git a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/DetachedLocRefMOAConnector.java b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/DetachedLocRefMOAConnector.java
index ea90841..07e9ccd 100644
--- a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/DetachedLocRefMOAConnector.java
+++ b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/DetachedLocRefMOAConnector.java
@@ -55,7 +55,7 @@ import at.knowcenter.wag.egov.egiz.tools.FileHelper;
/**
* Connects to MOA providing the Data detached as LocRef on a local resource.
- *
+ *
* @author wprinz
*/
public class DetachedLocRefMOAConnector implements Connector
@@ -79,12 +79,12 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Constructor that builds the configuration environment for this connector
* according to the given profile.
- *
+ *
* <p>
* If confuguration parameters are not defined on that profile, the default
* parameters defined in the configuration are used.
* </p>
- *
+ *
* @param profile
* The profile from which the Environment should be assembled.
* @throws SettingsException
@@ -183,7 +183,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Prepares the verify request xml to be sent using the verify request
* template.
- *
+ *
* @param data
* The SignatureData.
* @param so
@@ -206,7 +206,11 @@ public class DetachedLocRefMOAConnector implements Connector
xml_content = chooseAndCreateXMLDsig(data, so);
}
- String verify_request_xml = verify_request_template.replaceFirst(TemplateReplaces.XML_CONTENT_REPLACE, xml_content);
+ // fixed by dti: Issuer names may contain escapted commas ("\,"). As far as replaceFirst (and replaceAll)
+ // methods are regarded, backslashes in the replacement string may cause the results to be different than
+ // if it were being treated as a literal replacement string.
+// String verify_request_xml = verify_request_template.replaceFirst(TemplateReplaces.XML_CONTENT_REPLACE, xml_content);
+ String verify_request_xml = verify_request_template.replace(TemplateReplaces.XML_CONTENT_REPLACE, xml_content);
verify_request_xml = verify_request_xml.replaceFirst(TemplateReplaces.TRUST_PROFILE_ID_REPLACE, this.environment.getVerifyTrustProfileId());
verify_request_xml = verify_request_xml.replaceFirst(TemplateReplaces.LOC_REF_CONTENT_REPLACE, this.environment.getSignatureDataUrl());
@@ -217,7 +221,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Analyzes the verify response string.
- *
+ *
* @param response_properties
* The response properties containing the response XML.
* @return Returns the SignatureResponse containing the verification result.
@@ -272,7 +276,11 @@ public class DetachedLocRefMOAConnector implements Connector
// Qualified Properties replaces
verify_xml = verify_xml.replaceFirst(TemplateReplaces.SIGNING_TIME_REPLACE, so.getDate());
verify_xml = verify_xml.replaceFirst(TemplateReplaces.DIGEST_VALUE_CERTIFICATE_REPLACE, certDigest);
- verify_xml = verify_xml.replaceFirst(TemplateReplaces.X509_ISSUER_NAME_REPLACE, so.getIssuer());
+ // fixed by dti: Issuer names may contain escapted commas ("\,"). As far as replaceFirst (and replaceAll)
+ // methods are regarded, backslashes in the replacement string may cause the results to be different than
+ // if it were being treated as a literal replacement string.
+// verify_xml = verify_xml.replaceFirst(TemplateReplaces.X509_ISSUER_NAME_REPLACE, so.getIssuer());
+ verify_xml = verify_xml.replace(TemplateReplaces.X509_ISSUER_NAME_REPLACE, so.getIssuer());
verify_xml = verify_xml.replaceFirst(TemplateReplaces.X509_SERIAL_NUMBER_REPLACE, so.getSerialNumber());
// SigDataRefReplace already done above
verify_xml = verify_xml.replaceFirst(TemplateReplaces.MIME_TYPE_REPLACE, data.getMimeType());
@@ -323,7 +331,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Holds environment configuration information like templates.
- *
+ *
* @author wprinz
*/
public static class Environment extends ConnectorEnvironment
@@ -417,7 +425,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Initializes the environment with a given profile.
- *
+ *
* @param profile
* The configuration profile.
* @throws SettingsException
@@ -516,7 +524,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Returns the URL where to load the detached data from.
- *
+ *
* @return Returns the URL where to load the detached data from.
*/
public String getSignatureDataUrl()
@@ -526,7 +534,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Returns the sign key identifier.
- *
+ *
* @return Returns the sign key identifier.
*/
public String getSignKeyIdentifier()
@@ -536,7 +544,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Returns the sign request template.
- *
+ *
* @return Returns the sign request template.
*/
public String getSignRequestTemplate()
@@ -546,7 +554,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Returns the sign URL.
- *
+ *
* @return Returns the sign URL.
*/
public String getSignURL()
@@ -556,7 +564,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Returns the verify request template.
- *
+ *
* @return Returns the verify request template.
*/
public String getVerifyRequestTemplate()
@@ -566,7 +574,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Returns the verify template.
- *
+ *
* @return Returns the verify template.
*/
public String getVerifyTemplate()
@@ -576,7 +584,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Returns the verify URL.
- *
+ *
* @return Returns the verify URL.
*/
public String getVerifyURL()
@@ -586,7 +594,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Returns the verify trust profile id.
- *
+ *
* @return Returns the verify trust profile id.
*/
public String getVerifyTrustProfileId()
@@ -596,7 +604,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Returns the ecdsa cert alg property.
- *
+ *
* @return Returns the ecdsa cert alg property.
*/
public String getCertAlgEcdsa()
@@ -606,7 +614,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Returns the rsa cert alg property.
- *
+ *
* @return Returns the rsa cert alg property.
*/
public String getCertAlgRsa()
@@ -617,7 +625,7 @@ public class DetachedLocRefMOAConnector implements Connector
/**
* Reads the configuration entry given by the key, first from the given
* profile, if not found from the defaults.
- *
+ *
* @param settings
* The settings.
* @param profile