From 29453c9578d353c8a0cb422fe9ff4613982af877 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 10 Apr 2026 23:40:06 +0100 Subject: [PATCH] refactor: simplify device identity pem exports --- src/infra/device-identity.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/infra/device-identity.ts b/src/infra/device-identity.ts index f541e3b40931..b3579c394c83 100644 --- a/src/infra/device-identity.ts +++ b/src/infra/device-identity.ts @@ -56,8 +56,8 @@ function fingerprintPublicKey(publicKeyPem: string): string { function generateIdentity(): DeviceIdentity { const { publicKey, privateKey } = crypto.generateKeyPairSync("ed25519"); - const publicKeyPem = publicKey.export({ type: "spki", format: "pem" }).toString(); - const privateKeyPem = privateKey.export({ type: "pkcs8", format: "pem" }).toString(); + const publicKeyPem = publicKey.export({ type: "spki", format: "pem" }); + const privateKeyPem = privateKey.export({ type: "pkcs8", format: "pem" }); const deviceId = fingerprintPublicKey(publicKeyPem); return { deviceId, publicKeyPem, privateKeyPem }; }