From 887db080d03671c339ab729ba4276ba21278b317 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Sat, 29 Apr 2023 16:47:58 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=8D=B5=E3=82=92=E5=BC=B7=E5=9B=BA?= =?UTF-8?q?=E3=81=AB=E3=80=81PEM=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dev/usbharu/hideout/service/impl/UserAuthService.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/service/impl/UserAuthService.kt b/src/main/kotlin/dev/usbharu/hideout/service/impl/UserAuthService.kt index 74355630..60aa97a4 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/impl/UserAuthService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/impl/UserAuthService.kt @@ -31,7 +31,7 @@ class UserAuthService( override suspend fun generateKeyPair(): KeyPair { val keyPairGenerator = KeyPairGenerator.getInstance("RSA") - keyPairGenerator.initialize(1024) + keyPairGenerator.initialize(2048) return keyPairGenerator.generateKeyPair() } @@ -44,11 +44,11 @@ class UserAuthService( fun PublicKey.toPem(): String { return "-----BEGIN PUBLIC KEY-----\n" + Base64.getEncoder().encodeToString(encoded).chunked(64).joinToString("\n") + - "\n-----END PUBLIC KEY-----" + "\n-----END PUBLIC KEY-----\n" } fun PrivateKey.toPem(): String { return "-----BEGIN PRIVATE KEY-----\n" + Base64.getEncoder().encodeToString(encoded).chunked(64).joinToString("\n") + - "\n-----END PRIVATE KEY-----" + "\n-----END PRIVATE KEY-----\n" }