summaryrefslogtreecommitdiff
path: root/STALService
diff options
context:
space:
mode:
Diffstat (limited to 'STALService')
-rw-r--r--STALService/src/main/java/at/gv/egiz/stal/service/translator/STALTranslator.java2
-rw-r--r--STALService/src/main/java/at/gv/egiz/stal/service/types/SignRequestType.java30
-rw-r--r--STALService/src/test/java/at/gv/egiz/stal/service/translator/STALTranslatorTest.java3
3 files changed, 34 insertions, 1 deletions
diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/translator/STALTranslator.java b/STALService/src/main/java/at/gv/egiz/stal/service/translator/STALTranslator.java
index 28d60ed6..5ddadbe7 100644
--- a/STALService/src/main/java/at/gv/egiz/stal/service/translator/STALTranslator.java
+++ b/STALService/src/main/java/at/gv/egiz/stal/service/translator/STALTranslator.java
@@ -224,6 +224,7 @@ public class STALTranslator {
signedInfo.setIsCMSSignedAttributes(((SignRequest) request).getSignedInfo().isIsCMSSignedAttributes());
req.setSignedInfo(signedInfo);
req.setSignatureMethod(((SignRequest) request).getSignatureMethod());
+ req.setDigestMethod(((SignRequest) request).getDigestMethod());
//TODO add hashdatainput (refactor signRequestType)
return of.createGetNextRequestResponseTypeSignRequest(req);
} else if (request instanceof InfoboxReadRequest) {
@@ -255,6 +256,7 @@ public class STALTranslator {
signedInfo.setIsCMSSignedAttributes(((SignRequestType) request).getSignedInfo().isIsCMSSignedAttributes());
stalReq.setSignedInfo(signedInfo);
stalReq.setSignatureMethod(((SignRequestType) request).getSignatureMethod());
+ stalReq.setDigestMethod(((SignRequestType) request).getDigestMethod());
return stalReq;
} else if (request instanceof QuitRequestType) {
return new QuitRequest();
diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/SignRequestType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/SignRequestType.java
index 50a00406..67755d69 100644
--- a/STALService/src/main/java/at/gv/egiz/stal/service/types/SignRequestType.java
+++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/SignRequestType.java
@@ -61,6 +61,7 @@ import javax.xml.bind.annotation.XmlValue;
* </complexType>
* </element>
* <element name="SignatureMethod" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * <element name="DigestMethod" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
@@ -73,7 +74,8 @@ import javax.xml.bind.annotation.XmlValue;
@XmlType(name = "SignRequestType", propOrder = {
"keyIdentifier",
"signedInfo",
- "signatureMethod"
+ "signatureMethod",
+ "digestMethod"
})
public class SignRequestType
extends RequestType
@@ -85,6 +87,8 @@ public class SignRequestType
protected SignRequestType.SignedInfo signedInfo;
@XmlElement(name = "SignatureMethod")
protected String signatureMethod;
+ @XmlElement(name = "DigestMethod")
+ protected String digestMethod;
/**
* Gets the value of the keyIdentifier property.
@@ -158,6 +162,30 @@ public class SignRequestType
this.signatureMethod = value;
}
+ /**
+ * Gets the value of the digestMethod property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDigestMethod() {
+ return digestMethod;
+ }
+
+ /**
+ * Sets the value of the digestMethod property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDigestMethod(String value) {
+ this.digestMethod = value;
+ }
+
/**
* <p>Java class for anonymous complex type.
diff --git a/STALService/src/test/java/at/gv/egiz/stal/service/translator/STALTranslatorTest.java b/STALService/src/test/java/at/gv/egiz/stal/service/translator/STALTranslatorTest.java
index 98d301a7..a82006fc 100644
--- a/STALService/src/test/java/at/gv/egiz/stal/service/translator/STALTranslatorTest.java
+++ b/STALService/src/test/java/at/gv/egiz/stal/service/translator/STALTranslatorTest.java
@@ -106,6 +106,7 @@ public class STALTranslatorTest {
assertEquals(request.getSignedInfo().getValue(), resultT.getSignedInfo().getValue());
assertEquals(request.getSignedInfo().isIsCMSSignedAttributes(), resultT.getSignedInfo().isIsCMSSignedAttributes());
assertEquals(request.getSignatureMethod(), resultT.getSignatureMethod());
+ assertEquals(request.getDigestMethod(), resultT.getDigestMethod());
}
/**
@@ -120,6 +121,7 @@ public class STALTranslatorTest {
signedInfo.setValue("signedinfo".getBytes());
req.setSignedInfo(signedInfo);
req.setSignatureMethod("signatureMethod");
+ req.setDigestMethod("digestMethod");
JAXBElement<? extends RequestType> request = of.createGetNextRequestResponseTypeSignRequest(req);
STALTranslator instance = new STALTranslator();
STALRequest result = instance.translateWSRequest(request);
@@ -128,6 +130,7 @@ public class STALTranslatorTest {
assertEquals(req.getSignedInfo().getValue(), ((SignRequest) result).getSignedInfo().getValue());
assertEquals(req.getSignedInfo().isIsCMSSignedAttributes(), ((SignRequest) result).getSignedInfo().isIsCMSSignedAttributes());
assertEquals(req.getSignatureMethod(), ((SignRequest) result).getSignatureMethod());
+ assertEquals(req.getDigestMethod(), ((SignRequest) result).getDigestMethod());
}
@Test(expected=RuntimeException.class)