<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[209749] trunk/LayoutTests</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/209749">209749</a></dd>
<dt>Author</dt> <dd>jiewen_tan@apple.com</dd>
<dt>Date</dt> <dd>2016-12-12 17:32:56 -0800 (Mon, 12 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WebCrypto] Migrate some tests from webkitSubtle to subtle
https://bugs.webkit.org/show_bug.cgi?id=165554

Reviewed by Brent Fulgham.

To improve test coverage for subtle.

* crypto/crypto-key-algorithm-gc-expected.txt: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt.
* crypto/crypto-key-algorithm-gc.html: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html.
* crypto/crypto-key-usages-gc-expected.txt: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt.
* crypto/crypto-key-usages-gc.html: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html.
* crypto/subtle/resources/rsa-indexeddb-non-exportable.js: Added.
* crypto/subtle/resources/rsa-indexeddb.js: Added.
* crypto/subtle/rsa-indexeddb-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-non-exportable-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-non-exportable-private.html: Added.
* crypto/subtle/rsa-indexeddb-non-exportable.html: Added.
* crypto/subtle/rsa-indexeddb-private-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-private.html: Added.
* crypto/subtle/rsa-indexeddb.html: Added.
* crypto/subtle/rsa-oaep-plaintext-length-expected.txt: Added.
* crypto/subtle/rsa-oaep-plaintext-length.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html: Added.
* platform/ios-simulator-wk1/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk1TestExpectations">trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscryptocryptokeyalgorithmgcexpectedtxt">trunk/LayoutTests/crypto/crypto-key-algorithm-gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptocryptokeyalgorithmgchtml">trunk/LayoutTests/crypto/crypto-key-algorithm-gc.html</a></li>
<li><a href="#trunkLayoutTestscryptocryptokeyusagesgcexpectedtxt">trunk/LayoutTests/crypto/crypto-key-usages-gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptocryptokeyusagesgchtml">trunk/LayoutTests/crypto/crypto-key-usages-gc.html</a></li>
<li>trunk/LayoutTests/crypto/subtle/resources/</li>
<li><a href="#trunkLayoutTestscryptosubtleresourcesrsaindexeddbnonexportablejs">trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb-non-exportable.js</a></li>
<li><a href="#trunkLayoutTestscryptosubtleresourcesrsaindexeddbjs">trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb.js</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbnonexportableexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivateexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivatehtml">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbnonexportablehtml">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbprivateexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbprivatehtml">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbhtml">trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepplaintextlengthexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepplaintextlengthhtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponentexpectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponenthtml">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscryptowebkitSubtlecryptokeyalgorithmgcexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlecryptokeyalgorithmgchtml">trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlecryptokeyusagesgcexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlecryptokeyusagesgchtml">trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (209748 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-12-13 01:05:15 UTC (rev 209748)
+++ trunk/LayoutTests/ChangeLog        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2016-12-07  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        [WebCrypto] Migrate some tests from webkitSubtle to subtle
+        https://bugs.webkit.org/show_bug.cgi?id=165554
+
+        Reviewed by Brent Fulgham.
+
+        To improve test coverage for subtle.
+
+        * crypto/crypto-key-algorithm-gc-expected.txt: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt.
+        * crypto/crypto-key-algorithm-gc.html: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html.
+        * crypto/crypto-key-usages-gc-expected.txt: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt.
+        * crypto/crypto-key-usages-gc.html: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html.
+        * crypto/subtle/resources/rsa-indexeddb-non-exportable.js: Added.
+        * crypto/subtle/resources/rsa-indexeddb.js: Added.
+        * crypto/subtle/rsa-indexeddb-expected.txt: Added.
+        * crypto/subtle/rsa-indexeddb-non-exportable-expected.txt: Added.
+        * crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt: Added.
+        * crypto/subtle/rsa-indexeddb-non-exportable-private.html: Added.
+        * crypto/subtle/rsa-indexeddb-non-exportable.html: Added.
+        * crypto/subtle/rsa-indexeddb-private-expected.txt: Added.
+        * crypto/subtle/rsa-indexeddb-private.html: Added.
+        * crypto/subtle/rsa-indexeddb.html: Added.
+        * crypto/subtle/rsa-oaep-plaintext-length-expected.txt: Added.
+        * crypto/subtle/rsa-oaep-plaintext-length.html: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html: Added.
+        * platform/ios-simulator-wk1/TestExpectations:
+
</ins><span class="cx"> 2016-12-12  Matt Baker  &lt;mattbaker@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, follow-up after r209706.
</span></span></pre></div>
<a id="trunkLayoutTestscryptocryptokeyalgorithmgcexpectedtxtfromrev209748trunkLayoutTestscryptowebkitSubtlecryptokeyalgorithmgcexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/crypto-key-algorithm-gc-expected.txt (from rev 209748, trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt) (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/crypto-key-algorithm-gc-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/crypto-key-algorithm-gc-expected.txt        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test that CryptoKey.algorithm preserves custom properties.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Generating a HMAC key with default length...
+PASS key.algorithm === key.algorithm is true
+PASS key.algorithm.foo is &quot;bar&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptocryptokeyalgorithmgchtmlfromrev209748trunkLayoutTestscryptowebkitSubtlecryptokeyalgorithmgchtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/crypto-key-algorithm-gc.html (from rev 209748, trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html) (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/crypto-key-algorithm-gc.html                                (rev 0)
+++ trunk/LayoutTests/crypto/crypto-key-algorithm-gc.html        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test that CryptoKey.algorithm preserves custom properties.&quot;);
+jsTestIsAsync = true;
+
+debug(&quot;\nGenerating a HMAC key with default length...&quot;);
+crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, true, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+    startTest();
+});
+
+function startTest()
+{
+    shouldBeTrue(&quot;key.algorithm === key.algorithm&quot;);
+    key.algorithm.foo = &quot;bar&quot;;
+    gc();
+    setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+    gc();
+    setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+    gc();
+    shouldBeEqualToString('key.algorithm.foo', 'bar');
+    finishJSTest();
+}
+
+&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptocryptokeyusagesgcexpectedtxtfromrev209748trunkLayoutTestscryptowebkitSubtlecryptokeyusagesgcexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/crypto-key-usages-gc-expected.txt (from rev 209748, trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt) (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/crypto-key-usages-gc-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/crypto-key-usages-gc-expected.txt        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test that CryptoKey.usages preserves custom properties.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Generating a HMAC key with default length...
+PASS key.usages === key.usages is true
+PASS key.usages.foo is &quot;bar&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptocryptokeyusagesgchtmlfromrev209748trunkLayoutTestscryptowebkitSubtlecryptokeyusagesgchtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/crypto-key-usages-gc.html (from rev 209748, trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html) (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/crypto-key-usages-gc.html                                (rev 0)
+++ trunk/LayoutTests/crypto/crypto-key-usages-gc.html        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test that CryptoKey.usages preserves custom properties.&quot;);
+jsTestIsAsync = true;
+
+debug(&quot;\nGenerating a HMAC key with default length...&quot;);
+crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, true, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+    startTest();
+});
+
+function startTest()
+{
+    shouldBeTrue(&quot;key.usages === key.usages&quot;);
+    key.usages.foo = &quot;bar&quot;;
+    gc();
+    setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+    gc();
+    setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+    gc();
+    shouldBeEqualToString('key.usages.foo', 'bar');
+    finishJSTest();
+}
+
+&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleresourcesrsaindexeddbnonexportablejs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb-non-exportable.js (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb-non-exportable.js                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb-non-exportable.js        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+description(&quot;Test storing a private RSA key in IndexedDB, and retrieving it.&quot;);
+
+jsTestIsAsync = true;
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;,
+    d: &quot;eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ&quot;,
+    p: &quot;4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0&quot;,
+    q: &quot;xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc&quot;,
+    dp: &quot;fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk&quot;,
+    dq: &quot;jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE&quot;,
+    qi: &quot;YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk&quot;
+};
+
+crypto.subtle.importKey(&quot;jwk&quot;, privateKeyJSON, { name: 'RSASSA-PKCS1-v1_5', hash: &quot;sha-256&quot; }, false, [&quot;sign&quot;]).then(function(key) {
+    var openRequest = indexedDB.open(&quot;crypto_subtle&quot;);
+    openRequest.onupgradeneeded = function(event) {
+        var objectStore = event.target.result.createObjectStore(&quot;rsa-indexeddb&quot;);
+    }
+    openRequest.onerror = function(event) {
+        testFailed(&quot;Could not open database: &quot; + event.target.error.name);
+        finishJSTest();
+    }
+    openRequest.onsuccess = function(event) {
+        db = event.target.result;
+        storeKey();
+    }
+
+    function storeKey() {
+        var objectStore = db.transaction(&quot;rsa-indexeddb&quot;, &quot;readwrite&quot;).objectStore(&quot;rsa-indexeddb&quot;);
+        var req = objectStore.put(key, &quot;mykey&quot;);
+        req.onerror = function(event) {
+            testFailed(&quot;Could not put a key into database: &quot; + event.target.error.name);
+            finishJSTest();
+        }
+        req.onsuccess = function(event) { readKey(); }
+    }
+
+    function readKey() {
+        var objectStore = db.transaction(&quot;rsa-indexeddb&quot;).objectStore(&quot;rsa-indexeddb&quot;);
+        var req = objectStore.get(&quot;mykey&quot;);
+        req.onerror = function(event) {
+            testFailed(&quot;Could not get a key from database: &quot; + event.target.error.name);
+            finishJSTest();
+        }
+        req.onsuccess = function(event) {
+            window.retrievedKey = event.target.result;
+            shouldBe(&quot;retrievedKey.type&quot;, &quot;'private'&quot;);
+            shouldBe(&quot;retrievedKey.extractable&quot;, &quot;false&quot;);
+            shouldBe(&quot;retrievedKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+            shouldBe(&quot;retrievedKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+            shouldBe(&quot;bytesToHexString(retrievedKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+            shouldBe(&quot;retrievedKey.algorithm.hash.name&quot;, &quot;'SHA-256'&quot;);
+            shouldBe(&quot;retrievedKey.usages&quot;, '[&quot;sign&quot;]');
+
+            finishJSTest();
+        }
+    }
+});
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleresourcesrsaindexeddbjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb.js (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb.js                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb.js        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+description(&quot;Test storing a private RSA key in IndexedDB, and retrieving it.&quot;);
+
+jsTestIsAsync = true;
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;,
+    d: &quot;eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ&quot;,
+    p: &quot;4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0&quot;,
+    q: &quot;xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc&quot;,
+    dp: &quot;fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk&quot;,
+    dq: &quot;jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE&quot;,
+    qi: &quot;YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk&quot;
+};
+
+crypto.subtle.importKey(&quot;jwk&quot;, privateKeyJSON, { name: 'RSASSA-PKCS1-v1_5', hash: &quot;sha-256&quot; }, true, [&quot;sign&quot;]).then(function(key) {
+    var openRequest = indexedDB.open(&quot;crypto_subtle&quot;);
+    openRequest.onupgradeneeded = function(event) {
+        var objectStore = event.target.result.createObjectStore(&quot;rsa-indexeddb&quot;);
+    }
+    openRequest.onerror = function(event) {
+        testFailed(&quot;Could not open database: &quot; + event.target.error.name);
+        finishJSTest();
+    }
+    openRequest.onsuccess = function(event) {
+        db = event.target.result;
+        storeKey();
+    }
+
+    function storeKey() {
+        var objectStore = db.transaction(&quot;rsa-indexeddb&quot;, &quot;readwrite&quot;).objectStore(&quot;rsa-indexeddb&quot;);
+        var req = objectStore.put(key, &quot;mykey&quot;);
+        req.onerror = function(event) {
+            testFailed(&quot;Could not put a key into database: &quot; + event.target.error.name);
+            finishJSTest();
+        }
+        req.onsuccess = function(event) { readKey(); }
+    }
+
+    function readKey() {
+        var objectStore = db.transaction(&quot;rsa-indexeddb&quot;).objectStore(&quot;rsa-indexeddb&quot;);
+        var req = objectStore.get(&quot;mykey&quot;);
+        req.onerror = function(event) {
+            testFailed(&quot;Could not get a key from database: &quot; + event.target.error.name);
+            finishJSTest();
+        }
+        req.onsuccess = function(event) {
+            window.retrievedKey = event.target.result;
+            shouldBe(&quot;retrievedKey.type&quot;, &quot;'private'&quot;);
+            shouldBe(&quot;retrievedKey.extractable&quot;, &quot;true&quot;);
+            shouldBe(&quot;retrievedKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+            shouldBe(&quot;retrievedKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+            shouldBe(&quot;bytesToHexString(retrievedKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+            shouldBe(&quot;retrievedKey.algorithm.hash.name&quot;, &quot;'SHA-256'&quot;);
+            shouldBe(&quot;retrievedKey.usages&quot;, '[&quot;sign&quot;]');
+
+            finishJSTest();
+        }
+    }
+}, failAndFinishJSTest);
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test storing a private RSA key in IndexedDB, and retrieving it.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS retrievedKey.type is 'private'
+PASS retrievedKey.extractable is true
+PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS retrievedKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
+PASS retrievedKey.algorithm.hash.name is 'SHA-256'
+PASS retrievedKey.usages is [&quot;sign&quot;]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbnonexportableexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test storing a private RSA key in IndexedDB, and retrieving it.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS retrievedKey.type is 'private'
+PASS retrievedKey.extractable is false
+PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS retrievedKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
+PASS retrievedKey.algorithm.hash.name is 'SHA-256'
+PASS retrievedKey.usages is [&quot;sign&quot;]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivateexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test storing a private RSA key in IndexedDB, and retrieving it.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS retrievedKey.type is 'private'
+PASS retrievedKey.extractable is false
+PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS retrievedKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
+PASS retrievedKey.algorithm.hash.name is 'SHA-256'
+PASS retrievedKey.usages is [&quot;sign&quot;]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivatehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+enablePrivateBrowsing = true;
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/rsa-indexeddb-non-exportable.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbnonexportablehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/rsa-indexeddb-non-exportable.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbprivateexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test storing a private RSA key in IndexedDB, and retrieving it.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS retrievedKey.type is 'private'
+PASS retrievedKey.extractable is true
+PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS retrievedKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
+PASS retrievedKey.algorithm.hash.name is 'SHA-256'
+PASS retrievedKey.usages is [&quot;sign&quot;]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbprivatehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+enablePrivateBrowsing = true;
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/rsa-indexeddb.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/rsa-indexeddb.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepplaintextlengthexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Test what happens when trying to encrypt a too large plain text with RSA-OAEP.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing RSA keys...
+Encrypting a 214 byte buffer with RSA-OAEP SHA-1, 2048 bit key...
+PASS Succeeded
+Encrypting a 215 byte buffer...
+PASS Rejected
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepplaintextlengthhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script&gt;
+description(&quot;Test what happens when trying to encrypt a too large plain text with RSA-OAEP.&quot;);
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+
+var extractable = true;
+
+debug(&quot;Importing RSA keys...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, publicKeyJSON, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;encrypt&quot;]).then(function(result) {
+    publicKey = result;
+
+    debug(&quot;Encrypting a 214 byte buffer with RSA-OAEP SHA-1, 2048 bit key...&quot;);
+    return crypto.subtle.encrypt(&quot;RSA-OAEP&quot;, publicKey, new Uint8Array(214));
+}).then(function(result) {
+    testPassed(&quot;Succeeded&quot;);
+    debug(&quot;Encrypting a 215 byte buffer...&quot;);
+    return crypto.subtle.encrypt(&quot;RSA-OAEP&quot;, publicKey, new Uint8Array(215));
+}).then(function(result) {
+    testFailed(&quot;Succeeded&quot;);
+    finishJSTest();
+}, function(result) {
+    testPassed(&quot;Rejected&quot;);
+    finishJSTest();
+});
+&lt;/script&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponentexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+Test generating an RSA key pair for RSASSA-PKCS1-v1_5 when exponent has leading zeroes.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Generating a key pair...
+PASS keyPair.toString() is '[object Object]'
+PASS keyPair.publicKey.type is 'public'
+PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS keyPair.publicKey.algorithm.modulusLength is 2048
+PASS keyPair.publicKey.algorithm.hash.name is 'SHA-1'
+PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
+PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponenthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html (0 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script&gt;
+description(&quot;Test generating an RSA key pair for RSASSA-PKCS1-v1_5 when exponent has leading zeroes.&quot;);
+
+jsTestIsAsync = true;
+
+var algorithmKeyGen = {
+    name: &quot;RSASSA-PKCS1-v1_5&quot;,
+    // RsaKeyGenParams
+    modulusLength: 2048,
+    publicExponent: new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01]),  // Equivalent to 65537
+    hash: &quot;sha-1&quot;,
+};
+var extractable = true;
+
+debug(&quot;Generating a key pair...&quot;);
+crypto.webkitSubtle.generateKey(algorithmKeyGen, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    keyPair = result;
+    shouldBe(&quot;keyPair.toString()&quot;, &quot;'[object Object]'&quot;);
+    shouldBe(&quot;keyPair.publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;keyPair.publicKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;keyPair.publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;keyPair.publicKey.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;bytesToHexString(keyPair.publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;bytesToHexString(keyPair.privateKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+
+    finishJSTest();
+});
+&lt;/script&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlecryptokeyalgorithmgcexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt (209748 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt        2016-12-13 01:05:15 UTC (rev 209748)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -1,13 +0,0 @@
</span><del>-Test that CryptoKey.algorithm preserves custom properties.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-
-Generating a HMAC key with default length...
-PASS key.algorithm === key.algorithm is true
-PASS key.algorithm.foo is &quot;bar&quot;
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlecryptokeyalgorithmgchtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html (209748 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html        2016-12-13 01:05:15 UTC (rev 209748)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test that CryptoKey.algorithm preserves custom properties.&quot;);
-jsTestIsAsync = true;
-
-debug(&quot;\nGenerating a HMAC key with default length...&quot;);
-crypto.webkitSubtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, true, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
-    key = result;
-    startTest();
-});
-
-function startTest()
-{
-    shouldBeTrue(&quot;key.algorithm === key.algorithm&quot;);
-    key.algorithm.foo = &quot;bar&quot;;
-    gc();
-    setTimeout(continueTest, 10);
-}
-
-function continueTest()
-{
-    gc();
-    setTimeout(finishTest, 10);
-}
-
-function finishTest()
-{
-    gc();
-    shouldBeEqualToString('key.algorithm.foo', 'bar');
-    finishJSTest();
-}
-
-&lt;/script&gt;
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlecryptokeyusagesgcexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt (209748 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt        2016-12-13 01:05:15 UTC (rev 209748)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -1,13 +0,0 @@
</span><del>-Test that CryptoKey.usages preserves custom properties.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-
-Generating a HMAC key with default length...
-PASS key.usages === key.usages is true
-PASS key.usages.foo is &quot;bar&quot;
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlecryptokeyusagesgchtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html (209748 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html        2016-12-13 01:05:15 UTC (rev 209748)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test that CryptoKey.usages preserves custom properties.&quot;);
-jsTestIsAsync = true;
-
-debug(&quot;\nGenerating a HMAC key with default length...&quot;);
-crypto.webkitSubtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, true, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
-    key = result;
-    startTest();
-});
-
-function startTest()
-{
-    shouldBeTrue(&quot;key.usages === key.usages&quot;);
-    key.usages.foo = &quot;bar&quot;;
-    gc();
-    setTimeout(continueTest, 10);
-}
-
-function continueTest()
-{
-    gc();
-    setTimeout(finishTest, 10);
-}
-
-function finishTest()
-{
-    gc();
-    shouldBeEqualToString('key.usages.foo', 'bar');
-    finishJSTest();
-}
-
-&lt;/script&gt;
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations (209748 => 209749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations        2016-12-13 01:05:15 UTC (rev 209748)
+++ trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations        2016-12-13 01:32:56 UTC (rev 209749)
</span><span class="lines">@@ -1021,6 +1021,10 @@
</span><span class="cx"> crypto/webkitSubtle/rsa-indexeddb.html
</span><span class="cx"> fast/history/page-cache-indexed-closed-db.html
</span><span class="cx"> fast/history/page-cache-indexed-opened-db.html
</span><ins>+crypto/subtle/rsa-indexeddb-non-exportable-private.html
+crypto/subtle/rsa-indexeddb-non-exportable.html
+crypto/subtle/rsa-indexeddb-private.html
+crypto/subtle/rsa-indexeddb.html
</ins><span class="cx"> 
</span><span class="cx"> # ShouldOpenExternalURLs not yet supported in WK1
</span><span class="cx"> loader/navigation-policy [ Skip ]
</span></span></pre>
</div>
</div>

</body>
</html>