OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../resources/js-test.js"></script> |
| 5 <script src="resources/common.js"></script> |
| 6 </head> |
| 7 <body> |
| 8 <p id="description"></p> |
| 9 <div id="console"></div> |
| 10 |
| 11 <script> |
| 12 description("Importing an AES-CBC key with 'sign' usage is not allowed."); |
| 13 |
| 14 jsTestIsAsync = true; |
| 15 |
| 16 function importTestKey(usage) |
| 17 { |
| 18 var algorithm = {name: 'aes-cbc'}; |
| 19 var extractable = false; |
| 20 var keyData = new Uint8Array(16); |
| 21 |
| 22 // 'sign' is not applicable to AES-CBC and should be an error. |
| 23 var usages = ["encrypt", "decrypt", "sign"]; |
| 24 |
| 25 return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usage
s).then(failAndFinishJSTest, function(result) { |
| 26 debug("Failed importing AES-CBC key with usages: " + usages.join(",") +
" because: "); |
| 27 logError(result); |
| 28 }); |
| 29 } |
| 30 |
| 31 importTestKey().then(finishJSTest, failAndFinishJSTest); |
| 32 |
| 33 </script> |
| 34 |
| 35 </body> |
| 36 </html> |
OLD | NEW |