aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-sig-lib
diff options
context:
space:
mode:
Diffstat (limited to 'moaSig/moa-sig-lib')
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java
index cb77ad1..32eab9e 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java
@@ -28,6 +28,7 @@ import iaik.server.modules.algorithms.HashAlgorithms;
import iaik.server.modules.keys.KeyEntryID;
import iaik.server.modules.keys.KeyModule;
import iaik.server.modules.keys.KeyModuleFactory;
+import iaik.server.modules.xml.Canonicalization;
import iaik.server.modules.xmlsign.SignatureStructureTypes;
import iaik.server.modules.xmlsign.XMLSignatureCreationProfile;
import iaik.server.modules.xmlsign.XMLSignatureInsertionLocation;
@@ -57,6 +58,7 @@ import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider;
import at.gv.egovernment.moa.spss.server.config.KeyGroup;
import at.gv.egovernment.moa.spss.server.config.KeyGroupEntry;
import at.gv.egovernment.moa.spss.server.iaik.xml.CanonicalizationImpl;
+import at.gv.egovernment.moa.spss.server.iaik.xml.ExclusiveCanonicalizationImpl;
import at.gv.egovernment.moa.spss.server.iaik.xmlsign.DataObjectTreatmentImpl;
import at.gv.egovernment.moa.spss.server.iaik.xmlsign.XMLSignatureCreationProfileImpl;
import at.gv.egovernment.moa.spss.server.iaik.xmlsign.XMLSignatureInsertionLocationImpl;
@@ -136,7 +138,6 @@ public class XMLSignatureCreationProfileFactory {
TransactionContext context =
TransactionContextManager.getInstance().getTransactionContext();
ConfigurationProvider config = context.getConfiguration();
- CanonicalizationImpl canonicalization;
List dataObjectTreatmentList;
Set keySet;
List transformationSupplements;
@@ -234,9 +235,17 @@ public class XMLSignatureCreationProfileFactory {
getSignatureInsertionLocationIndex(singleSignatureInfo));
// set the canonicalization algorithm
- canonicalization =
- new CanonicalizationImpl(config.getCanonicalizationAlgorithmName());
- profile.setSignedInfoCanonicalization(canonicalization);
+ String canonicalizationURI = config.getCanonicalizationAlgorithmName();
+ if (Canonicalization.ALL_EXCLUSIVE.contains(canonicalizationURI)) {
+ ExclusiveCanonicalizationImpl canonicalization = new ExclusiveCanonicalizationImpl(config.getCanonicalizationAlgorithmName(), null);
+ profile.setSignedInfoCanonicalization(canonicalization);
+
+ } else {
+ CanonicalizationImpl canonicalization =
+ new CanonicalizationImpl(config.getCanonicalizationAlgorithmName());
+ profile.setSignedInfoCanonicalization(canonicalization);
+
+ }
// set the signed properties
profile.setSignedProperties(Collections.EMPTY_LIST);