summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2012-12-21 15:05:48 +0000
committertkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2012-12-21 15:05:48 +0000
commitb61707b8dad60b339c4ef0f7f694cea92a362bfb (patch)
treee8d7560dfe296307ab7a767436c5155eb3c457b8
parent7114731dfeaadc52d937f4db7531e792ed1a53ff (diff)
downloadmocca-b61707b8dad60b339c4ef0f7f694cea92a362bfb.tar.gz
mocca-b61707b8dad60b339c4ef0f7f694cea92a362bfb.tar.bz2
mocca-b61707b8dad60b339c4ef0f7f694cea92a362bfb.zip
Append -X14 to UA string when using XAdES1.4
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1157 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java17
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateXMLSignatureCommandImpl.java4
2 files changed, 14 insertions, 7 deletions
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java b/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java
index 3534636a..baadcc7d 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java
@@ -103,7 +103,7 @@ public class HTTPBindingProcessorImpl extends AbstractBindingProcessor implement
* The citizen card environment identifier for <code>Server</code> and
* <code>UserAgent</code> headers.
*/
- protected static String CITIZENC_CARD_ENVIRONMENT = "citizen-card-environment/1.2";
+ protected static String CITIZEN_CARD_ENVIRONMENT = "citizen-card-environment/1.2";
/**
* The configuration facade used to access the MOCCA configuration.
@@ -118,6 +118,8 @@ public class HTTPBindingProcessorImpl extends AbstractBindingProcessor implement
public static final String USE_STYLESHEETURL_PROPERTY = "UseStylesheetURL";
+ public static final String USE_XADES_1_4 = "UseXAdES14";
+
public int getMaxDataUrlHops() {
return configuration.getInt(DATAURLCLIENT_MAXHOPS, 10);
}
@@ -129,10 +131,9 @@ public class HTTPBindingProcessorImpl extends AbstractBindingProcessor implement
}
public String getProductVersion() {
- return configuration
- .getString(
- ConfigurationFactoryBean.MOCCA_IMPLEMENTATIONVERSION_PROPERTY,
- "UNKNOWN");
+ return configuration.getString(
+ ConfigurationFactoryBean.MOCCA_IMPLEMENTATIONVERSION_PROPERTY,
+ "UNKNOWN") + (getUseXAdES14() ? "-X14" : "");
}
public String getSignatureLayout() {
@@ -164,6 +165,10 @@ public class HTTPBindingProcessorImpl extends AbstractBindingProcessor implement
}
return false;
}
+
+ public boolean getUseXAdES14() {
+ return configuration.getBoolean(USE_XADES_1_4, false);
+ }
}
/**
@@ -615,7 +620,7 @@ public class HTTPBindingProcessorImpl extends AbstractBindingProcessor implement
//----------------------------------------------------------------------------
public String getServerHeaderValue() {
- return CITIZENC_CARD_ENVIRONMENT + " "
+ return CITIZEN_CARD_ENVIRONMENT + " "
+ configurationFacade.getProductName() + "/"
+ configurationFacade.getProductVersion();
}
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateXMLSignatureCommandImpl.java b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateXMLSignatureCommandImpl.java
index 903eae18..ffea6213 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateXMLSignatureCommandImpl.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateXMLSignatureCommandImpl.java
@@ -42,6 +42,7 @@ import org.w3c.dom.ls.LSSerializer;
import at.buergerkarte.namespaces.securitylayer._1.CreateXMLSignatureRequestType;
import at.buergerkarte.namespaces.securitylayer._1.DataObjectInfoType;
+import at.gv.egiz.bku.binding.HTTPBindingProcessorImpl;
import at.gv.egiz.bku.conf.MoccaConfigurationFacade;
import at.gv.egiz.bku.slcommands.CreateXMLSignatureCommand;
import at.gv.egiz.bku.slcommands.SLCommandContext;
@@ -98,7 +99,8 @@ public class CreateXMLSignatureCommandImpl extends
private Configuration configuration;
public static final String USE_STRONG_HASH = "UseStrongHash";
- public static final String USE_XADES_1_4 = "UseXAdES14";
+ public static final String USE_XADES_1_4 =
+ HTTPBindingProcessorImpl.ConfigurationFacade.USE_XADES_1_4;
public void setConfiguration(Configuration configuration) {
this.configuration = configuration;