From a3d544d91319db8f3c78c69ce9721fd93fa488b3 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Wed, 12 Jul 2023 19:57:18 +0900 Subject: [PATCH] support uuid v4 kid --- src/index.html | 2 ++ src/main.ts | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/index.html b/src/index.html index adab252..03a764e 100644 --- a/src/index.html +++ b/src/index.html @@ -55,6 +55,8 @@ + + diff --git a/src/main.ts b/src/main.ts index 3e54e97..cddac1c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -27,12 +27,14 @@ async function onSubmit(e: SubmitEvent) { "rfc9278-s384": () => calculateJwkThumbprintUri(jwk, "sha384"), "rfc9278-s512": () => calculateJwkThumbprintUri(jwk, "sha512"), "date-time": () => new Date().toISOString(), + uuid: () => crypto.randomUUID(), + "uuid-uri": () => `urn:uuid:${crypto.randomUUID()}`, }[data.get("kid-method") as string]; const kid = await createKid?.(); privateKeyOutput.textContent = JSON.stringify( { ...{ alg, use, kid }, ...jwk }, null, - " " + " ", ); publicKeyOutput.textContent = JSON.stringify( { @@ -40,7 +42,7 @@ async function onSubmit(e: SubmitEvent) { ...(await exportJWK(publicKey)), }, null, - " " + " ", ); }