OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../fast/js/resources/js-test-pre.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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 return crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256' }, le
ngth:48 }, false, ['sign']); | 84 return crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256' }, le
ngth:48 }, false, ['sign']); |
85 }).then(function(result) { | 85 }).then(function(result) { |
86 key = result; | 86 key = result; |
87 shouldBe("key.type", "'private'") | 87 shouldBe("key.type", "'private'") |
88 shouldBe("key.extractable", "false") | 88 shouldBe("key.extractable", "false") |
89 shouldBe("key.algorithm.name", "'HMAC'") | 89 shouldBe("key.algorithm.name", "'HMAC'") |
90 shouldBe("key.algorithm.hash.name", "'SHA-256'") | 90 shouldBe("key.algorithm.hash.name", "'SHA-256'") |
91 shouldBe("key.algorithm.length", "48") | 91 shouldBe("key.algorithm.length", "48") |
92 shouldBe("key.usages.join(',')", "'sign'") | 92 shouldBe("key.usages.join(',')", "'sign'") |
| 93 |
| 94 return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength:
10, publicExponent: new Uint8Array([0])}, false, ['sign']); |
| 95 }).then(function(result) { |
| 96 keyPair = result; |
| 97 |
| 98 shouldBeDefined("keyPair.publicKey"); |
| 99 shouldBeDefined("keyPair.privateKey"); |
| 100 |
| 101 shouldBe("keyPair.publicKey.type", "'public'"); |
| 102 shouldBe("keyPair.publicKey.algorithm.name", "'RSASSA-PKCS1-v1_5'"); |
| 103 |
| 104 shouldBe("keyPair.privateKey.type", "'private'"); |
| 105 shouldBe("keyPair.privateKey.algorithm.name", "'RSASSA-PKCS1-v1_5'"); |
| 106 |
| 107 // KeyPair should return the same Key wrapper |
| 108 keyPair.publicKey.foo = "bar"; |
| 109 shouldBe("keyPair.publicKey.foo", "'bar'"); |
| 110 if (window.gc) { |
| 111 window.gc(); |
| 112 window.gc(); |
| 113 } |
| 114 shouldBe("keyPair.publicKey.foo", "'bar'"); |
| 115 |
93 }).then(finishJSTest, failAndFinishJSTest); | 116 }).then(finishJSTest, failAndFinishJSTest); |
94 | 117 |
95 </script> | 118 </script> |
96 | 119 |
97 <script src="../fast/js/resources/js-test-post.js"></script> | 120 <script src="../fast/js/resources/js-test-post.js"></script> |
98 </body> | 121 </body> |
99 </html> | 122 </html> |
OLD | NEW |