gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: key-rotation endpoint (testing)


From: gnunet
Subject: [libeufin] branch master updated: key-rotation endpoint (testing)
Date: Fri, 16 Jul 2021 17:05:24 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 48a8a49  key-rotation endpoint (testing)
48a8a49 is described below

commit 48a8a49fae84624f32f4ca294af8774643bbdf9c
Author: ms <ms@taler.net>
AuthorDate: Fri Jul 16 17:05:13 2021 +0200

    key-rotation endpoint (testing)
---
 .../src/main/kotlin/tech/libeufin/sandbox/Main.kt  | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index 2f41e58..f1836f0 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -652,6 +652,31 @@ fun serverMain(dbName: String, port: Int) {
                 call.respond(ret)
                 return@get
             }
+            post("/admin/ebics/hosts/{hostID}/rotate-keys") {
+                val hostID: String = call.parameters["hostID"] ?: throw 
SandboxError(
+                    HttpStatusCode.BadRequest, "host ID missing in URL"
+                )
+                transaction {
+                    val host = EbicsHostEntity.find {
+                        EbicsHostsTable.hostID eq hostID
+                    }.firstOrNull() ?: throw SandboxError(
+                        HttpStatusCode.NotFound, "Host $hostID not found"
+                    )
+                    val pairA = CryptoUtil.generateRsaKeyPair(2048)
+                    val pairB = CryptoUtil.generateRsaKeyPair(2048)
+                    val pairC = CryptoUtil.generateRsaKeyPair(2048)
+                    host.authenticationPrivateKey = 
ExposedBlob(pairA.private.encoded)
+                    host.encryptionPrivateKey = 
ExposedBlob(pairB.private.encoded)
+                    host.signaturePrivateKey = 
ExposedBlob(pairC.private.encoded)
+                }
+                call.respondText(
+                    "Keys of '${hostID}' rotated.",
+                    ContentType.Text.Plain,
+                    HttpStatusCode.OK
+                )
+                return@post
+            }
+
             /**
              * Creates a new EBICS host.
              */

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]