commit e8b5e07b8f2d27a840848e01540a01dce45d2dc8
parent 0e3fc336694f42c2844b940015ec8e43b42f851c
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date: Thu, 21 Nov 2019 05:22:51 +0100
minor adjustement
Diffstat:
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/nexus/src/main/kotlin/JSON.kt b/nexus/src/main/kotlin/JSON.kt
@@ -15,10 +15,10 @@ data class EbicsBackupRequest(
* the client must provide the passphrase.
*/
data class EbicsKeysBackup(
- val passphrase: String? = null,
val authBlob: ByteArray,
val encBlob: ByteArray,
- val sigBlob: ByteArray
+ val sigBlob: ByteArray,
+ val passphrase: String? = null
)
/**
diff --git a/nexus/src/main/kotlin/Main.kt b/nexus/src/main/kotlin/Main.kt
@@ -751,21 +751,23 @@ fun main() {
val (authKey, encKey, sigKey) = try {
- val authKey = CryptoUtil.decryptKey(
- EncryptedPrivateKeyInfo(body.authBlob), body.passphrase!!
- )
+ Triple(
- val encKey = CryptoUtil.decryptKey(
- EncryptedPrivateKeyInfo(body.encBlob), body.passphrase
- )
+ CryptoUtil.decryptKey(
+ EncryptedPrivateKeyInfo(body.authBlob), body.passphrase!!
+ ),
- val sigKey = CryptoUtil.decryptKey(
- EncryptedPrivateKeyInfo(body.sigBlob), body.passphrase
- )
+ CryptoUtil.decryptKey(
+ EncryptedPrivateKeyInfo(body.encBlob), body.passphrase
+ ),
- Triple(authKey, encKey, sigKey)
+ CryptoUtil.decryptKey(
+ EncryptedPrivateKeyInfo(body.sigBlob), body.passphrase
+ )
+ )
} catch (e: Exception) {
+ e.printStackTrace()
throw BadBackup(HttpStatusCode.BadRequest)
}