fix: 鍵の形式を修正3

This commit is contained in:
usbharu 2023-03-31 17:52:27 +09:00
parent aaedafff95
commit 9933434414
1 changed files with 3 additions and 3 deletions

View File

@ -91,13 +91,13 @@ class UserAuthService(
} }
public fun PublicKey.toPem(): String { public fun PublicKey.toPem(): String {
return "-----BEGIN PUBLIC KEY-----" + return "-----BEGIN PUBLIC KEY-----\n" +
Base64.getEncoder().encodeToString(encoded).chunked(64).joinToString("\n") + Base64.getEncoder().encodeToString(encoded).chunked(64).joinToString("\n") +
"-----END PUBLIC KEY-----" "\n-----END PUBLIC KEY-----\n"
} }
public fun PrivateKey.toPem(): String { public fun PrivateKey.toPem(): String {
return "-----BEGIN PRIVATE KEY-----" + return "-----BEGIN PRIVATE KEY-----" +
Base64.getEncoder().encodeToString(encoded).chunked(64).joinToString("\n") + Base64.getEncoder().encodeToString(encoded).chunked(64).joinToString("\n") +
"-----END PRIVATE KEY-----" "\n-----END PRIVATE KEY-----\n"
} }