diff --git a/test/crypto.ts b/test/crypto.ts index 93b1280..69cde13 100644 --- a/test/crypto.ts +++ b/test/crypto.ts @@ -75,6 +75,18 @@ context("Crypto", () => { context("generateKey", () => { + it("RSA 3072bits", async () => { + const alg: globalThis.RsaHashedKeyGenParams = { + name: "RSASSA-PKCS1-v1_5", + hash: "SHA-256", + publicExponent: new Uint8Array([1,0,1]), + modulusLength: 3072, + }; + const keys = await crypto.subtle.generateKey(alg, false, ["sign", "verify"]); + + assert.strictEqual((keys.privateKey.algorithm as RsaHashedKeyAlgorithm).modulusLength, 3072); + }); + it("Ed25519", async () => { const keys = await crypto.subtle.generateKey({ name: "eddsa", namedCurve: "ed25519" } as globalThis.EcKeyGenParams, false, ["sign", "verify"]);