| <script src="../../resources/js-test-pre.js"></script> |
| <script src="../resources/common.js"></script> |
| description("Test generating an RSA key pair for RSASSA-PKCS1-v1_5 when exponent has leading zeroes."); |
| name: "RSASSA-PKCS1-v1_5", |
| publicExponent: new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01]), // Equivalent to 65537 |
| debug("Generating a key pair..."); |
| crypto.subtle.generateKey(algorithmKeyGen, extractable, ["sign", "verify"]).then(function(result) { |
| shouldBe("keyPair.toString()", "'[object Object]'"); |
| shouldBe("keyPair.publicKey.type", "'public'"); |
| shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'"); |
| shouldBe("keyPair.publicKey.algorithm.modulusLength", "2048"); |
| shouldBe("keyPair.publicKey.algorithm.hash.name", "'SHA-1'"); |
| shouldBe("bytesToHexString(keyPair.publicKey.algorithm.publicExponent)", "'010001'"); |
| shouldBe("bytesToHexString(keyPair.privateKey.algorithm.publicExponent)", "'010001'"); |
| <script src="../../resources/js-test-post.js"></script> |