summaryrefslogtreecommitdiff
path: root/smccSTAL/src/main/java
diff options
context:
space:
mode:
authortkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2013-12-13 04:06:05 +0000
committertkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2013-12-13 04:06:05 +0000
commit438727ab21b5e80d1771279b988d6aed57ba3ab1 (patch)
tree1de5dc68467b378d7ece4a1119ac539dca6462c9 /smccSTAL/src/main/java
parentda6c49cbea9c80ad057a5fc3b698ce14ad9a7415 (diff)
downloadmocca-438727ab21b5e80d1771279b988d6aed57ba3ab1.tar.gz
mocca-438727ab21b5e80d1771279b988d6aed57ba3ab1.tar.bz2
mocca-438727ab21b5e80d1771279b988d6aed57ba3ab1.zip
Add ExcludedByteRange to STAL SignatureRequest, honour it for digest calculation
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1264 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'smccSTAL/src/main/java')
-rw-r--r--smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java
index dba822ea..3026d27a 100644
--- a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java
+++ b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java
@@ -67,7 +67,6 @@ public class SignRequestHandler extends AbstractRequestHandler {
private final static Logger log = LoggerFactory.getLogger(SignRequestHandler.class);
private final static String CMS_DEF_SIGNEDINFO_ID = "SignedInfo-1";
- private final static String CMS_DEF_OBJECT_ID = "SignatureData-1";
private final static String OID_MESSAGEDIGEST = "1.2.840.113549.1.9.4";
private static JAXBContext jaxbContext;
@@ -178,7 +177,6 @@ public class SignRequestHandler extends AbstractRequestHandler {
List<ReferenceType> references = signedInfo.getReference();
ReferenceType reference = new ReferenceType();
reference.setId(HashDataInput.CMS_DEF_REFERENCE_ID);
- reference.setURI(CMS_DEF_OBJECT_ID);
DigestMethodType digestMethod = new DigestMethodType();
digestMethod.setAlgorithm(signReq.getDigestMethod());
reference.setDigestMethod(digestMethod);
@@ -204,6 +202,13 @@ public class SignRequestHandler extends AbstractRequestHandler {
throw new SignatureException(e);
}
reference.setDigestValue(messageDigest);
+ if (signReq.getExcludedByteRange() != null) {
+ // Abuse URI to store ExcludedByteRange
+ String range = "CMSExcludedByteRange:" +
+ signReq.getExcludedByteRange().getFrom() + "-" +
+ signReq.getExcludedByteRange().getTo();
+ reference.setURI(range);
+ }
references.add(reference);
return signedInfo;
}