libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit deca4cbdc5219cc209d78ac8f8210f63e2631099
parent 6cb403f8e8caa481c475f42006e9bbd115f88e30
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Fri,  8 Nov 2019 11:59:21 +0100

minor fixes to /sync.  Keys extraction missing.

Diffstat:
Mnexus/src/main/kotlin/Main.kt | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/nexus/src/main/kotlin/Main.kt b/nexus/src/main/kotlin/Main.kt @@ -322,7 +322,7 @@ fun main() { // _parse_ response! // respond to client val id = expectId(call.parameters["id"]) - val (url, body, encPriv) = transaction { + val (url, body, encPrivBlob) = transaction { val subscriber = EbicsSubscriberEntity.findById(id) ?: throw SubscriberNotFoundError(HttpStatusCode.NotFound) val hpbRequest = EbicsNpkdRequest().apply { version = "H004" @@ -349,9 +349,9 @@ fun main() { val hpbDoc = XMLUtil.parseStringIntoDom(hpbText) XMLUtil.signEbicsDocument( hpbDoc, - CryptoUtil.loadRsaPrivateKey(subscriber.signaturePrivateKey.toByteArray()) + CryptoUtil.loadRsaPrivateKey(subscriber.authenticationPrivateKey.toByteArray()) ) - Triple(subscriber.ebicsURL, hpbDoc, subscriber.encryptionPrivateKey) + Triple(subscriber.ebicsURL, hpbDoc, subscriber.encryptionPrivateKey.toByteArray()) } val response = client.postToBank<EbicsKeyManagementResponse>(url, body) ?: throw UnreachableBankError( @@ -366,10 +366,10 @@ fun main() { response.value.body.dataTransfer!!.dataEncryptionInfo!!.transactionKey, (response.value.body.dataTransfer!!.dataEncryptionInfo as EbicsTypes.DataEncryptionInfo) .encryptionPubKeyDigest.value, - (response.value.body.dataTransfer as EbicsKeyManagementResponse.OrderData).value + response.value.body.dataTransfer!!.orderData.value ) - var dataCompr = CryptoUtil.decryptEbicsE002(er, CryptoUtil.loadRsaPrivateKey(encPriv.toByteArray())) + var dataCompr = CryptoUtil.decryptEbicsE002(er, CryptoUtil.loadRsaPrivateKey(encPrivBlob)) var data = EbicsOrderUtil.decodeOrderDataXml<HPBResponseOrderData>(dataCompr) call.respond(HttpStatusCode.NotImplemented, NexusError("work in progress"))