Loading CHANGES.md +3 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,9 @@ Version 1.5.2 To be released. - The `exportJwk()` function now populates the `alg` property of a returned `JsonWebKey` object with `"Ed25519"` if the input key is an Ed25519 key. Version 1.5.1 ------------- Loading src/runtime/key.test.ts +2 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ const ed25519Pem = "-----BEGIN PUBLIC KEY-----\n" + // cSpell: enable const ed25519Jwk = { alg: "Ed25519", kty: "OKP", crv: "Ed25519", // cSpell: disable Loading Loading @@ -159,6 +160,7 @@ test("exportMultibaseKey()", async () => { ); const ed25519Key2 = await importJwk({ alg: "Ed25519", crv: "Ed25519", ext: true, key_ops: ["verify"], Loading src/sig/key.ts +3 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,9 @@ export function generateCryptoKeyPair( */ export async function exportJwk(key: CryptoKey): Promise<JsonWebKey> { validateCryptoKey(key); return await crypto.subtle.exportKey("jwk", key); const jwk = await crypto.subtle.exportKey("jwk", key); if (jwk.crv === "Ed25519") jwk.alg = "Ed25519"; return jwk; } /** Loading Loading
CHANGES.md +3 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,9 @@ Version 1.5.2 To be released. - The `exportJwk()` function now populates the `alg` property of a returned `JsonWebKey` object with `"Ed25519"` if the input key is an Ed25519 key. Version 1.5.1 ------------- Loading
src/runtime/key.test.ts +2 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ const ed25519Pem = "-----BEGIN PUBLIC KEY-----\n" + // cSpell: enable const ed25519Jwk = { alg: "Ed25519", kty: "OKP", crv: "Ed25519", // cSpell: disable Loading Loading @@ -159,6 +160,7 @@ test("exportMultibaseKey()", async () => { ); const ed25519Key2 = await importJwk({ alg: "Ed25519", crv: "Ed25519", ext: true, key_ops: ["verify"], Loading
src/sig/key.ts +3 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,9 @@ export function generateCryptoKeyPair( */ export async function exportJwk(key: CryptoKey): Promise<JsonWebKey> { validateCryptoKey(key); return await crypto.subtle.exportKey("jwk", key); const jwk = await crypto.subtle.exportKey("jwk", key); if (jwk.crv === "Ed25519") jwk.alg = "Ed25519"; return jwk; } /** Loading