mirror of
https://github.com/kou029w/jwk.pages.dev.git
synced 2025-01-31 06:18:06 +00:00
support uuid v4 kid
This commit is contained in:
parent
69897675e5
commit
a3d544d913
2 changed files with 6 additions and 2 deletions
|
@ -55,6 +55,8 @@
|
||||||
<option value="rfc9278-s384">JWK Thumbprint URI (SHA-384)</option>
|
<option value="rfc9278-s384">JWK Thumbprint URI (SHA-384)</option>
|
||||||
<option value="rfc9278-s512">JWK Thumbprint URI (SHA-512)</option>
|
<option value="rfc9278-s512">JWK Thumbprint URI (SHA-512)</option>
|
||||||
<option value="date-time">Date and Time</option>
|
<option value="date-time">Date and Time</option>
|
||||||
|
<option value="uuid">UUID</option>
|
||||||
|
<option value="uuid-uri">UUID URI</option>
|
||||||
<option value="">-</option>
|
<option value="">-</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
|
|
|
@ -27,12 +27,14 @@ async function onSubmit(e: SubmitEvent) {
|
||||||
"rfc9278-s384": () => calculateJwkThumbprintUri(jwk, "sha384"),
|
"rfc9278-s384": () => calculateJwkThumbprintUri(jwk, "sha384"),
|
||||||
"rfc9278-s512": () => calculateJwkThumbprintUri(jwk, "sha512"),
|
"rfc9278-s512": () => calculateJwkThumbprintUri(jwk, "sha512"),
|
||||||
"date-time": () => new Date().toISOString(),
|
"date-time": () => new Date().toISOString(),
|
||||||
|
uuid: () => crypto.randomUUID(),
|
||||||
|
"uuid-uri": () => `urn:uuid:${crypto.randomUUID()}`,
|
||||||
}[data.get("kid-method") as string];
|
}[data.get("kid-method") as string];
|
||||||
const kid = await createKid?.();
|
const kid = await createKid?.();
|
||||||
privateKeyOutput.textContent = JSON.stringify(
|
privateKeyOutput.textContent = JSON.stringify(
|
||||||
{ ...{ alg, use, kid }, ...jwk },
|
{ ...{ alg, use, kid }, ...jwk },
|
||||||
null,
|
null,
|
||||||
" "
|
" ",
|
||||||
);
|
);
|
||||||
publicKeyOutput.textContent = JSON.stringify(
|
publicKeyOutput.textContent = JSON.stringify(
|
||||||
{
|
{
|
||||||
|
@ -40,7 +42,7 @@ async function onSubmit(e: SubmitEvent) {
|
||||||
...(await exportJWK(publicKey)),
|
...(await exportJWK(publicKey)),
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
" "
|
" ",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue