commit 265887f763d21b0d966928df07663e476f548491
parent 9d0ea4ac586ef68ccf63269bcf11c2aa04bf866c
Author: Florian Dold <florian.dold@gmail.com>
Date: Wed, 6 Nov 2019 13:00:16 +0100
fix JAXB error
Diffstat:
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -341,6 +341,30 @@ private suspend fun ApplicationCall.ebicsweb() {
}
}
"ebicsRequest" -> {
+ println("ebicsRequest ${XMLUtil.convertDomToString(requestDocument)}")
+ val requestObject = requestDocument.toObject<EbicsRequest>()
+ val staticHeader = requestObject.header.static
+ when (requestObject.header.mutable.transactionPhase) {
+ EbicsTypes.TransactionPhaseType.INITIALISATION -> {
+ val partnerID = staticHeader.partnerID ?: throw EbicsInvalidXmlError()
+ val userID = staticHeader.userID ?: throw EbicsInvalidXmlError()
+ transaction {
+ val subscriber =
+ findEbicsSubscriber(partnerID, userID, staticHeader.systemID)
+ ?: throw EbicsInvalidXmlError()
+ val authPub =
+ CryptoUtil.loadRsaPublicKey(subscriber.authenticationKey!!.rsaPublicKey.toByteArray())
+ val verifyResult = XMLUtil.verifyEbicsDocument(requestDocument, authPub)
+ println("ebicsRequest verification result: $verifyResult")
+ }
+ }
+ EbicsTypes.TransactionPhaseType.TRANSFER -> {
+
+ }
+ EbicsTypes.TransactionPhaseType.RECEIPT -> {
+
+ }
+ }
}
else -> {
/* Log to console and return "unknown type" */
diff --git a/sandbox/src/main/kotlin/tech/libeufin/schema/ebics_s001/EbicsMessages.kt b/sandbox/src/main/kotlin/tech/libeufin/schema/ebics_s001/EbicsMessages.kt
@@ -31,8 +31,7 @@ import javax.xml.datatype.XMLGregorianCalendar
@XmlType(
name = "PubKeyValueType", namespace = "http://www.ebics.org/S001", propOrder = [
"rsaKeyValue",
- "timeStamp",
- "any"
+ "timeStamp"
]
)
class PubKeyValueType {
@@ -73,7 +72,7 @@ class SignaturePubKeyInfoType {
@XmlAccessorType(XmlAccessType.NONE)
@XmlType(
name = "",
- propOrder = ["signaturePubKeyInfo", "partnerID", "userID", "any"]
+ propOrder = ["signaturePubKeyInfo", "partnerID", "userID"]
)
@XmlRootElement(name = "SignaturePubKeyOrderData")
class SignaturePubKeyOrderData {