support timestamp kid

This commit is contained in:
Nebel 2023-07-12 20:26:13 +09:00
parent ac69439c0a
commit 8824791622
Signed by: nebel
GPG key ID: 79807D08C6EF6460
2 changed files with 6 additions and 2 deletions

View file

@ -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>

View file

@ -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(