mirror of
https://github.com/kou029w/jwk.pages.dev.git
synced 2025-01-30 22:08:01 +00:00
support timestamp kid
This commit is contained in:
parent
ac69439c0a
commit
8824791622
2 changed files with 6 additions and 2 deletions
|
@ -54,9 +54,11 @@
|
|||
<option value="rfc9278-s256">JWK Thumbprint URI (SHA-256)</option>
|
||||
<option value="rfc9278-s384">JWK Thumbprint URI (SHA-384)</option>
|
||||
<option value="rfc9278-s512">JWK Thumbprint URI (SHA-512)</option>
|
||||
<option value="date-time">Date and Time</option>
|
||||
<option value="uuid">UUID</option>
|
||||
<option value="uuid-uri">UUID URI</option>
|
||||
<option value="unix-timestamp">Timestamp</option>
|
||||
<option value="ecma-timestamp">Timestamp (milliseconds)</option>
|
||||
<option value="date-time">Date and Time</option>
|
||||
<option value="">-</option>
|
||||
</select>
|
||||
</label>
|
||||
|
|
|
@ -26,9 +26,11 @@ async function onSubmit(e: SubmitEvent) {
|
|||
"rfc9278-s256": () => calculateJwkThumbprintUri(jwk, "sha256"),
|
||||
"rfc9278-s384": () => calculateJwkThumbprintUri(jwk, "sha384"),
|
||||
"rfc9278-s512": () => calculateJwkThumbprintUri(jwk, "sha512"),
|
||||
"date-time": () => new Date().toISOString(),
|
||||
uuid: () => crypto.randomUUID(),
|
||||
"uuid-uri": () => `urn:uuid:${crypto.randomUUID()}`,
|
||||
"unix-timestamp": () => String(Math.floor(new Date().getTime() / 1_000)),
|
||||
"ecma-timestamp": () => String(new Date().getTime()),
|
||||
"date-time": () => new Date().toISOString(),
|
||||
}[data.get("kid-method") as string];
|
||||
const kid = await createKid?.();
|
||||
privateKeyOutput.textContent = JSON.stringify(
|
||||
|
|
Loading…
Add table
Reference in a new issue