4 <script src="../../resources/js-test-pre.js"></script>
5 <script src="../resources/common.js"></script>
8 <p id="description"></p>
9 <div id="console"></div>
12 description("Test importing a JWK RSA-OAEP public key with SHA-1 and then export it in JWK format");
19 key_ops: ["encrypt", "wrapKey"],
21 n: "p55Xl-DyqKL06TE8GCuXd_e-ruTqVB19iDH6DwTIknTyM0fl8EY6qsyOBNTxjpLDsOldEJ8QblG78WY7xYTZtNn-fimz5eG80bwSZ6FUO10z3ikeKzPPC7K4AA196rMoiEu2G4mSfqeg5zz6_iqHf8u_md_n8yk_iPaXJ9RVT-W4zEQQ6WSlsOtYa7blSSAlq0JYDJciNeE0RGqUU-UjcxUWIEnT2ODHGRzSfKHgc8O3fGt4dpVm0op1yItBcSAY-0_f1p_YrVDo8bsyq2uodyDGYhcuQgYJ0NjMgT_rb8rUPpR3bUitd-IZJd_NO9i_NmvbnQfgl6kfnxe_2kM4Tw",
24 var extractable = true;
26 debug("Importing a key...");
27 crypto.subtle.importKey("jwk", jwkKey, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]).then(function(cryptoKey) {
28 debug("Exporting a key...");
29 return crypto.subtle.exportKey("jwk", cryptoKey);
30 }).then(function(result) {
31 exportedJwkKey = result;
33 shouldBe("exportedJwkKey.kty", "jwkKey.kty");
34 shouldBe("exportedJwkKey.alg", "jwkKey.alg");
35 shouldBe("exportedJwkKey.key_ops", "jwkKey.key_ops");
36 shouldBe("exportedJwkKey.ext", "jwkKey.ext");
37 shouldBe("exportedJwkKey.n", "jwkKey.n");
38 shouldBe("exportedJwkKey.e", "jwkKey.e");
45 <script src="../../resources/js-test-post.js"></script>