| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
| 5 <script src="resources/common.js"></script> | 5 <script src="resources/common.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body> | 7 <body> |
| 8 <p id="description"></p> | 8 <p id="description"></p> |
| 9 <div id="console"></div> | 9 <div id="console"></div> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 return crypto.subtle.exportKey("", key); | 39 return crypto.subtle.exportKey("", key); |
| 40 }).then(failAndFinishJSTest, function(result) { | 40 }).then(failAndFinishJSTest, function(result) { |
| 41 logError(result); | 41 logError(result); |
| 42 return crypto.subtle.exportKey("foobar", key); | 42 return crypto.subtle.exportKey("foobar", key); |
| 43 }).then(failAndFinishJSTest, function(result) { | 43 }).then(failAndFinishJSTest, function(result) { |
| 44 logError(result); | 44 logError(result); |
| 45 | 45 |
| 46 debug("\nExporting the key as JWK..."); | 46 debug("\nExporting the key as JWK..."); |
| 47 return crypto.subtle.exportKey("jwk", key); | 47 return crypto.subtle.exportKey("jwk", key); |
| 48 }).then(function(result) { | 48 }).then(function(result) { |
| 49 exportedJWK = JSON.parse(bytesToASCIIString(result)); | 49 exportedJWK = result; |
| 50 | 50 |
| 51 shouldBe("exportedJWK.kty", "'RSA'"); | 51 shouldBe("exportedJWK.kty", "'RSA'"); |
| 52 shouldBe("exportedJWK.n", "publicKeyJSON.n"); | 52 shouldBe("exportedJWK.n", "publicKeyJSON.n"); |
| 53 shouldBe("exportedJWK.e", "publicKeyJSON.e"); | 53 shouldBe("exportedJWK.e", "publicKeyJSON.e"); |
| 54 shouldBe("exportedJWK.alg", "'RS256'"); | 54 shouldBe("exportedJWK.alg", "'RS256'"); |
| 55 shouldBe("exportedJWK.ext", "true"); | 55 shouldBe("exportedJWK.ext", "true"); |
| 56 shouldBe("exportedJWK.use", "undefined"); | 56 shouldBe("exportedJWK.use", "undefined"); |
| 57 shouldBe("exportedJWK.key_ops", "['verify']"); | 57 shouldBe("exportedJWK.key_ops", "['verify']"); |
| 58 }).then(finishJSTest, failAndFinishJSTest); | 58 }).then(finishJSTest, failAndFinishJSTest); |
| 59 </script> | 59 </script> |
| 60 | 60 |
| 61 </body> | 61 </body> |
| 62 </html> | 62 </html> |
| OLD | NEW |