| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../../resources/js-test-pre.js"></script> |
| <script src="../resources/common.js"></script> |
| </head> |
| <body> |
| <p id="description"></p> |
| <div id="console"></div> |
| |
| <script> |
| description("Test AES-KW WrapKey operation with malformed parameters"); |
| |
| jsTestIsAsync = true; |
| |
| var extractable = true; |
| var rawKey = asciiToUint8Array("jnOw99oOZFLIEPMr"); |
| |
| crypto.subtle.importKey("raw", rawKey, "aes-kw", extractable, ["wrapKey", "unwrapKey"]).then(function(result) { |
| wrappingKey = result; |
| return crypto.subtle.importKey("raw", rawKey, "aes-cbc", extractable, ["encrypt", "decrypt"]); |
| }).then(function(result) { |
| key = result; |
| shouldReject('crypto.subtle.wrapKey("jwk", key, wrappingKey, "AES-KW")').then(finishJSTest); |
| }); |
| |
| </script> |
| |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |