Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / crypto / subtle / aes-cbc / wrap-rsa-non-extractable.html
blobf5d77c174ce6da9669a90f9d0e8290af82689eda
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>
11 <script>
12 description("Test wrapping an RSA key with AES-CBC.");
14 jsTestIsAsync = true;
16 var extractable = true;
17 var nonExtractable = false;
19 var publicKeyJSON = {
20 kty: "RSA",
21 alg: "RS256",
22 n: "rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw",
23 e: "AQAB",
24 ext: false,
25 use: "sig"
28 var wrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe1");
30 debug("Importing a key to wrap...");
32 var importAlgorithm = {name: 'RSASSA-PKCS1-v1_5', hash: {name: 'sha-256'} };
33 crypto.subtle.importKey("jwk", publicKeyJSON, importAlgorithm, nonExtractable, ["verify"]).then(function(result) {
34 key = result;
35 shouldBe("key.algorithm.name", "'RSASSA-PKCS1-v1_5'");
36 debug("Importing a key encryption key...");
37 return crypto.subtle.importKey("raw", wrappingKeyOctets, {name: "AES-CBC"}, nonExtractable, ["wrapKey"]);
38 }).then(function(result) {
39 wrappingKey = result;
40 shouldBe("wrappingKey.algorithm.name", "'AES-CBC'");
41 var wrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
42 debug("wrapping the key...");
43 return crypto.subtle.wrapKey("jwk", key, wrappingKey, wrapAlgorithm);
44 }).then(undefined, function(result) {
45 testPassed("Rejected: " + result);
46 }).then(finishJSTest, failAndFinishJSTest);
48 </script>
50 </body>
51 </html>