Loading CHANGES.md +3 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,9 @@ Version 1.0.25 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.0.24 -------------- Loading src/runtime/key.test.ts +2 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ const ed25519Pem = "-----BEGIN PUBLIC KEY-----\n" + // cSpell: enable const ed25519Jwk = { alg: "Ed25519", kty: "OKP", crv: "Ed25519", // cSpell: disable Loading Loading @@ -130,6 +131,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 @@ -93,7 +93,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.0.25 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.0.24 -------------- Loading
src/runtime/key.test.ts +2 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ const ed25519Pem = "-----BEGIN PUBLIC KEY-----\n" + // cSpell: enable const ed25519Jwk = { alg: "Ed25519", kty: "OKP", crv: "Ed25519", // cSpell: disable Loading Loading @@ -130,6 +131,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 @@ -93,7 +93,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