<!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>[208548] trunk</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/208548">208548</a></dd>
<dt>Author</dt> <dd>jiewen_tan@apple.com</dd>
<dt>Date</dt> <dd>2016-11-10 10:36:44 -0800 (Thu, 10 Nov 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update SubtleCrypto::importKey to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164446
&lt;rdar://problem/29123621&gt;

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch does following few things:
1. It updates the SubtleCrypto::importKey method to match the latest spec:
   https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey.
   It also refers to the latest Editor's Draft at a certain degree:
   https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-importKey.
2. It implements importKey operations of following algorithms: AES-CBC, AES-KW,
   HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP.
3. It fixes some minor problems of SubtleCrypto::generateKey.
4. It addes move constructors for CryptoKeyAES, CryptoKeyHMAC, CryptoKeyRSA and
   CryptoKeyDataRSAComponents.
5. It renames HmacKeyGenParams to HmacKeyParams to serve the purpose of both
   HmacKeyGenParams and HmacImportParams which are essentially the same.
6. It enforces the key length in bits of CryptoKeyHMAC to be multiples of 8.
7. It also fixes the following bugs:
   https://bugs.webkit.org/show_bug.cgi?id=126033,
   https://bugs.webkit.org/show_bug.cgi?id=126034,
   https://bugs.webkit.org/show_bug.cgi?id=151308.
P.S. We currently only support Raw and Jwk key format.

Tests: crypto/subtle/aes-cbc-import-jwk-key-length-128.html
       crypto/subtle/aes-cbc-import-jwk-key-length-192.html
       crypto/subtle/aes-cbc-import-jwk-key-length-256.html
       crypto/subtle/aes-cbc-import-jwk-key-minimum.html
       crypto/subtle/aes-cbc-import-jwk-key-non-extractable.html
       crypto/subtle/aes-cbc-import-raw-key-length-128.html
       crypto/subtle/aes-cbc-import-raw-key-length-192.html
       crypto/subtle/aes-cbc-import-raw-key-length-256.html
       crypto/subtle/aes-import-key-malformed-parameters.html
       crypto/subtle/aes-kw-import-jwk-key-length-128.html
       crypto/subtle/aes-kw-import-jwk-key-length-192.html
       crypto/subtle/aes-kw-import-jwk-key-length-256.html
       crypto/subtle/aes-kw-import-raw-key.html
       crypto/subtle/generate-key-malformed-parameters.html
       crypto/subtle/hmac-import-jwk-key-minimum.html
       crypto/subtle/hmac-import-jwk-key-non-extractable.html
       crypto/subtle/hmac-import-jwk-key-sha1.html
       crypto/subtle/hmac-import-jwk-key-sha224.html
       crypto/subtle/hmac-import-jwk-key-sha256.html
       crypto/subtle/hmac-import-jwk-key-sha384.html
       crypto/subtle/hmac-import-jwk-key-sha512.html
       crypto/subtle/hmac-import-malformed-parameters.html
       crypto/subtle/hmac-import-raw-key-customized-length.html
       crypto/subtle/hmac-import-raw-key.html
       crypto/subtle/import-key-malformed-parameters.html
       crypto/subtle/rsa-import-key-malformed-parameters.html
       crypto/subtle/rsa-oaep-import-jwk-private-key.html
       crypto/subtle/rsa-oaep-import-jwk-public-key-sha1.html
       crypto/subtle/rsa-oaep-import-jwk-public-key-sha224.html
       crypto/subtle/rsa-oaep-import-jwk-public-key-sha256.html
       crypto/subtle/rsa-oaep-import-jwk-public-key-sha384.html
       crypto/subtle/rsa-oaep-import-jwk-public-key-sha512.html
       crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key.html
       crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero.html
       crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum.html
       crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable.html
       crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384.html
       crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512.html
       crypto/workers/subtle/aes-import-jwk-key.html
       crypto/workers/subtle/aes-import-raw-key.html
       crypto/workers/subtle/hmac-import-jwk-key.html
       crypto/workers/subtle/hmac-import-raw-key.html
       crypto/workers/subtle/rsa-import-jwk-private-key.html
       crypto/workers/subtle/rsa-import-jwk-public-key.html

* CMakeLists.txt:
* DerivedSources.make:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::cryptoKeyUsageFromString):
(WebCore::cryptoKeyUsagesFromJSValue):
(WebCore::toKeyData):
(WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
(WebCore::jsSubtleCryptoFunctionImportKeyPromise):
(WebCore::JSSubtleCrypto::importKey):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::importKey):
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmParameters.h:
* crypto/JsonWebKey.h: Added.
* crypto/JsonWebKey.idl: Added.
* crypto/RsaOtherPrimesInfo.h: Added.
* crypto/RsaOtherPrimesInfo.idl: Added.
* crypto/SubtleCrypto.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
(WebCore::CryptoAlgorithmAES_KW::importKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::CryptoKeyAES):
(WebCore::CryptoKeyAES::generate):
(WebCore::CryptoKeyAES::importRaw):
(WebCore::CryptoKeyAES::importJwk):
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyDataRSAComponents.cpp:
(WebCore::CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents):
* crypto/keys/CryptoKeyDataRSAComponents.h:
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::CryptoKeyHMAC):
(WebCore::CryptoKeyHMAC::generate):
(WebCore::CryptoKeyHMAC::importRaw):
(WebCore::CryptoKeyHMAC::importJwk):
(WebCore::CryptoKeyHMAC::buildAlgorithm):
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.cpp: Added.
(WebCore::CryptoKeyRSA::importJwk):
* crypto/keys/CryptoKeyRSA.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h.
* crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h: Added.
* crypto/parameters/HmacKeyParams.idl: Renamed from Source/WebCore/crypto/parameters/HmacKeyGenParams.idl.
* crypto/parameters/RsaHashedImportParams.idl: Added.

LayoutTests:

Besides adding test cases for SubtleCrypto::importKey. This patch also corrects a typo:
generate-key-malformed-paramters*.

* crypto/subtle/aes-cbc-import-jwk-key-length-128-expected.txt: Added.
* crypto/subtle/aes-cbc-import-jwk-key-length-128.html: Added.
* crypto/subtle/aes-cbc-import-jwk-key-length-192-expected.txt: Added.
* crypto/subtle/aes-cbc-import-jwk-key-length-192.html: Added.
* crypto/subtle/aes-cbc-import-jwk-key-length-256-expected.txt: Added.
* crypto/subtle/aes-cbc-import-jwk-key-length-256.html: Added.
* crypto/subtle/aes-cbc-import-jwk-key-minimum-expected.txt: Added.
* crypto/subtle/aes-cbc-import-jwk-key-minimum.html: Added.
* crypto/subtle/aes-cbc-import-jwk-key-non-extractable-expected.txt: Added.
* crypto/subtle/aes-cbc-import-jwk-key-non-extractable.html: Added.
* crypto/subtle/aes-cbc-import-raw-key-length-128-expected.txt: Added.
* crypto/subtle/aes-cbc-import-raw-key-length-128.html: Added.
* crypto/subtle/aes-cbc-import-raw-key-length-192-expected.txt: Added.
* crypto/subtle/aes-cbc-import-raw-key-length-192.html: Added.
* crypto/subtle/aes-cbc-import-raw-key-length-256-expected.txt: Added.
* crypto/subtle/aes-cbc-import-raw-key-length-256.html: Added.
* crypto/subtle/aes-import-key-malformed-parameters-expected.txt: Added.
* crypto/subtle/aes-import-key-malformed-parameters.html: Added.
* crypto/subtle/aes-kw-import-jwk-key-length-128-expected.txt: Added.
* crypto/subtle/aes-kw-import-jwk-key-length-128.html: Added.
* crypto/subtle/aes-kw-import-jwk-key-length-192-expected.txt: Added.
* crypto/subtle/aes-kw-import-jwk-key-length-192.html: Added.
* crypto/subtle/aes-kw-import-jwk-key-length-256-expected.txt: Added.
* crypto/subtle/aes-kw-import-jwk-key-length-256.html: Added.
* crypto/subtle/aes-kw-import-raw-key-expected.txt: Added.
* crypto/subtle/aes-kw-import-raw-key.html: Added.
* crypto/subtle/generate-key-malformed-parameters-expected.txt: Renamed from LayoutTests/crypto/subtle/generate-key-malformed-paramters-expected.txt.
* crypto/subtle/generate-key-malformed-parameters.html: Renamed from LayoutTests/crypto/subtle/generate-key-malformed-paramters.html.
* crypto/subtle/hmac-generate-key-customized-length-expected.txt:
* crypto/subtle/hmac-generate-key-customized-length.html:
* crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt:
* crypto/subtle/hmac-generate-key-malformed-parameters.html:
* crypto/subtle/hmac-import-raw-key-customized-length-expected.txt:
* crypto/subtle/hmac-import-raw-key-customized-length.html:
* crypto/subtle/hmac-import-jwk-key-minimum-expected.txt: Added.
* crypto/subtle/hmac-import-jwk-key-minimum.html: Added.
* crypto/subtle/hmac-import-jwk-key-non-extractable-expected.txt: Added.
* crypto/subtle/hmac-import-jwk-key-non-extractable.html: Added.
* crypto/subtle/hmac-import-jwk-key-sha1-expected.txt: Added.
* crypto/subtle/hmac-import-jwk-key-sha1.html: Added.
* crypto/subtle/hmac-import-jwk-key-sha224-expected.txt: Added.
* crypto/subtle/hmac-import-jwk-key-sha224.html: Added.
* crypto/subtle/hmac-import-jwk-key-sha256-expected.txt: Added.
* crypto/subtle/hmac-import-jwk-key-sha256.html: Added.
* crypto/subtle/hmac-import-jwk-key-sha384-expected.txt: Added.
* crypto/subtle/hmac-import-jwk-key-sha384.html: Added.
* crypto/subtle/hmac-import-jwk-key-sha512-expected.txt: Added.
* crypto/subtle/hmac-import-jwk-key-sha512.html: Added.
* crypto/subtle/hmac-import-malformed-parameters-expected.txt: Added.
* crypto/subtle/hmac-import-malformed-parameters.html: Added.
* crypto/subtle/hmac-import-raw-key-customized-length-expected.txt: Added.
* crypto/subtle/hmac-import-raw-key-customized-length.html: Added.
* crypto/subtle/hmac-import-raw-key-expected.txt: Added.
* crypto/subtle/hmac-import-raw-key.html: Added.
* crypto/subtle/import-key-malformed-parameters-expected.txt: Added.
* crypto/subtle/import-key-malformed-parameters.html: Added.
* crypto/subtle/rsa-import-key-malformed-parameters-expected.txt: Added.
* crypto/subtle/rsa-import-key-malformed-parameters.html: Added.
* crypto/subtle/rsa-oaep-import-jwk-private-key-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-jwk-private-key.html: Added.
* crypto/subtle/rsa-oaep-import-jwk-public-key-sha1-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-jwk-public-key-sha1.html: Added.
* crypto/subtle/rsa-oaep-import-jwk-public-key-sha224-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-jwk-public-key-sha224.html: Added.
* crypto/subtle/rsa-oaep-import-jwk-public-key-sha256-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-jwk-public-key-sha256.html: Added.
* crypto/subtle/rsa-oaep-import-jwk-public-key-sha384-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-jwk-public-key-sha384.html: Added.
* crypto/subtle/rsa-oaep-import-jwk-public-key-sha512-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-jwk-public-key-sha512.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512.html: Added.
* crypto/webkitSubtle/hmac-generate-key-expected.txt:
* crypto/webkitSubtle/hmac-generate-key.html:
* crypto/webkitSubtle/hmac-import-jwk-expected.txt:
* crypto/webkitSubtle/hmac-import-jwk.html:
* crypto/webkitSubtle/hmac-postMessage-expected.txt:
* crypto/webkitSubtle/hmac-postMessage.html:
* crypto/webkitSubtle/hmac-sign-verify-expected.txt:
* crypto/webkitSubtle/hmac-sign-verify.html:
* crypto/workers/subtle/aes-import-jwk-key-expected.txt: Added.
* crypto/workers/subtle/aes-import-jwk-key.html: Added.
* crypto/workers/subtle/aes-import-raw-key-expected.txt: Added.
* crypto/workers/subtle/aes-import-raw-key.html: Added.
* crypto/workers/subtle/hmac-import-jwk-key-expected.txt: Added.
* crypto/workers/subtle/hmac-import-jwk-key.html: Added.
* crypto/workers/subtle/hmac-import-raw-key-expected.txt: Added.
* crypto/workers/subtle/hmac-import-raw-key.html: Added.
* crypto/workers/subtle/hmac-postMessage-worker-expected.txt:
* crypto/workers/subtle/hmac-postMessage-worker.html:
* crypto/workers/subtle/resources/aes-import-jwk-key.js: Added.
* crypto/workers/subtle/resources/aes-import-raw-key.js: Added.
* crypto/workers/subtle/resources/hmac-import-jwk-key.js: Added.
* crypto/workers/subtle/resources/hmac-import-raw-key.js: Added.
* crypto/workers/subtle/resources/hmac-postMessage-worker.js:
* crypto/workers/subtle/resources/rsa-import-jwk-private-key.js: Added.
* crypto/workers/subtle/resources/rsa-import-jwk-public-key.js: Added.
* crypto/workers/subtle/rsa-import-jwk-private-key-expected.txt: Added.
* crypto/workers/subtle/rsa-import-jwk-private-key.html: Added.
* crypto/workers/subtle/rsa-import-jwk-public-key-expected.txt: Added.
* crypto/workers/subtle/rsa-import-jwk-public-key.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacgeneratekeycustomizedlengthexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacgeneratekeycustomizedlengthhtml">trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacgeneratekeymalformedparametersexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacgeneratekeymalformedparametershtml">trunk/LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacgeneratekeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacgeneratekeyhtml">trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacimportjwkexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacimportjwkhtml">trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacpostMessageexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacpostMessagehtml">trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacsignverifyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacsignverifyhtml">trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerhtml">trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourceshmacpostMessageworkerjs">trunk/LayoutTests/crypto/workers/subtle/resources/hmac-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIidlharnessexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCorePlatformEflcmake">trunk/Source/WebCore/PlatformEfl.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformMaccmake">trunk/Source/WebCore/PlatformMac.cmake</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSSubtleCryptoCustomcpp">trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoCryptoAlgorithmcpp">trunk/Source/WebCore/crypto/CryptoAlgorithm.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoCryptoAlgorithmh">trunk/Source/WebCore/crypto/CryptoAlgorithm.h</a></li>
<li><a href="#trunkSourceWebCorecryptoCryptoAlgorithmParametersh">trunk/Source/WebCore/crypto/CryptoAlgorithmParameters.h</a></li>
<li><a href="#trunkSourceWebCorecryptoSubtleCryptoh">trunk/Source/WebCore/crypto/SubtleCrypto.h</a></li>
<li><a href="#trunkSourceWebCorecryptoSubtleCryptoidl">trunk/Source/WebCore/crypto/SubtleCrypto.idl</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmAES_CBCcpp">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmAES_CBCh">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.h</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmAES_KWcpp">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmAES_KWh">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.h</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmHMACcpp">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmHMACh">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.h</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSAES_PKCS1_v1_5cpp">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSAES_PKCS1_v1_5h">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSASSA_PKCS1_v1_5cpp">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSASSA_PKCS1_v1_5h">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSA_OAEPcpp">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSA_OAEPh">trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.h</a></li>
<li><a href="#trunkSourceWebCorecryptokeysCryptoKeyAEScpp">trunk/Source/WebCore/crypto/keys/CryptoKeyAES.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptokeysCryptoKeyAESh">trunk/Source/WebCore/crypto/keys/CryptoKeyAES.h</a></li>
<li><a href="#trunkSourceWebCorecryptokeysCryptoKeyDataRSAComponentscpp">trunk/Source/WebCore/crypto/keys/CryptoKeyDataRSAComponents.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptokeysCryptoKeyDataRSAComponentsh">trunk/Source/WebCore/crypto/keys/CryptoKeyDataRSAComponents.h</a></li>
<li><a href="#trunkSourceWebCorecryptokeysCryptoKeyHMACcpp">trunk/Source/WebCore/crypto/keys/CryptoKeyHMAC.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptokeysCryptoKeyHMACh">trunk/Source/WebCore/crypto/keys/CryptoKeyHMAC.h</a></li>
<li><a href="#trunkSourceWebCorecryptokeysCryptoKeyRSAh">trunk/Source/WebCore/crypto/keys/CryptoKeyRSA.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkkeylength128expectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-128-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkkeylength128html">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-128.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkkeylength192expectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-192-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkkeylength192html">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-192.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkkeylength256expectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-256-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkkeylength256html">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-256.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkkeyminimumexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-minimum-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkkeyminimumhtml">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-minimum.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkkeynonextractableexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-non-extractable-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkkeynonextractablehtml">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-non-extractable.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportrawkeylength128expectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-128-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportrawkeylength128html">trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-128.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportrawkeylength192expectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-192-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportrawkeylength192html">trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-192.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportrawkeylength256expectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-256-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportrawkeylength256html">trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-256.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaesimportkeymalformedparametersexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-import-key-malformed-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaesimportkeymalformedparametershtml">trunk/LayoutTests/crypto/subtle/aes-import-key-malformed-parameters.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwimportjwkkeylength128expectedtxt">trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-128-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwimportjwkkeylength128html">trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-128.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwimportjwkkeylength192expectedtxt">trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-192-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwimportjwkkeylength192html">trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-192.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwimportjwkkeylength256expectedtxt">trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-256-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwimportjwkkeylength256html">trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-256.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwimportrawkeyexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-kw-import-raw-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwimportrawkeyhtml">trunk/LayoutTests/crypto/subtle/aes-kw-import-raw-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegeneratekeymalformedparametersexpectedtxt">trunk/LayoutTests/crypto/subtle/generate-key-malformed-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegeneratekeymalformedparametershtml">trunk/LayoutTests/crypto/subtle/generate-key-malformed-parameters.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkkeyminimumexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-minimum-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkkeyminimumhtml">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-minimum.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkkeynonextractableexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-non-extractable-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkkeynonextractablehtml">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-non-extractable.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkkeysha1expectedtxt">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha1-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkkeysha1html">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha1.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkkeysha224expectedtxt">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha224-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkkeysha224html">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha224.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkkeysha256expectedtxt">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha256-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkkeysha256html">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha256.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkkeysha384expectedtxt">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha384-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkkeysha384html">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha384.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkkeysha512expectedtxt">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha512-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkkeysha512html">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha512.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportmalformedparametersexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-import-malformed-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportmalformedparametershtml">trunk/LayoutTests/crypto/subtle/hmac-import-malformed-parameters.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportrawkeycustomizedlengthexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-customized-length-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportrawkeycustomizedlengthhtml">trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-customized-length.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportrawkeyexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportrawkeyhtml">trunk/LayoutTests/crypto/subtle/hmac-import-raw-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleimportkeymalformedparametersexpectedtxt">trunk/LayoutTests/crypto/subtle/import-key-malformed-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleimportkeymalformedparametershtml">trunk/LayoutTests/crypto/subtle/import-key-malformed-parameters.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaimportkeymalformedparametersexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaimportkeymalformedparametershtml">trunk/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepimportjwkprivatekeyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-private-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepimportjwkprivatekeyhtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-private-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha1expectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha1-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha1html">trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha1.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha224expectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha224-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha224html">trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha224.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha256expectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha256-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha256html">trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha256.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha384expectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha384-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha384html">trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha384.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha512expectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha512-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha512html">trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha512.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkprivatekeyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkprivatekeyhtml">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeyleadingzeroexpectedtxt">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeyleadingzerohtml">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeyminimumexpectedtxt">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeyminimumhtml">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeynonextractableexpectedtxt">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeynonextractablehtml">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeyhtml">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkprivatekeyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkprivatekeyhtml">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha1expectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha1html">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha224expectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha224html">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha256expectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha256html">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha384expectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha384html">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha512expectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha512html">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleaesimportjwkkeyexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/aes-import-jwk-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleaesimportjwkkeyhtml">trunk/LayoutTests/crypto/workers/subtle/aes-import-jwk-key.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleaesimportrawkeyexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/aes-import-raw-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleaesimportrawkeyhtml">trunk/LayoutTests/crypto/workers/subtle/aes-import-raw-key.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlehmacimportjwkkeyexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/hmac-import-jwk-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlehmacimportjwkkeyhtml">trunk/LayoutTests/crypto/workers/subtle/hmac-import-jwk-key.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlehmacimportrawkeyexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/hmac-import-raw-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlehmacimportrawkeyhtml">trunk/LayoutTests/crypto/workers/subtle/hmac-import-raw-key.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourcesaesimportjwkkeyjs">trunk/LayoutTests/crypto/workers/subtle/resources/aes-import-jwk-key.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourcesaesimportrawkeyjs">trunk/LayoutTests/crypto/workers/subtle/resources/aes-import-raw-key.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourceshmacimportjwkkeyjs">trunk/LayoutTests/crypto/workers/subtle/resources/hmac-import-jwk-key.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourceshmacimportrawkeyjs">trunk/LayoutTests/crypto/workers/subtle/resources/hmac-import-raw-key.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourcesrsaimportjwkprivatekeyjs">trunk/LayoutTests/crypto/workers/subtle/resources/rsa-import-jwk-private-key.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourcesrsaimportjwkpublickeyjs">trunk/LayoutTests/crypto/workers/subtle/resources/rsa-import-jwk-public-key.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlersaimportjwkprivatekeyexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-private-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlersaimportjwkprivatekeyhtml">trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-private-key.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlersaimportjwkpublickeyexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-public-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlersaimportjwkpublickeyhtml">trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-public-key.html</a></li>
<li><a href="#trunkSourceWebCorecryptoJsonWebKeyh">trunk/Source/WebCore/crypto/JsonWebKey.h</a></li>
<li><a href="#trunkSourceWebCorecryptoJsonWebKeyidl">trunk/Source/WebCore/crypto/JsonWebKey.idl</a></li>
<li><a href="#trunkSourceWebCorecryptoRsaOtherPrimesInfoh">trunk/Source/WebCore/crypto/RsaOtherPrimesInfo.h</a></li>
<li><a href="#trunkSourceWebCorecryptoRsaOtherPrimesInfoidl">trunk/Source/WebCore/crypto/RsaOtherPrimesInfo.idl</a></li>
<li><a href="#trunkSourceWebCorecryptokeysCryptoKeyRSAcpp">trunk/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoparametersCryptoAlgorithmHmacKeyParamsh">trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h</a></li>
<li><a href="#trunkSourceWebCorecryptoparametersCryptoAlgorithmRsaHashedImportParamsh">trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h</a></li>
<li><a href="#trunkSourceWebCorecryptoparametersHmacKeyParamsidl">trunk/Source/WebCore/crypto/parameters/HmacKeyParams.idl</a></li>
<li><a href="#trunkSourceWebCorecryptoparametersRsaHashedImportParamsidl">trunk/Source/WebCore/crypto/parameters/RsaHashedImportParams.idl</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscryptosubtlegeneratekeymalformedparamtersexpectedtxt">trunk/LayoutTests/crypto/subtle/generate-key-malformed-paramters-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegeneratekeymalformedparamtershtml">trunk/LayoutTests/crypto/subtle/generate-key-malformed-paramters.html</a></li>
<li><a href="#trunkSourceWebCorecryptoparametersCryptoAlgorithmHmacKeyGenParamsh">trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h</a></li>
<li><a href="#trunkSourceWebCorecryptoparametersHmacKeyGenParamsidl">trunk/Source/WebCore/crypto/parameters/HmacKeyGenParams.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/ChangeLog        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -1,3 +1,136 @@
</span><ins>+2016-11-04  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        Update SubtleCrypto::importKey to match the latest spec
+        https://bugs.webkit.org/show_bug.cgi?id=164446
+        &lt;rdar://problem/29123621&gt;
+
+        Reviewed by Brent Fulgham.
+
+        Besides adding test cases for SubtleCrypto::importKey. This patch also corrects a typo:
+        generate-key-malformed-paramters*.
+
+        * crypto/subtle/aes-cbc-import-jwk-key-length-128-expected.txt: Added.
+        * crypto/subtle/aes-cbc-import-jwk-key-length-128.html: Added.
+        * crypto/subtle/aes-cbc-import-jwk-key-length-192-expected.txt: Added.
+        * crypto/subtle/aes-cbc-import-jwk-key-length-192.html: Added.
+        * crypto/subtle/aes-cbc-import-jwk-key-length-256-expected.txt: Added.
+        * crypto/subtle/aes-cbc-import-jwk-key-length-256.html: Added.
+        * crypto/subtle/aes-cbc-import-jwk-key-minimum-expected.txt: Added.
+        * crypto/subtle/aes-cbc-import-jwk-key-minimum.html: Added.
+        * crypto/subtle/aes-cbc-import-jwk-key-non-extractable-expected.txt: Added.
+        * crypto/subtle/aes-cbc-import-jwk-key-non-extractable.html: Added.
+        * crypto/subtle/aes-cbc-import-raw-key-length-128-expected.txt: Added.
+        * crypto/subtle/aes-cbc-import-raw-key-length-128.html: Added.
+        * crypto/subtle/aes-cbc-import-raw-key-length-192-expected.txt: Added.
+        * crypto/subtle/aes-cbc-import-raw-key-length-192.html: Added.
+        * crypto/subtle/aes-cbc-import-raw-key-length-256-expected.txt: Added.
+        * crypto/subtle/aes-cbc-import-raw-key-length-256.html: Added.
+        * crypto/subtle/aes-import-key-malformed-parameters-expected.txt: Added.
+        * crypto/subtle/aes-import-key-malformed-parameters.html: Added.
+        * crypto/subtle/aes-kw-import-jwk-key-length-128-expected.txt: Added.
+        * crypto/subtle/aes-kw-import-jwk-key-length-128.html: Added.
+        * crypto/subtle/aes-kw-import-jwk-key-length-192-expected.txt: Added.
+        * crypto/subtle/aes-kw-import-jwk-key-length-192.html: Added.
+        * crypto/subtle/aes-kw-import-jwk-key-length-256-expected.txt: Added.
+        * crypto/subtle/aes-kw-import-jwk-key-length-256.html: Added.
+        * crypto/subtle/aes-kw-import-raw-key-expected.txt: Added.
+        * crypto/subtle/aes-kw-import-raw-key.html: Added.
+        * crypto/subtle/generate-key-malformed-parameters-expected.txt: Renamed from LayoutTests/crypto/subtle/generate-key-malformed-paramters-expected.txt.
+        * crypto/subtle/generate-key-malformed-parameters.html: Renamed from LayoutTests/crypto/subtle/generate-key-malformed-paramters.html.
+        * crypto/subtle/hmac-generate-key-customized-length-expected.txt:
+        * crypto/subtle/hmac-generate-key-customized-length.html:
+        * crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt:
+        * crypto/subtle/hmac-generate-key-malformed-parameters.html:
+        * crypto/subtle/hmac-import-raw-key-customized-length-expected.txt:
+        * crypto/subtle/hmac-import-raw-key-customized-length.html:
+        * crypto/subtle/hmac-import-jwk-key-minimum-expected.txt: Added.
+        * crypto/subtle/hmac-import-jwk-key-minimum.html: Added.
+        * crypto/subtle/hmac-import-jwk-key-non-extractable-expected.txt: Added.
+        * crypto/subtle/hmac-import-jwk-key-non-extractable.html: Added.
+        * crypto/subtle/hmac-import-jwk-key-sha1-expected.txt: Added.
+        * crypto/subtle/hmac-import-jwk-key-sha1.html: Added.
+        * crypto/subtle/hmac-import-jwk-key-sha224-expected.txt: Added.
+        * crypto/subtle/hmac-import-jwk-key-sha224.html: Added.
+        * crypto/subtle/hmac-import-jwk-key-sha256-expected.txt: Added.
+        * crypto/subtle/hmac-import-jwk-key-sha256.html: Added.
+        * crypto/subtle/hmac-import-jwk-key-sha384-expected.txt: Added.
+        * crypto/subtle/hmac-import-jwk-key-sha384.html: Added.
+        * crypto/subtle/hmac-import-jwk-key-sha512-expected.txt: Added.
+        * crypto/subtle/hmac-import-jwk-key-sha512.html: Added.
+        * crypto/subtle/hmac-import-malformed-parameters-expected.txt: Added.
+        * crypto/subtle/hmac-import-malformed-parameters.html: Added.
+        * crypto/subtle/hmac-import-raw-key-customized-length-expected.txt: Added.
+        * crypto/subtle/hmac-import-raw-key-customized-length.html: Added.
+        * crypto/subtle/hmac-import-raw-key-expected.txt: Added.
+        * crypto/subtle/hmac-import-raw-key.html: Added.
+        * crypto/subtle/import-key-malformed-parameters-expected.txt: Added.
+        * crypto/subtle/import-key-malformed-parameters.html: Added.
+        * crypto/subtle/rsa-import-key-malformed-parameters-expected.txt: Added.
+        * crypto/subtle/rsa-import-key-malformed-parameters.html: Added.
+        * crypto/subtle/rsa-oaep-import-jwk-private-key-expected.txt: Added.
+        * crypto/subtle/rsa-oaep-import-jwk-private-key.html: Added.
+        * crypto/subtle/rsa-oaep-import-jwk-public-key-sha1-expected.txt: Added.
+        * crypto/subtle/rsa-oaep-import-jwk-public-key-sha1.html: Added.
+        * crypto/subtle/rsa-oaep-import-jwk-public-key-sha224-expected.txt: Added.
+        * crypto/subtle/rsa-oaep-import-jwk-public-key-sha224.html: Added.
+        * crypto/subtle/rsa-oaep-import-jwk-public-key-sha256-expected.txt: Added.
+        * crypto/subtle/rsa-oaep-import-jwk-public-key-sha256.html: Added.
+        * crypto/subtle/rsa-oaep-import-jwk-public-key-sha384-expected.txt: Added.
+        * crypto/subtle/rsa-oaep-import-jwk-public-key-sha384.html: Added.
+        * crypto/subtle/rsa-oaep-import-jwk-public-key-sha512-expected.txt: Added.
+        * crypto/subtle/rsa-oaep-import-jwk-public-key-sha512.html: Added.
+        * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key-expected.txt: Added.
+        * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key.html: Added.
+        * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-expected.txt: Added.
+        * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero-expected.txt: Added.
+        * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero.html: Added.
+        * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum-expected.txt: Added.
+        * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum.html: Added.
+        * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable-expected.txt: Added.
+        * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable.html: Added.
+        * crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key.html: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key-expected.txt: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key.html: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1-expected.txt: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1.html: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224-expected.txt: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224.html: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256-expected.txt: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256.html: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384-expected.txt: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384.html: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512-expected.txt: Added.
+        * crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512.html: Added.
+        * crypto/webkitSubtle/hmac-generate-key-expected.txt:
+        * crypto/webkitSubtle/hmac-generate-key.html:
+        * crypto/webkitSubtle/hmac-import-jwk-expected.txt:
+        * crypto/webkitSubtle/hmac-import-jwk.html:
+        * crypto/webkitSubtle/hmac-postMessage-expected.txt:
+        * crypto/webkitSubtle/hmac-postMessage.html:
+        * crypto/webkitSubtle/hmac-sign-verify-expected.txt:
+        * crypto/webkitSubtle/hmac-sign-verify.html:
+        * crypto/workers/subtle/aes-import-jwk-key-expected.txt: Added.
+        * crypto/workers/subtle/aes-import-jwk-key.html: Added.
+        * crypto/workers/subtle/aes-import-raw-key-expected.txt: Added.
+        * crypto/workers/subtle/aes-import-raw-key.html: Added.
+        * crypto/workers/subtle/hmac-import-jwk-key-expected.txt: Added.
+        * crypto/workers/subtle/hmac-import-jwk-key.html: Added.
+        * crypto/workers/subtle/hmac-import-raw-key-expected.txt: Added.
+        * crypto/workers/subtle/hmac-import-raw-key.html: Added.
+        * crypto/workers/subtle/hmac-postMessage-worker-expected.txt:
+        * crypto/workers/subtle/hmac-postMessage-worker.html:
+        * crypto/workers/subtle/resources/aes-import-jwk-key.js: Added.
+        * crypto/workers/subtle/resources/aes-import-raw-key.js: Added.
+        * crypto/workers/subtle/resources/hmac-import-jwk-key.js: Added.
+        * crypto/workers/subtle/resources/hmac-import-raw-key.js: Added.
+        * crypto/workers/subtle/resources/hmac-postMessage-worker.js:
+        * crypto/workers/subtle/resources/rsa-import-jwk-private-key.js: Added.
+        * crypto/workers/subtle/resources/rsa-import-jwk-public-key.js: Added.
+        * crypto/workers/subtle/rsa-import-jwk-private-key-expected.txt: Added.
+        * crypto/workers/subtle/rsa-import-jwk-private-key.html: Added.
+        * crypto/workers/subtle/rsa-import-jwk-public-key-expected.txt: Added.
+        * crypto/workers/subtle/rsa-import-jwk-public-key.html: Added.
+
</ins><span class="cx"> 2016-11-10  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Marking media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-buttons-styles.html as flaky.
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportjwkkeylength128expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-128-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-128-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-128-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test importing a JWK AES-CBC key with legnth 128
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportjwkkeylength128html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-128.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-128.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-128.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,43 @@
</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 importing a JWK AES-CBC key with legnth 128&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;,
+    alg: &quot;A128CBC&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;],
+    ext: true,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']&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="trunkLayoutTestscryptosubtleaescbcimportjwkkeylength192expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-192-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-192-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-192-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test importing a JWK AES-CBC key with legnth 192
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 192
+PASS key.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportjwkkeylength192html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-192.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-192.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-192.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,43 @@
</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 importing a JWK AES-CBC key with legnth 192&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;A72FD48989ED7E92A3B3A080F74FA80B&quot;,
+    alg: &quot;A192CBC&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;],
+    ext: true,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;192&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportjwkkeylength256expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-256-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-256-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-256-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test importing a JWK AES-CBC key with legnth 256
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 256
+PASS key.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportjwkkeylength256html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-256.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-256.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-length-256.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,43 @@
</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 importing a JWK AES-CBC key with legnth 256&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OGFiY2RlZmdoMTIzNDU2Nzg&quot;,
+    alg: &quot;A256CBC&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;],
+    ext: true,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;256&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportjwkkeyminimumexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-minimum-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-minimum-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-minimum-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test importing a JWK AES-CBC key with minimum JWK information
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportjwkkeyminimumhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-minimum.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-minimum.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-minimum.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,39 @@
</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 importing a JWK AES-CBC key with minimum JWK information&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportjwkkeynonextractableexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-non-extractable-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-non-extractable-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-non-extractable-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test importing a JWK AES-CBC non-extractable key
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is false
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportjwkkeynonextractablehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-non-extractable.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-non-extractable.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-key-non-extractable.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,40 @@
</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 importing a JWK AES-CBC non-extractable key&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;,
+    ext: true,
+};
+var nonExtractable = false;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, &quot;aes-cbc&quot;, nonExtractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;false&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']&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="trunkLayoutTestscryptosubtleaescbcimportrawkeylength128expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-128-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-128-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-128-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test importing a raw AES-CBC key with legnth 128
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 128
+PASS key.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportrawkeylength128html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-128.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-128.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-128.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,36 @@
</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 importing a raw AES-CBC key with legnth 128&quot;);
+
+jsTestIsAsync = true;
+
+var rawKey = asciiToUint8Array(&quot;jnOw99oOZFLIEPMr&quot;);
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;raw&quot;, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportrawkeylength192expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-192-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-192-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-192-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test importing a raw AES-CBC key with legnth 192
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 192
+PASS key.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportrawkeylength192html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-192.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-192.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-192.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,36 @@
</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 importing a raw AES-CBC key with legnth 192&quot;);
+
+jsTestIsAsync = true;
+
+var rawKey = asciiToUint8Array(&quot;jnOw99oOZFLIEPMrgJB55WL4&quot;);
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;raw&quot;, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;192&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportrawkeylength256expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-256-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-256-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-256-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test importing a raw AES-CBC key with legnth 256
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 256
+PASS key.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportrawkeylength256html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-256.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-256.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-raw-key-length-256.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,36 @@
</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 importing a raw AES-CBC key with legnth 256&quot;);
+
+jsTestIsAsync = true;
+
+var rawKey = asciiToUint8Array(&quot;jnOw99oOZFLIEPMrgJB55WL46tJSLGt7&quot;);
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;raw&quot;, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;256&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaesimportkeymalformedparametersexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-import-key-malformed-parameters-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-import-key-malformed-parameters-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-import-key-malformed-parameters-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+Test importing an AES key with malformed parameters
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS crypto.subtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;jnOw97&quot;), &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k128, alg: &quot;A192CBC&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k192, alg: &quot;A256CBC&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k256, alg: &quot;A128CBC&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k128, alg: &quot;A192KW&quot;}, &quot;aes-kw&quot;, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k192, alg: &quot;A256KW&quot;}, &quot;aes-kw&quot;, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k256, alg: &quot;A128KW&quot;}, &quot;aes-kw&quot;, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: &quot;A72F&quot;, alg: &quot;foo&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: &quot;!!!&quot;, alg: &quot;foo&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k128, alg: &quot;A128CBC&quot;, use: &quot;sig&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k128, alg: &quot;A128CBC&quot;, key_ops: [&quot;encrypt&quot;, &quot;decrypt&quot;]}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k128, alg: &quot;A128CBC&quot;, ext: false}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaesimportkeymalformedparametershtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-import-key-malformed-parameters.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-import-key-malformed-parameters.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-import-key-malformed-parameters.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,45 @@
</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 importing an AES key with malformed parameters&quot;);
+
+var k128 = &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;;
+var k192 = &quot;A72FD48989ED7E92A3B3A080F74FA80B&quot;;
+var k256 = &quot;YWJjZGVmZ2gxMjM0NTY3OGFiY2RlZmdoMTIzNDU2Nzg&quot;;
+var extractable = true;
+
+// Raw: wrong length
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;jnOw97&quot;), &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+// Jwk: Wrong kty
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+// Jwk: missing k
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+// Jwk: wrong length and alg
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k128, alg: &quot;A192CBC&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k192, alg: &quot;A256CBC&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k256, alg: &quot;A128CBC&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k128, alg: &quot;A192KW&quot;}, &quot;aes-kw&quot;, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k192, alg: &quot;A256KW&quot;}, &quot;aes-kw&quot;, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k256, alg: &quot;A128KW&quot;}, &quot;aes-kw&quot;, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: &quot;A72F&quot;, alg: &quot;foo&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+// Jwk: wrong k format
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: &quot;!!!&quot;, alg: &quot;foo&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+// Jwk: wrong use
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k128, alg: &quot;A128CBC&quot;, use: &quot;sig&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+// Jwk: wrong key_ops
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k128, alg: &quot;A128CBC&quot;, key_ops: [&quot;encrypt&quot;, &quot;decrypt&quot;]}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+// Jwk: wrong ext
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k128, alg: &quot;A128CBC&quot;, ext: false}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+&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="trunkLayoutTestscryptosubtleaeskwimportjwkkeylength128expectedtxtfromrev208547trunkLayoutTestscryptowebkitSubtlehmacpostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-128-expected.txt (from rev 208547, trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-128-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-128-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test importing a JWK AES-KW key with legnth 128
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-KW'
+PASS key.algorithm.length is 128
+PASS key.usages is ['unwrapKey', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwimportjwkkeylength128htmlfromrev208547trunkLayoutTestscryptosubtlehmacgeneratekeycustomizedlengthhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-128.html (from rev 208547, trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length.html) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-128.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-128.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,40 @@
</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 importing a JWK AES-KW key with legnth 128&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;,
+    alg: &quot;A128KW&quot;,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, &quot;aes-kw&quot;, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-KW'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['unwrapKey', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwimportjwkkeylength192expectedtxtfromrev208547trunkLayoutTestscryptowebkitSubtlehmacpostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-192-expected.txt (from rev 208547, trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-192-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-192-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test importing a JWK AES-KW key with legnth 192
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-KW'
+PASS key.algorithm.length is 192
+PASS key.usages is ['unwrapKey', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwimportjwkkeylength192html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-192.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-192.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-192.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,40 @@
</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 importing a JWK AES-KW key with legnth 192&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;A72FD48989ED7E92A3B3A080F74FA80B&quot;,
+    alg: &quot;A192KW&quot;,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, &quot;aes-kw&quot;, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-KW'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;192&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['unwrapKey', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwimportjwkkeylength256expectedtxtfromrev208547trunkLayoutTestscryptowebkitSubtlehmacpostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-256-expected.txt (from rev 208547, trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-256-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-256-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test importing a JWK AES-KW key with legnth 256
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-KW'
+PASS key.algorithm.length is 256
+PASS key.usages is ['unwrapKey', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwimportjwkkeylength256html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-256.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-256.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-import-jwk-key-length-256.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,40 @@
</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 importing a JWK AES-KW key with legnth 256&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OGFiY2RlZmdoMTIzNDU2Nzg&quot;,
+    alg: &quot;A256KW&quot;,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, &quot;aes-kw&quot;, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-KW'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;256&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['unwrapKey', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwimportrawkeyexpectedtxtfromrev208547trunkLayoutTestscryptowebkitSubtlehmacpostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/aes-kw-import-raw-key-expected.txt (from rev 208547, trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-import-raw-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-import-raw-key-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test importing a raw AES-KW key with legnth 128
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-KW'
+PASS key.algorithm.length is 128
+PASS key.usages is ['unwrapKey', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwimportrawkeyhtmlfromrev208547trunkLayoutTestscryptosubtlehmacgeneratekeycustomizedlengthhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/aes-kw-import-raw-key.html (from rev 208547, trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length.html) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-import-raw-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-import-raw-key.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,36 @@
</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 importing a raw AES-KW key with legnth 128&quot;);
+
+jsTestIsAsync = true;
+
+var rawKey = asciiToUint8Array(&quot;jnOw99oOZFLIEPMr&quot;);
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;raw&quot;, rawKey, &quot;aes-kw&quot;, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-KW'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['unwrapKey', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegeneratekeymalformedparametersexpectedtxtfromrev208547trunkLayoutTestscryptosubtlegeneratekeymalformedparamtersexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/generate-key-malformed-parameters-expected.txt (from rev 208547, trunk/LayoutTests/crypto/subtle/generate-key-malformed-paramters-expected.txt) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/generate-key-malformed-parameters-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/generate-key-malformed-parameters-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+Test generating a CryptoKey object with malformed parameters
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS crypto.subtle.generateKey() rejected promise  with TypeError: Not enough arguments.
+PASS crypto.subtle.generateKey(1) rejected promise  with TypeError: Not enough arguments.
+PASS crypto.subtle.generateKey(1, 2) rejected promise  with TypeError: Not enough arguments.
+PASS crypto.subtle.generateKey(&quot;foo&quot;, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: 1}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: true}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: null}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: undefined}, 2, 3) rejected promise  with TypeError: Member CryptoAlgorithmParameters.name is required and must be an instance of DOMString.
+PASS crypto.subtle.generateKey({name: Symbol()}, 2, 3) rejected promise  with TypeError: Cannot convert a symbol to a string.
+PASS crypto.subtle.generateKey({name: { }}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: &quot;foo&quot;}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: true}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Invalid AlgorithmIdentifier.
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: 1}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Invalid AlgorithmIdentifier.
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: null}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Invalid AlgorithmIdentifier.
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: undefined}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Member HmacKeyParams.hash is required and must be an instance of any.
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: Symbol()}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Invalid AlgorithmIdentifier.
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: { }}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Member CryptoAlgorithmParameters.name is required and must be an instance of DOMString.
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;foo&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: true}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: 1}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: null}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: undefined}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Member CryptoAlgorithmParameters.name is required and must be an instance of DOMString.
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: Symbol()}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Cannot convert a symbol to a string.
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: { }}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: &quot;foo&quot;}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: &quot;SHA-1&quot;}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: &quot;SHA-256&quot;}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: &quot;SHA-384&quot;}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: &quot;SHA-512&quot;}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, 3) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, true) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, null) rejected promise  with TypeError: null is not an object (evaluating 'crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, null)').
+PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, undefined) rejected promise  with TypeError: undefined is not an object (evaluating 'crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, undefined)').
+PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, Symbol()) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, { }) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, &quot;foo&quot;) rejected promise  with TypeError: Invalid KeyUsages.
+PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, [&quot;foo&quot;]) rejected promise  with TypeError: Invalid KeyUsages.
+PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, [ ]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
+PASS crypto.subtle.generateKey({name: &quot;RSAES-PKCS1-v1_5&quot;, modulusLength: 2048, publicExponent: new Uint8Array([0x01, 0x00, 0x01])}, extractable, [ ]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegeneratekeymalformedparametershtmlfromrev208547trunkLayoutTestscryptosubtlegeneratekeymalformedparamtershtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/generate-key-malformed-parameters.html (from rev 208547, trunk/LayoutTests/crypto/subtle/generate-key-malformed-paramters.html) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/generate-key-malformed-parameters.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/generate-key-malformed-parameters.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,67 @@
</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 a CryptoKey object with malformed parameters&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+// Not enough arguments.
+shouldReject('crypto.subtle.generateKey()');
+shouldReject('crypto.subtle.generateKey(1)');
+shouldReject('crypto.subtle.generateKey(1, 2)');
+// Malformed AlgorithmIdentifiers.
+shouldReject('crypto.subtle.generateKey(&quot;foo&quot;, 2, 3)');
+shouldReject('crypto.subtle.generateKey({name: 1}, 2, 3)');
+shouldReject('crypto.subtle.generateKey({name: true}, 2, 3)');
+shouldReject('crypto.subtle.generateKey({name: null}, 2, 3)');
+shouldReject('crypto.subtle.generateKey({name: undefined}, 2, 3)');
+shouldReject('crypto.subtle.generateKey({name: Symbol()}, 2, 3)');
+shouldReject('crypto.subtle.generateKey({name: { }}, 2, 3)');
+shouldReject('crypto.subtle.generateKey({name: &quot;foo&quot;}, 2, 3)');
+// Malformed Hash.
+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: true}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: 1}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: null}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: undefined}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: Symbol()}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: { }}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;foo&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: true}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: 1}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: null}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: undefined}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: Symbol()}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: { }}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: &quot;foo&quot;}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+// Algorithms not supported generateKey op.
+shouldReject('crypto.subtle.generateKey({name: &quot;SHA-1&quot;}, 2, 3)');
+shouldReject('crypto.subtle.generateKey({name: &quot;SHA-256&quot;}, 2, 3)');
+shouldReject('crypto.subtle.generateKey({name: &quot;SHA-384&quot;}, 2, 3)');
+shouldReject('crypto.subtle.generateKey({name: &quot;SHA-512&quot;}, 2, 3)');
+// Wrong KeyUsage type.
+shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, 3)');
+shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, true)');
+shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, null)');
+shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, undefined)');
+shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, Symbol())');
+shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, { })');
+shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, &quot;foo&quot;)');
+shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, [&quot;foo&quot;])');
+// Syntax error.
+shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, [ ])');
+shouldReject('crypto.subtle.generateKey({name: &quot;RSAES-PKCS1-v1_5&quot;, modulusLength: 2048, publicExponent: new Uint8Array([0x01, 0x00, 0x01])}, extractable, [ ])', 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="trunkLayoutTestscryptosubtlegeneratekeymalformedparamtersexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/generate-key-malformed-paramters-expected.txt (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/generate-key-malformed-paramters-expected.txt        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/subtle/generate-key-malformed-paramters-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -1,48 +0,0 @@
</span><del>-Test generating a CryptoKey object with malformed parameters
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS crypto.subtle.generateKey() rejected promise  with TypeError: Not enough arguments.
-PASS crypto.subtle.generateKey(1) rejected promise  with TypeError: Not enough arguments.
-PASS crypto.subtle.generateKey(1, 2) rejected promise  with TypeError: Not enough arguments.
-PASS crypto.subtle.generateKey(1, 2, 3) rejected promise  with TypeError: Invalid AlgorithmIdentifier.
-PASS crypto.subtle.generateKey(&quot;foo&quot;, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: 1}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: true}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: null}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: undefined}, 2, 3) rejected promise  with TypeError: Member CryptoAlgorithmParameters.name is required and must be an instance of DOMString.
-PASS crypto.subtle.generateKey({name: Symbol()}, 2, 3) rejected promise  with TypeError: Cannot convert a symbol to a string.
-PASS crypto.subtle.generateKey({name: { }}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: &quot;foo&quot;}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: true}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Invalid AlgorithmIdentifier.
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: 1}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Invalid AlgorithmIdentifier.
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: null}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Invalid AlgorithmIdentifier.
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: undefined}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Member HmacKeyGenParams.hash is required and must be an instance of any.
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: Symbol()}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Invalid AlgorithmIdentifier.
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: { }}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Member CryptoAlgorithmParameters.name is required and must be an instance of DOMString.
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;foo&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: true}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: 1}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: null}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: undefined}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Member CryptoAlgorithmParameters.name is required and must be an instance of DOMString.
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: Symbol()}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Cannot convert a symbol to a string.
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: { }}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: &quot;foo&quot;}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: &quot;SHA-1&quot;}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: &quot;SHA-256&quot;}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: &quot;SHA-384&quot;}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: &quot;SHA-512&quot;}, 2, 3) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, 3) rejected promise  with TypeError: Type error.
-PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, true) rejected promise  with TypeError: Type error.
-PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, null) rejected promise  with TypeError: null is not an object (evaluating 'crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, null)').
-PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, undefined) rejected promise  with TypeError: undefined is not an object (evaluating 'crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, undefined)').
-PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, Symbol()) rejected promise  with TypeError: Type error.
-PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, { }) rejected promise  with TypeError: Type error.
-PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, &quot;foo&quot;) rejected promise  with TypeError: Invalid KeyUsages.
-PASS crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, [ ]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
-PASS crypto.subtle.generateKey({name: &quot;RSAES-PKCS1-v1_5&quot;, modulusLength: 2048, publicExponent: new Uint8Array([0x01, 0x00, 0x01])}, extractable, [ ]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegeneratekeymalformedparamtershtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/generate-key-malformed-paramters.html (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/generate-key-malformed-paramters.html        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/subtle/generate-key-malformed-paramters.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -1,67 +0,0 @@
</span><del>-&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 a CryptoKey object with malformed parameters&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-// Not enough arguments.
-shouldReject('crypto.subtle.generateKey()');
-shouldReject('crypto.subtle.generateKey(1)');
-shouldReject('crypto.subtle.generateKey(1, 2)');
-shouldReject('crypto.subtle.generateKey(1, 2, 3)');
-// Malformed AlgorithmIdentifiers.
-shouldReject('crypto.subtle.generateKey(&quot;foo&quot;, 2, 3)');
-shouldReject('crypto.subtle.generateKey({name: 1}, 2, 3)');
-shouldReject('crypto.subtle.generateKey({name: true}, 2, 3)');
-shouldReject('crypto.subtle.generateKey({name: null}, 2, 3)');
-shouldReject('crypto.subtle.generateKey({name: undefined}, 2, 3)');
-shouldReject('crypto.subtle.generateKey({name: Symbol()}, 2, 3)');
-shouldReject('crypto.subtle.generateKey({name: { }}, 2, 3)');
-shouldReject('crypto.subtle.generateKey({name: &quot;foo&quot;}, 2, 3)');
-// Malformed Hash.
-shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: true}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: 1}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: null}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: undefined}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: Symbol()}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: { }}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;foo&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: true}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: 1}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: null}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: undefined}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: Symbol()}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: { }}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: {name: &quot;foo&quot;}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-// Algorithms not supported generateKey op.
-shouldReject('crypto.subtle.generateKey({name: &quot;SHA-1&quot;}, 2, 3)');
-shouldReject('crypto.subtle.generateKey({name: &quot;SHA-256&quot;}, 2, 3)');
-shouldReject('crypto.subtle.generateKey({name: &quot;SHA-384&quot;}, 2, 3)');
-shouldReject('crypto.subtle.generateKey({name: &quot;SHA-512&quot;}, 2, 3)');
-// Wrong KeyUsage type.
-shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, 3)');
-shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, true)');
-shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, null)');
-shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, undefined)');
-shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, Symbol())');
-shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, { })');
-shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, &quot;foo&quot;)');
-// Syntax error.
-shouldReject('crypto.subtle.generateKey({name: &quot;AES-CBC&quot;, length: 128}, extractable, [ ])');
-shouldReject('crypto.subtle.generateKey({name: &quot;RSAES-PKCS1-v1_5&quot;, modulusLength: 2048, publicExponent: new Uint8Array([0x01, 0x00, 0x01])}, extractable, [ ])', 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="trunkLayoutTestscryptosubtlehmacgeneratekeycustomizedlengthexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length-expected.txt (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length-expected.txt        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> PASS key.type is 'secret'
</span><span class="cx"> PASS key.extractable is true
</span><span class="cx"> PASS key.algorithm.name is 'HMAC'
</span><del>-PASS key.algorithm.length is 111
</del><ins>+PASS key.algorithm.length is 120
</ins><span class="cx"> PASS key.algorithm.hash.name is 'SHA-512'
</span><span class="cx"> PASS key.usages is [&quot;sign&quot;, &quot;verify&quot;]
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacgeneratekeycustomizedlengthhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length.html (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length.html        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -16,13 +16,13 @@
</span><span class="cx"> var extractable = true;
</span><span class="cx"> 
</span><span class="cx"> debug(&quot;\nGenerating a key...&quot;);
</span><del>-crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-512&quot;, length: 111}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
</del><ins>+crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-512&quot;, length: 120}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
</ins><span class="cx">     key = result;
</span><span class="cx"> 
</span><span class="cx">     shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
</span><span class="cx">     shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
</span><del>-    shouldBe(&quot;key.algorithm.length&quot;, &quot;111&quot;);
</del><ins>+    shouldBe(&quot;key.algorithm.length&quot;, &quot;120&quot;);
</ins><span class="cx">     shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-512'&quot;);
</span><span class="cx">     shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacgeneratekeymalformedparametersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -3,8 +3,8 @@
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS crypto.subtle.generateKey(&quot;hmac&quot;, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Member HmacKeyGenParams.hash is required and must be an instance of any.
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Member HmacKeyGenParams.hash is required and must be an instance of any.
</del><ins>+PASS crypto.subtle.generateKey(&quot;hmac&quot;, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Member HmacKeyParams.hash is required and must be an instance of any.
+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Member HmacKeyParams.hash is required and must be an instance of any.
</ins><span class="cx"> PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: null}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
</span><span class="cx"> PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: Symbol()}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with TypeError: Cannot convert a symbol to a number.
</span><span class="cx"> PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: { }}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
</span><span class="lines">@@ -16,6 +16,7 @@
</span><span class="cx"> PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;wrapKey&quot;]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
</span><span class="cx"> PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;unwrapKey&quot;]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
</span><span class="cx"> PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: 0}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
</span><ins>+PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: 5}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with OperationError (DOM Exception 34): The operation failed for an operation-specific reason.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacgeneratekeymalformedparametershtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters.html (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters.html        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/subtle/hmac-generate-key-malformed-parameters.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;unwrapKey&quot;])');
</span><span class="cx"> // Wrong length
</span><span class="cx"> shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: 0}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
</span><ins>+shouldReject('crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: 5}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
</ins><span class="cx"> &lt;/script&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkkeyminimumexpectedtxtfromrev208547trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-minimum-expected.txt (from rev 208547, trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-minimum-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-minimum-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test importing a JWK HMAC key with minimum JWK information
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 128
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkkeyminimumhtmlfromrev208547trunkLayoutTestscryptosubtlehmacgeneratekeycustomizedlengthhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-minimum.html (from rev 208547, trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length.html) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-minimum.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-minimum.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,40 @@
</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 importing a JWK HMAC key with minimum JWK information&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkkeynonextractableexpectedtxtfromrev208547trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-non-extractable-expected.txt (from rev 208547, trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-non-extractable-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-non-extractable-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test importing a non-extractable JWK HMAC key
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is false
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 128
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkkeynonextractablehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-non-extractable.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-non-extractable.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-non-extractable.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,41 @@
</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 importing a non-extractable JWK HMAC key&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;,
+    ext: true,
+};
+var nonExtractable = false;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, nonExtractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;false&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkkeysha1expectedtxtfromrev208547trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha1-expected.txt (from rev 208547, trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha1-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test importing a JWK HMAC key with SHA-1
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 128
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkkeysha1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha1.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha1.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha1.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,44 @@
</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 importing a JWK HMAC key with SHA-1&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;,
+    alg: &quot;HS1&quot;,
+    use: &quot;sig&quot;,
+    key_ops: [&quot;sign&quot;, &quot;verify&quot;],
+    ext: true,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkkeysha224expectedtxtfromrev208547trunkLayoutTestscryptowebkitSubtlehmacpostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha224-expected.txt (from rev 208547, trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha224-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha224-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test importing a JWK HMAC key with SHA-224
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 128
+PASS key.algorithm.hash.name is 'SHA-224'
+PASS key.usages is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkkeysha224html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha224.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha224.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha224.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,44 @@
</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 importing a JWK HMAC key with SHA-224&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;,
+    alg: &quot;HS224&quot;,
+    use: &quot;sig&quot;,
+    key_ops: [&quot;sign&quot;, &quot;verify&quot;],
+    ext: true,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;hmac&quot;, hash: &quot;sha-224&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-224'&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkkeysha256expectedtxtfromrev208547trunkLayoutTestscryptowebkitSubtlehmacpostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha256-expected.txt (from rev 208547, trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha256-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha256-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test importing a JWK HMAC key with SHA-256
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 128
+PASS key.algorithm.hash.name is 'SHA-256'
+PASS key.usages is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkkeysha256html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha256.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha256.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha256.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,44 @@
</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 importing a JWK HMAC key with SHA-256&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;,
+    alg: &quot;HS256&quot;,
+    use: &quot;sig&quot;,
+    key_ops: [&quot;sign&quot;, &quot;verify&quot;],
+    ext: true,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;hmac&quot;, hash: &quot;sha-256&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-256'&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkkeysha384expectedtxtfromrev208547trunkLayoutTestscryptowebkitSubtlehmacpostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha384-expected.txt (from rev 208547, trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha384-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha384-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test importing a JWK HMAC key with SHA-384
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 128
+PASS key.algorithm.hash.name is 'SHA-384'
+PASS key.usages is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkkeysha384html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha384.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha384.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha384.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,44 @@
</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 importing a JWK HMAC key with SHA-384&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;,
+    alg: &quot;HS384&quot;,
+    use: &quot;sig&quot;,
+    key_ops: [&quot;sign&quot;, &quot;verify&quot;],
+    ext: true,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;hmac&quot;, hash: &quot;sha-384&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-384'&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkkeysha512expectedtxtfromrev208547trunkLayoutTestscryptosubtlehmacgeneratekeycustomizedlengthexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha512-expected.txt (from rev 208547, trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length-expected.txt) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha512-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha512-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test importing a JWK HMAC key with SHA-512
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 128
+PASS key.algorithm.hash.name is 'SHA-512'
+PASS key.usages is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkkeysha512htmlfromrev208547trunkLayoutTestscryptosubtlehmacgeneratekeycustomizedlengthhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha512.html (from rev 208547, trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length.html) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha512.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-key-sha512.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,44 @@
</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 importing a JWK HMAC key with SHA-512&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;,
+    alg: &quot;HS512&quot;,
+    use: &quot;sig&quot;,
+    key_ops: [&quot;sign&quot;, &quot;verify&quot;],
+    ext: true,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;hmac&quot;, hash: &quot;sha-512&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-512'&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&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="trunkLayoutTestscryptosubtlehmacimportmalformedparametersexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/hmac-import-malformed-parameters-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-malformed-parameters-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-malformed-parameters-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+Test importing an HMAC key with malformed parameters
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS crypto.subtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;&quot;), {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;raw&quot;, rawKey, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: 257}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;raw&quot;, rawKey, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: 248}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS224&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS256&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-224&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS384&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-256&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS512&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-384&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS1&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-512&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: &quot;!!!&quot;, alg: &quot;foo&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS1&quot;, use: &quot;enc&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS1&quot;, key_ops: [&quot;sign&quot;]}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS1&quot;, ext: false}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportmalformedparametershtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/hmac-import-malformed-parameters.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-malformed-parameters.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-malformed-parameters.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,45 @@
</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 importing an HMAC key with malformed parameters&quot;);
+
+var rawKey = asciiToUint8Array(&quot;jnOw99oOZFLIEPMrgJB55WL46tJSLGt7&quot;);
+var extractable = true;
+
+var k = &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;;
+
+// wrong length
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;&quot;), {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, rawKey, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: 257}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, rawKey, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: 248}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+// Jwk: Wrong kty
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+// Jwk: missing k
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+// Jwk: wrong hash and alg
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS224&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS256&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-224&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS384&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-256&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS512&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-384&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS1&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-512&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+// Jwk: wrong k format
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: &quot;!!!&quot;, alg: &quot;foo&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+// Jwk: wrong use
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS1&quot;, use: &quot;enc&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+// Jwk: wrong key_ops
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS1&quot;, key_ops: [&quot;sign&quot;]}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+// Jwk: wrong ext
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, k: k, alg: &quot;HS1&quot;, ext: false}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+&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="trunkLayoutTestscryptosubtlehmacimportrawkeycustomizedlengthexpectedtxtfromrev208547trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-customized-length-expected.txt (from rev 208547, trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-customized-length-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-customized-length-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test importing a raw HMAC key with customized length
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 128
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportrawkeycustomizedlengthhtmlfromrev208547trunkLayoutTestscryptosubtlehmacgeneratekeycustomizedlengthhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-customized-length.html (from rev 208547, trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length.html) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-customized-length.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-customized-length.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,37 @@
</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 importing a raw HMAC key with customized length&quot;);
+
+jsTestIsAsync = true;
+
+var rawKey = asciiToUint8Array(&quot;jnOw99oOZFLIEPMr&quot;);
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;raw&quot;, rawKey, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: 128}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportrawkeyexpectedtxtfromrev208547trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-expected.txt (from rev 208547, trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-raw-key-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test importing a raw HMAC key
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 128
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportrawkeyhtmlfromrev208547trunkLayoutTestscryptosubtlehmacgeneratekeycustomizedlengthhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/hmac-import-raw-key.html (from rev 208547, trunk/LayoutTests/crypto/subtle/hmac-generate-key-customized-length.html) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-raw-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-raw-key.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,37 @@
</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 importing a raw HMAC key&quot;);
+
+jsTestIsAsync = true;
+
+var rawKey = asciiToUint8Array(&quot;jnOw99oOZFLIEPMr&quot;);
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;raw&quot;, rawKey, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtleimportkeymalformedparametersexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/import-key-malformed-parameters-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/import-key-malformed-parameters-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/import-key-malformed-parameters-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+Test importing a key with malformed parameters
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS crypto.subtle.importKey() rejected promise  with TypeError: Not enough arguments.
+PASS crypto.subtle.importKey(1) rejected promise  with TypeError: Not enough arguments.
+PASS crypto.subtle.importKey(1, 2) rejected promise  with TypeError: Not enough arguments.
+PASS crypto.subtle.importKey(1, 2, 3) rejected promise  with TypeError: Not enough arguments.
+PASS crypto.subtle.importKey(1, 2, 3, 4) rejected promise  with TypeError: Not enough arguments.
+PASS crypto.subtle.importKey(1, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(true, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(null, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(undefined, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(Symbol(), rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey({ }, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(&quot;foo&quot;, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(&quot;pkcs8&quot;, rawKey, &quot;rsaes-pkcs1-v1_5&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.importKey(&quot;spki&quot;, rawKey, &quot;rsaes-pkcs1-v1_5&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]) rejected promise  with NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.subtle.importKey(&quot;raw&quot;, jwkKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(&quot;raw&quot;, 1, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(&quot;raw&quot;, true, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(&quot;raw&quot;, null, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(&quot;raw&quot;, undefined, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(&quot;raw&quot;, Symbol(), &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(&quot;raw&quot;, { }, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(&quot;raw&quot;, &quot;foo&quot;, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Member JsonWebKey.kty is required and must be an instance of DOMString.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, 1, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, true, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, Symbol(), &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, { }, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Member JsonWebKey.kty is required and must be an instance of DOMString.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, &quot;foo&quot;, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Type error.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, undefined, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Member JsonWebKey.kty is required and must be an instance of DOMString.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, null, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Member JsonWebKey.kty is required and must be an instance of DOMString.
+PASS crypto.subtle.importKey(&quot;raw&quot;, rawKey, &quot;aes-cbc&quot;, extractable, [ ]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, jwkPrivateKey, &quot;rsaes-pkcs1-v1_5&quot;, extractable, [ ]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: undefined}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Member JsonWebKey.kty is required and must be an instance of DOMString.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, key_ops: [&quot;foo&quot;]}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with TypeError: Invalid key_ops.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtleimportkeymalformedparametershtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/import-key-malformed-parameters.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/import-key-malformed-parameters.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/import-key-malformed-parameters.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,82 @@
</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 importing a key with malformed parameters&quot;);
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;,
+    alg: &quot;A128CBC&quot;
+};
+var rawKey = asciiToUint8Array(&quot;jnOw99oOZFLIEPMrgJB55WL46tJSLGt7&quot;);
+var jwkPrivateKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA1_5&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;decrypt&quot;],
+    ext: true,
+    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;,
+};
+var extractable = true;
+
+// Not enough arguments.
+shouldReject('crypto.subtle.importKey()');
+shouldReject('crypto.subtle.importKey(1)');
+shouldReject('crypto.subtle.importKey(1, 2)');
+shouldReject('crypto.subtle.importKey(1, 2, 3)');
+shouldReject('crypto.subtle.importKey(1, 2, 3, 4)');
+// Wrong formats.
+shouldReject('crypto.subtle.importKey(1, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(true, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(null, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(undefined, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(Symbol(), rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey({ }, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;foo&quot;, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+// Currently not support formats.
+shouldReject('crypto.subtle.importKey(&quot;pkcs8&quot;, rawKey, &quot;rsaes-pkcs1-v1_5&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;spki&quot;, rawKey, &quot;rsaes-pkcs1-v1_5&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;])');
+// Wrong KeyData.
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, jwkKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, 1, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, true, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, null, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, undefined, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, Symbol(), &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, { }, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, &quot;foo&quot;, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, 1, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, true, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, Symbol(), &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, { }, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, &quot;foo&quot;, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, undefined, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, null, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+// Null usages.
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, rawKey, &quot;aes-cbc&quot;, extractable, [ ])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, jwkPrivateKey, &quot;rsaes-pkcs1-v1_5&quot;, extractable, [ ])');
+// JWK: missing kty.
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: undefined}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+// JWK: wrong key_ops.
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, key_ops: [&quot;foo&quot;]}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+&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="trunkLayoutTestscryptosubtlersaimportkeymalformedparametersexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+Test importing a RSA key with malformed parameters
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;verify&quot;]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;decrypt&quot;, &quot;unwrapKey&quot;]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, use: &quot;sig&quot;}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, use: &quot;enc&quot;}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, use: &quot;sig&quot;}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;foo&quot;}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RS224&quot;}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RS256&quot;}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-224&quot;}, extractable, [&quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RS384&quot;}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-256&quot;}, extractable, [&quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RS512&quot;}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-384&quot;}, extractable, [&quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RS1&quot;}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-512&quot;}, extractable, [&quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RSA-OAEP-224&quot;}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RSA-OAEP-256&quot;}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-224&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RSA-OAEP-384&quot;}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-256&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RSA-OAEP-512&quot;}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-384&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RSA-OAEP&quot;}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-512&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, n: n, e: e}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, key_ops: [&quot;sign&quot;, &quot;verify&quot;]}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, ext: false}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, e: e}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d, p: p, q: q, dp: dp, dq: dq, qi: qi, oth: [{r: q, d: dq, t: qi}]}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d, q: q, dp: dp, dq: dq, qi: qi}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d, p: p, dp: dp, dq: dq, qi: qi}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d, p: p, q: q, dq: dq, qi: qi}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d, p: p, q: q, dp: dp, qi: qi}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d, p: p, q: q, dp: dp, dq: dq}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaimportkeymalformedparametershtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-import-key-malformed-parameters.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,71 @@
</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 importing a RSA key with malformed parameters&quot;);
+
+var extractable = true;
+
+var n = &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;;
+var e = &quot;AQAB&quot;;
+var d = &quot;eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ&quot;;
+var p = &quot;4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0&quot;;
+var q = &quot;xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc&quot;;
+var dp = &quot;fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk&quot;;
+var dq = &quot;jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE&quot;;
+var qi = &quot;YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk&quot;;
+
+// Jwk: Wrong usages
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;verify&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;decrypt&quot;, &quot;unwrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;])');
+// Jwk: Wrong use
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, use: &quot;sig&quot;}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, use: &quot;enc&quot;}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;verify&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, use: &quot;sig&quot;}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;])');
+// Jwk: Wrong alg
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;foo&quot;}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RS224&quot;}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;verify&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RS256&quot;}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-224&quot;}, extractable, [&quot;verify&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RS384&quot;}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-256&quot;}, extractable, [&quot;verify&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RS512&quot;}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-384&quot;}, extractable, [&quot;verify&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RS1&quot;}, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;sha-512&quot;}, extractable, [&quot;verify&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RSA-OAEP-224&quot;}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RSA-OAEP-256&quot;}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-224&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RSA-OAEP-384&quot;}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-256&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RSA-OAEP-512&quot;}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-384&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, alg: &quot;RSA-OAEP&quot;}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-512&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;])');
+// Jwk: Wrong kty
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;oct&quot;, n: n, e: e}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;])');
+// Jwk: Wrong key_ops
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, key_ops: [&quot;sign&quot;, &quot;verify&quot;]}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;])');
+// Jwk: Wrong ext
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, ext: false}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;])');
+// Jwk: Missing n or e
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, e: e}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;])');
+// Jwk: We currently only support import private key with two prime factors
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d, p: p, q: q, dp: dp, dq: dq, qi: qi, oth: [{r: q, d: dq, t: qi}]}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;])');
+// Jwk: miss any of p, q, dp, dq, qi
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d, q: q, dp: dp, dq: dq, qi: qi}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d, p: p, dp: dp, dq: dq, qi: qi}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d, p: p, q: q, dq: dq, qi: qi}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d, p: p, q: q, dp: dp, qi: qi}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;])');
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d, p: p, q: q, dp: dp, dq: dq}, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;])');
+&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="trunkLayoutTestscryptosubtlersaoaepimportjwkprivatekeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-private-key-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-private-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-private-key-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Test importing a JWK RSA-OAEP private key with SHA-1
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS privateKey.toString() is '[object CryptoKey]'
+PASS privateKey.type is 'private'
+PASS privateKey.extractable is true
+PASS privateKey.algorithm.name is 'RSA-OAEP'
+PASS privateKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(privateKey.algorithm.publicExponent) is '010001'
+PASS privateKey.algorithm.hash.name is 'SHA-1'
+PASS privateKey.usages is ['decrypt', 'unwrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepimportjwkprivatekeyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-private-key.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-private-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-private-key.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,53 @@
</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 importing a JWK RSA-OAEP private key with SHA-1&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;decrypt&quot;, &quot;unwrapKey&quot;],
+    ext: true,
+    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;,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSA-OAEP&quot;, hash: &quot;SHA-1&quot;}, extractable, [&quot;decrypt&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    privateKey = result;
+
+    shouldBe(&quot;privateKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;privateKey.type&quot;, &quot;'private'&quot;);
+    shouldBe(&quot;privateKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;privateKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
+    shouldBe(&quot;privateKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(privateKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;privateKey.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;privateKey.usages&quot;, &quot;['decrypt', 'unwrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha1-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha1-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Test importing a JWK RSA-OAEP public key with SHA-1
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS publicKey.toString() is '[object CryptoKey]'
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSA-OAEP'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash.name is 'SHA-1'
+PASS publicKey.usages is ['encrypt', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha1.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha1.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha1.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,47 @@
</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 importing a JWK RSA-OAEP public key with SHA-1&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;encrypt&quot;, &quot;wrapKey&quot;],
+    ext: true,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSA-OAEP&quot;, hash: &quot;SHA-1&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;publicKey.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['encrypt', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha224expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha224-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha224-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha224-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Test importing a JWK RSA-OAEP public key with SHA-224
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS publicKey.toString() is '[object CryptoKey]'
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSA-OAEP'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash.name is 'SHA-224'
+PASS publicKey.usages is ['encrypt', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha224html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha224.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha224.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha224.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,47 @@
</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 importing a JWK RSA-OAEP public key with SHA-224&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP-224&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;encrypt&quot;, &quot;wrapKey&quot;],
+    ext: true,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSA-OAEP&quot;, hash: &quot;SHA-224&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;publicKey.algorithm.hash.name&quot;, &quot;'SHA-224'&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['encrypt', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha256expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha256-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha256-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha256-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Test importing a JWK RSA-OAEP public key with SHA-256
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS publicKey.toString() is '[object CryptoKey]'
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSA-OAEP'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash.name is 'SHA-256'
+PASS publicKey.usages is ['encrypt', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha256html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha256.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha256.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha256.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,47 @@
</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 importing a JWK RSA-OAEP public key with SHA-256&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP-256&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;encrypt&quot;, &quot;wrapKey&quot;],
+    ext: true,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSA-OAEP&quot;, hash: &quot;SHA-256&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;publicKey.algorithm.hash.name&quot;, &quot;'SHA-256'&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['encrypt', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha384expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha384-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha384-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha384-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Test importing a JWK RSA-OAEP public key with SHA-384
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS publicKey.toString() is '[object CryptoKey]'
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSA-OAEP'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash.name is 'SHA-384'
+PASS publicKey.usages is ['encrypt', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha384html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha384.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha384.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha384.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,47 @@
</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 importing a JWK RSA-OAEP public key with SHA-384&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP-384&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;encrypt&quot;, &quot;wrapKey&quot;],
+    ext: true,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSA-OAEP&quot;, hash: &quot;SHA-384&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;publicKey.algorithm.hash.name&quot;, &quot;'SHA-384'&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['encrypt', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha512expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha512-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha512-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha512-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Test importing a JWK RSA-OAEP public key with SHA-512
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS publicKey.toString() is '[object CryptoKey]'
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSA-OAEP'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash.name is 'SHA-512'
+PASS publicKey.usages is ['encrypt', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepimportjwkpublickeysha512html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha512.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha512.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-import-jwk-public-key-sha512.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,47 @@
</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 importing a JWK RSA-OAEP public key with SHA-512&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP-512&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;encrypt&quot;, &quot;wrapKey&quot;],
+    ext: true,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSA-OAEP&quot;, hash: &quot;SHA-512&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;publicKey.algorithm.hash.name&quot;, &quot;'SHA-512'&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['encrypt', 'wrapKey']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkprivatekeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Test importing a JWK RSAES-PKCS1-v1_5 private key
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS privateKey.toString() is '[object CryptoKey]'
+PASS privateKey.type is 'private'
+PASS privateKey.extractable is true
+PASS privateKey.algorithm.name is 'RSAES-PKCS1-v1_5'
+PASS privateKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(privateKey.algorithm.publicExponent) is '010001'
+PASS privateKey.algorithm.hash is undefined.
+PASS privateKey.usages is ['decrypt']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkprivatekeyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,53 @@
</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 importing a JWK RSAES-PKCS1-v1_5 private key&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA1_5&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;decrypt&quot;],
+    ext: true,
+    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;,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;decrypt&quot;]).then(function(result) {
+    privateKey = result;
+
+    shouldBe(&quot;privateKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;privateKey.type&quot;, &quot;'private'&quot;);
+    shouldBe(&quot;privateKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;privateKey.algorithm.name&quot;, &quot;'RSAES-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;privateKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(privateKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBeUndefined(&quot;privateKey.algorithm.hash&quot;);
+    shouldBe(&quot;privateKey.usages&quot;, &quot;['decrypt']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Test importing a JWK RSAES-PKCS1-v1_5 public key
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS publicKey.toString() is '[object CryptoKey]'
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSAES-PKCS1-v1_5'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash is undefined.
+PASS publicKey.usages is ['encrypt']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeyleadingzeroexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+Test importing a JWK RSAES-PKCS1-v1_5 public key with leading zero
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSAES-PKCS1-v1_5'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash is undefined.
+PASS publicKey.usages is ['encrypt']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeyleadingzerohtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero.html        2016-11-10 18:36:44 UTC (rev 208548)
</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 importing a JWK RSAES-PKCS1-v1_5 public key with leading zero&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    n: &quot;AGFiY2RlZmdoYWJjZGVmZ2hhYmNkZWZnaGFiY2RlZmdoYWJjZGVmZ2hhYmNkZWZnaGFiY2RlZmdoYWJjZGVmZ2hhYmNkZWZnaGFiY2RlZmdoYWJjZGVmZ2hhYmNkZWZnaGFiY2RlZmdoYWJjZGVmZ2hhYmNkZWZnaGFiY2RlZmdoYWJjZGVmZ2hhYmNkZWZnaGFiY2RlZmdoYWJjZGVmZ2hhYmNkZWZnaGFiY2RlZmdoYWJjZGVmZ2hhYmNkZWZnaGFiY2RlZmdoYWJjZGVmZ2hhYmNkZWZnaGFiY2RlZmdoYWJjZGVmZ2hhYmNkZWZnaGFiY2RlZmdoYWJjZGVmZ2g&quot;,
+    e: &quot;AQAB&quot;
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSAES-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBeUndefined(&quot;publicKey.algorithm.hash&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['encrypt']&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="trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeyminimumexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+Test importing a JWK RSAES-PKCS1-v1_5 public key with minimum information
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSAES-PKCS1-v1_5'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash is undefined.
+PASS publicKey.usages is ['encrypt']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeyminimumhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum.html        2016-11-10 18:36:44 UTC (rev 208548)
</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 importing a JWK RSAES-PKCS1-v1_5 public key with minimum information&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSAES-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBeUndefined(&quot;publicKey.algorithm.hash&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['encrypt']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeynonextractableexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+Test importing a non-extractable JWK RSAES-PKCS1-v1_5 public key
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is false
+PASS publicKey.algorithm.name is 'RSAES-PKCS1-v1_5'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash is undefined.
+PASS publicKey.usages is ['encrypt']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeynonextractablehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable.html        2016-11-10 18:36:44 UTC (rev 208548)
</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 importing a non-extractable JWK RSAES-PKCS1-v1_5 public key&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA1_5&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;encrypt&quot;],
+    ext: true,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+var nonExtractable = false;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, &quot;RSAES-PKCS1-v1_5&quot;, nonExtractable, [&quot;encrypt&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;false&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSAES-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBeUndefined(&quot;publicKey.algorithm.hash&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['encrypt']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5importjwkpublickeyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,47 @@
</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 importing a JWK RSAES-PKCS1-v1_5 public key&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA1_5&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;encrypt&quot;],
+    ext: true,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, &quot;RSAES-PKCS1-v1_5&quot;, extractable, [&quot;encrypt&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSAES-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBeUndefined(&quot;publicKey.algorithm.hash&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['encrypt']&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_5importjwkprivatekeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Test importing a JWK RSASSA-PKCS1-v1_5 private key with SHA-1
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS privateKey.toString() is '[object CryptoKey]'
+PASS privateKey.type is 'private'
+PASS privateKey.extractable is true
+PASS privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS privateKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(privateKey.algorithm.publicExponent) is '010001'
+PASS privateKey.algorithm.hash.name is 'SHA-1'
+PASS privateKey.usages is ['sign']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkprivatekeyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,53 @@
</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 importing a JWK RSASSA-PKCS1-v1_5 private key with SHA-1&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS1&quot;,
+    use: &quot;sig&quot;,
+    key_ops: [&quot;sign&quot;],
+    ext: true,
+    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;,
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;SHA-1&quot;}, extractable, [&quot;sign&quot;]).then(function(result) {
+    privateKey = result;
+
+    shouldBe(&quot;privateKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;privateKey.type&quot;, &quot;'private'&quot;);
+    shouldBe(&quot;privateKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;privateKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;privateKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(privateKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;privateKey.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;privateKey.usages&quot;, &quot;['sign']&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 class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Test importing a JWK RSASSA-PKCS1-v1_5 public key with SHA-1
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS publicKey.toString() is '[object CryptoKey]'
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash.name is 'SHA-1'
+PASS publicKey.usages is ['verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,47 @@
</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 importing a JWK RSASSA-PKCS1-v1_5 public key with SHA-1&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS1&quot;,
+    use: &quot;sig&quot;,
+    key_ops: [&quot;verify&quot;],
+    ext: true,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;SHA-1&quot;}, extractable, [&quot;verify&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;publicKey.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['verify']&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_5importjwkpublickeysha224expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Test importing a JWK RSASSA-PKCS1-v1_5 public key with SHA-224
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS publicKey.toString() is '[object CryptoKey]'
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash.name is 'SHA-224'
+PASS publicKey.usages is ['verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha224html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,47 @@
</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 importing a JWK RSASSA-PKCS1-v1_5 public key with SHA-224&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS224&quot;,
+    use: &quot;sig&quot;,
+    key_ops: [&quot;verify&quot;],
+    ext: true,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;SHA-224&quot;}, extractable, [&quot;verify&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;publicKey.algorithm.hash.name&quot;, &quot;'SHA-224'&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['verify']&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_5importjwkpublickeysha256expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Test importing a JWK RSASSA-PKCS1-v1_5 public key with SHA-256
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS publicKey.toString() is '[object CryptoKey]'
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash.name is 'SHA-256'
+PASS publicKey.usages is ['verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha256html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,47 @@
</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 importing a JWK RSASSA-PKCS1-v1_5 public key with SHA-256&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    use: &quot;sig&quot;,
+    key_ops: [&quot;verify&quot;],
+    ext: true,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;SHA-256&quot;}, extractable, [&quot;verify&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;publicKey.algorithm.hash.name&quot;, &quot;'SHA-256'&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['verify']&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_5importjwkpublickeysha384expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Test importing a JWK RSASSA-PKCS1-v1_5 public key with SHA-384
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS publicKey.toString() is '[object CryptoKey]'
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash.name is 'SHA-384'
+PASS publicKey.usages is ['verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha384html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,47 @@
</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 importing a JWK RSASSA-PKCS1-v1_5 public key with SHA-384&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS384&quot;,
+    use: &quot;sig&quot;,
+    key_ops: [&quot;verify&quot;],
+    ext: true,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;SHA-384&quot;}, extractable, [&quot;verify&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;publicKey.algorithm.hash.name&quot;, &quot;'SHA-384'&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['verify']&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_5importjwkpublickeysha512expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Test importing a JWK RSASSA-PKCS1-v1_5 public key with SHA-512
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key...
+PASS publicKey.toString() is '[object CryptoKey]'
+PASS publicKey.type is 'public'
+PASS publicKey.extractable is true
+PASS publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS publicKey.algorithm.hash.name is 'SHA-512'
+PASS publicKey.usages is ['verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkpublickeysha512html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,47 @@
</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 importing a JWK RSASSA-PKCS1-v1_5 public key with SHA-512&quot;);
+
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS512&quot;,
+    use: &quot;sig&quot;,
+    key_ops: [&quot;verify&quot;],
+    ext: true,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+var extractable = true;
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;SHA-512&quot;}, extractable, [&quot;verify&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;publicKey.algorithm.hash.name&quot;, &quot;'SHA-512'&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['verify']&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="trunkLayoutTestscryptowebkitSubtlehmacgeneratekeyexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key-expected.txt (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key-expected.txt        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx"> PASS key.type is 'secret'
</span><span class="cx"> PASS key.extractable is true
</span><span class="cx"> PASS key.algorithm.name is 'HMAC'
</span><del>-PASS key.algorithm.length is 5
</del><ins>+PASS key.algorithm.length is 8
</ins><span class="cx"> PASS key.algorithm.hash.name is 'SHA-1'
</span><span class="cx"> PASS key.usages is [&quot;sign&quot;]
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacgeneratekeyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key.html (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key.html        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">     shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
</span><span class="cx"> 
</span><span class="cx">     debug(&quot;\nGenerating a key with custom length...&quot;);
</span><del>-    return crypto.webkitSubtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: 5}, extractable, [&quot;sign&quot;]);
</del><ins>+    return crypto.webkitSubtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: 8}, extractable, [&quot;sign&quot;]);
</ins><span class="cx"> }).then(function(result) {
</span><span class="cx">     key = result;
</span><span class="cx"> 
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx">     shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
</span><span class="cx">     shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
</span><del>-    shouldBe(&quot;key.algorithm.length&quot;, &quot;5&quot;);
</del><ins>+    shouldBe(&quot;key.algorithm.length&quot;, &quot;8&quot;);
</ins><span class="cx">     shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
</span><span class="cx">     shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;]');
</span><span class="cx">     finishJSTest();
</span></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacimportjwkexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk-expected.txt (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk-expected.txt        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> PASS key.type is 'secret'
</span><span class="cx"> PASS key.extractable is false
</span><span class="cx"> PASS key.algorithm.name is 'HMAC'
</span><del>-PASS key.algorithm.length is 32
</del><ins>+PASS key.algorithm.length is 256
</ins><span class="cx"> PASS key.usages is [&quot;sign&quot;, &quot;verify&quot;]
</span><span class="cx"> 
</span><span class="cx"> Using the key to sign message 'foo'...
</span></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacimportjwkhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk.html (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk.html        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">     shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
</span><span class="cx">     shouldBe(&quot;key.extractable&quot;, &quot;false&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
</span><del>-    shouldBe(&quot;key.algorithm.length&quot;, &quot;32&quot;);
</del><ins>+    shouldBe(&quot;key.algorithm.length&quot;, &quot;256&quot;);
</ins><span class="cx">     shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
</span><span class="cx"> 
</span><span class="cx">     debug(&quot;\nUsing the key to sign message 'foo'...&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacpostMessageexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -6,7 +6,7 @@
</span><span class="cx"> PASS key.type is 'secret'
</span><span class="cx"> PASS key.extractable is true
</span><span class="cx"> PASS key.algorithm.name is 'HMAC'
</span><del>-PASS key.algorithm.length is 16
</del><ins>+PASS key.algorithm.length is 128
</ins><span class="cx"> PASS key.usages is [&quot;sign&quot;, &quot;verify&quot;]
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacpostMessagehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage.html (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage.html        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -17,7 +17,7 @@
</span><span class="cx">     shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
</span><span class="cx">     shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
</span><del>-    shouldBe(&quot;key.algorithm.length&quot;, &quot;16&quot;);
</del><ins>+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
</ins><span class="cx">     shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
</span><span class="cx"> 
</span><span class="cx">     finishJSTest();
</span></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacsignverifyexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-expected.txt (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-expected.txt        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> PASS key.type is 'secret'
</span><span class="cx"> PASS key.extractable is true
</span><span class="cx"> PASS key.algorithm.name is 'HMAC'
</span><del>-PASS key.algorithm.length is 1
</del><ins>+PASS key.algorithm.length is 8
</ins><span class="cx"> PASS key.algorithm.hash.name is 'SHA-1'
</span><span class="cx"> PASS key.usages is ['sign', 'verify']
</span><span class="cx"> Using the key to sign 'foo'...
</span></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacsignverifyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify.html (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify.html        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx">     shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
</span><span class="cx">     shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
</span><span class="cx">     shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
</span><del>-    shouldBe(&quot;key.algorithm.length&quot;, &quot;1&quot;); // See &lt;https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098&gt;.
</del><ins>+    shouldBe(&quot;key.algorithm.length&quot;, &quot;8&quot;); // See &lt;https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098&gt;.
</ins><span class="cx">     shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
</span><span class="cx">     shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleaesimportjwkkeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/aes-import-jwk-key-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/aes-import-jwk-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/aes-import-jwk-key-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+[Worker] Test importing a JWK AES key using AES-CBC algorithm in workers.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Starting worker: resources/aes-import-jwk-key.js
+[Worker] Importing a key...
+PASS [Worker] crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS [Worker] key.type is 'secret'
+PASS [Worker] key.extractable is true
+PASS [Worker] key.algorithm.name is 'AES-CBC'
+PASS [Worker] key.algorithm.length is 128
+PASS [Worker] key.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleaesimportjwkkeyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/aes-import-jwk-key.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/aes-import-jwk-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/aes-import-jwk-key.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,12 @@
</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;/head&gt;
+&lt;body&gt;
+    &lt;script&gt;
+        worker = startWorker('resources/aes-import-jwk-key.js');
+    &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="trunkLayoutTestscryptoworkerssubtleaesimportrawkeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/aes-import-raw-key-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/aes-import-raw-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/aes-import-raw-key-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+[Worker] Test importing a raw AES key using AES-CBC algorithm in workers.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Starting worker: resources/aes-import-raw-key.js
+[Worker] Importing a key...
+PASS [Worker] crypto.subtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;jnOw97&quot;), &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS [Worker] key.type is 'secret'
+PASS [Worker] key.extractable is true
+PASS [Worker] key.algorithm.name is 'AES-CBC'
+PASS [Worker] key.algorithm.length is 128
+PASS [Worker] key.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleaesimportrawkeyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/aes-import-raw-key.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/aes-import-raw-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/aes-import-raw-key.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,12 @@
</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;/head&gt;
+&lt;body&gt;
+    &lt;script&gt;
+        worker = startWorker('resources/aes-import-raw-key.js');
+    &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="trunkLayoutTestscryptoworkerssubtlehmacimportjwkkeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/hmac-import-jwk-key-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/hmac-import-jwk-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/hmac-import-jwk-key-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+[Worker] Test importing a JWK HMAC key with SHA-1 in workers.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Starting worker: resources/hmac-import-jwk-key.js
+[Worker] Importing a key...
+PASS [Worker] crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS [Worker] key.type is 'secret'
+PASS [Worker] key.extractable is true
+PASS [Worker] key.algorithm.name is 'HMAC'
+PASS [Worker] key.algorithm.length is 128
+PASS [Worker] key.algorithm.hash.name is 'SHA-1'
+PASS [Worker] key.usages is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtlehmacimportjwkkeyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/hmac-import-jwk-key.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/hmac-import-jwk-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/hmac-import-jwk-key.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,12 @@
</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;/head&gt;
+&lt;body&gt;
+    &lt;script&gt;
+        worker = startWorker('resources/hmac-import-jwk-key.js');
+    &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="trunkLayoutTestscryptoworkerssubtlehmacimportrawkeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/hmac-import-raw-key-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/hmac-import-raw-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/hmac-import-raw-key-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+[Worker] Test importing a raw HMAC key with SHA-1 in workers.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Starting worker: resources/hmac-import-raw-key.js
+[Worker] Importing a key...
+PASS [Worker] crypto.subtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;&quot;), {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) rejected promise  with DataError (DOM Exception 30): Data provided to an operation does not meet requirements.
+PASS [Worker] key.type is 'secret'
+PASS [Worker] key.extractable is true
+PASS [Worker] key.algorithm.name is 'HMAC'
+PASS [Worker] key.algorithm.length is 128
+PASS [Worker] key.algorithm.hash.name is 'SHA-1'
+PASS [Worker] key.usages is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtlehmacimportrawkeyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/hmac-import-raw-key.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/hmac-import-raw-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/hmac-import-raw-key.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,12 @@
</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;/head&gt;
+&lt;body&gt;
+    &lt;script&gt;
+        worker = startWorker('resources/hmac-import-raw-key.js');
+    &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="trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> PASS key.type is 'secret'
</span><span class="cx"> PASS key.extractable is true
</span><span class="cx"> PASS key.algorithm.name is 'HMAC'
</span><del>-PASS key.algorithm.length is 16
</del><ins>+PASS key.algorithm.length is 128
</ins><span class="cx"> PASS key.algorithm.hash.name is 'SHA-1'
</span><span class="cx"> PASS key.usages is [&quot;sign&quot;, &quot;verify&quot;]
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker.html (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker.html        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx">             shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
</span><span class="cx">             shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
</span><span class="cx">             shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
</span><del>-            shouldBe(&quot;key.algorithm.length&quot;, &quot;16&quot;);
</del><ins>+            shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
</ins><span class="cx">             shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
</span><span class="cx">             shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleresourcesaesimportjwkkeyjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/resources/aes-import-jwk-key.js (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/aes-import-jwk-key.js                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/aes-import-jwk-key.js        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+importScripts('../../../../resources/js-test-pre.js');
+
+description(&quot;Test importing a JWK AES key using AES-CBC algorithm in workers.&quot;);
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;,
+    alg: &quot;A128CBC&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;],
+    ext: true,
+};
+var extractable = true;
+
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;}, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']&quot;);
+
+    finishJSTest();
+});
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleresourcesaesimportrawkeyjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/resources/aes-import-raw-key.js (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/aes-import-raw-key.js                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/aes-import-raw-key.js        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+importScripts('../../../../resources/js-test-pre.js');
+importScripts(&quot;../../../resources/common.js&quot;);
+
+description(&quot;Test importing a raw AES key using AES-CBC algorithm in workers.&quot;);
+jsTestIsAsync = true;
+
+var rawKey = asciiToUint8Array(&quot;jnOw99oOZFLIEPMr&quot;);
+var extractable = true;
+
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;jnOw97&quot;), &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])');
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;raw&quot;, rawKey, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']&quot;);
+
+    finishJSTest();
+});
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleresourceshmacimportjwkkeyjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/resources/hmac-import-jwk-key.js (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/hmac-import-jwk-key.js                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/hmac-import-jwk-key.js        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+importScripts('../../../../resources/js-test-pre.js');
+
+description(&quot;Test importing a JWK HMAC key with SHA-1 in workers.&quot;);
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;YWJjZGVmZ2gxMjM0NTY3OA&quot;,
+    alg: &quot;HS1&quot;,
+    use: &quot;sig&quot;,
+    key_ops: [&quot;sign&quot;, &quot;verify&quot;],
+    ext: true,
+};
+var extractable = true;
+
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;}, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&quot;);
+
+    finishJSTest();
+});
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleresourceshmacimportrawkeyjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/resources/hmac-import-raw-key.js (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/hmac-import-raw-key.js                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/hmac-import-raw-key.js        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+importScripts('../../../../resources/js-test-pre.js');
+importScripts(&quot;../../../resources/common.js&quot;);
+
+description(&quot;Test importing a raw HMAC key with SHA-1 in workers.&quot;);
+jsTestIsAsync = true;
+
+var rawKey = asciiToUint8Array(&quot;jnOw99oOZFLIEPMr&quot;);
+var extractable = true;
+
+shouldReject('crypto.subtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;&quot;), {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;raw&quot;, rawKey, {name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&quot;);
+
+    finishJSTest();
+});
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleresourceshmacpostMessageworkerjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/workers/subtle/resources/hmac-postMessage-worker.js (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/hmac-postMessage-worker.js        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/hmac-postMessage-worker.js        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -9,8 +9,8 @@
</span><span class="cx">         postMessage({ result:false, message:'key.extractable should be true' });
</span><span class="cx">     else if (key.algorithm.name != &quot;HMAC&quot;)
</span><span class="cx">         postMessage({ result:false, message:'key.algorithm.name should be &quot;HMAC&quot;' });
</span><del>-    else if (key.algorithm.length != 16)
-        postMessage({ result:false, message:'key.algorithm.length should be 16' });
</del><ins>+    else if (key.algorithm.length != 128)
+        postMessage({ result:false, message:'key.algorithm.length should be 128' });
</ins><span class="cx">     else if (key.algorithm.hash.name != &quot;SHA-1&quot;)
</span><span class="cx">         postMessage({ result:false, message:'key.algorithm.hash.name should be &quot;SHA-1&quot;' });
</span><span class="cx">     else if (key.usages.toString() != &quot;sign,verify&quot;)
</span></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleresourcesrsaimportjwkprivatekeyjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/resources/rsa-import-jwk-private-key.js (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/rsa-import-jwk-private-key.js                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/rsa-import-jwk-private-key.js        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+importScripts('../../../../resources/js-test-pre.js');
+importScripts(&quot;../../../resources/common.js&quot;);
+
+description(&quot;Test importing a JWK RSA-OAEP private key with SHA-1 in workers.&quot;);
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;decrypt&quot;, &quot;unwrapKey&quot;],
+    ext: true,
+    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;,
+};
+var extractable = true;
+
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;])');
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSA-OAEP&quot;, hash: &quot;SHA-1&quot;}, extractable, [&quot;decrypt&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    privateKey = result;
+
+    shouldBe(&quot;privateKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;privateKey.type&quot;, &quot;'private'&quot;);
+    shouldBe(&quot;privateKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;privateKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
+    shouldBe(&quot;privateKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(privateKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;privateKey.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;privateKey.usages&quot;, &quot;['decrypt', 'unwrapKey']&quot;);
+
+    finishJSTest();
+});
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleresourcesrsaimportjwkpublickeyjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/resources/rsa-import-jwk-public-key.js (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/rsa-import-jwk-public-key.js                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/rsa-import-jwk-public-key.js        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+importScripts('../../../../resources/js-test-pre.js');
+importScripts(&quot;../../../resources/common.js&quot;);
+
+description(&quot;Test importing a JWK RSA-OAEP public key with SHA-1 in workers.&quot;);
+jsTestIsAsync = true;
+
+var jwkKey = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP&quot;,
+    use: &quot;enc&quot;,
+    key_ops: [&quot;encrypt&quot;, &quot;wrapKey&quot;],
+    ext: true,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+var extractable = true;
+
+shouldReject('crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;decrypt&quot;, &quot;unwrapKey&quot;])');
+
+debug(&quot;Importing a key...&quot;);
+crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSA-OAEP&quot;, hash: &quot;SHA-1&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;]).then(function(result) {
+    publicKey = result;
+
+    shouldBe(&quot;publicKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;publicKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
+    shouldBe(&quot;publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;publicKey.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;publicKey.usages&quot;, &quot;['encrypt', 'wrapKey']&quot;);
+
+    finishJSTest();
+});
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtlersaimportjwkprivatekeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-private-key-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-private-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-private-key-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+[Worker] Test importing a JWK RSA-OAEP private key with SHA-1 in workers.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Starting worker: resources/rsa-import-jwk-private-key.js
+FAIL [Worker] crypto.subtle.importKey(&quot;jwk&quot;, {kty: &quot;RSA&quot;, n: n, e: e, d: d}, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;encrypt&quot;, &quot;wrapKey&quot;]) should not throw exception. Threw exception ReferenceError: Can't find variable: n.
+[Worker] Importing a key...
+PASS [Worker] privateKey.toString() is '[object CryptoKey]'
+PASS [Worker] privateKey.type is 'private'
+PASS [Worker] privateKey.extractable is true
+PASS [Worker] privateKey.algorithm.name is 'RSA-OAEP'
+PASS [Worker] privateKey.algorithm.modulusLength is 2048
+PASS [Worker] bytesToHexString(privateKey.algorithm.publicExponent) is '010001'
+PASS [Worker] privateKey.algorithm.hash.name is 'SHA-1'
+PASS [Worker] privateKey.usages is ['decrypt', 'unwrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtlersaimportjwkprivatekeyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-private-key.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-private-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-private-key.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,12 @@
</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;/head&gt;
+&lt;body&gt;
+    &lt;script&gt;
+        worker = startWorker('resources/rsa-import-jwk-private-key.js');
+    &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="trunkLayoutTestscryptoworkerssubtlersaimportjwkpublickeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-public-key-expected.txt (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-public-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-public-key-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+[Worker] Test importing a JWK RSA-OAEP public key with SHA-1 in workers.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Starting worker: resources/rsa-import-jwk-public-key.js
+[Worker] Importing a key...
+PASS [Worker] crypto.subtle.importKey(&quot;jwk&quot;, jwkKey, {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;}, extractable, [&quot;decrypt&quot;, &quot;unwrapKey&quot;]) rejected promise  with SyntaxError (DOM Exception 12): A required parameter was missing or out-of-range.
+PASS [Worker] publicKey.toString() is '[object CryptoKey]'
+PASS [Worker] publicKey.type is 'public'
+PASS [Worker] publicKey.extractable is true
+PASS [Worker] publicKey.algorithm.name is 'RSA-OAEP'
+PASS [Worker] publicKey.algorithm.modulusLength is 2048
+PASS [Worker] bytesToHexString(publicKey.algorithm.publicExponent) is '010001'
+PASS [Worker] publicKey.algorithm.hash.name is 'SHA-1'
+PASS [Worker] publicKey.usages is ['encrypt', 'wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtlersaimportjwkpublickeyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-public-key.html (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-public-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/rsa-import-jwk-public-key.html        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,12 @@
</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;/head&gt;
+&lt;body&gt;
+    &lt;script&gt;
+        worker = startWorker('resources/rsa-import-jwk-public-key.js');
+    &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="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-11-05  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        Update SubtleCrypto::importKey to match the latest spec
+        https://bugs.webkit.org/show_bug.cgi?id=164446
+        &lt;rdar://problem/29123621&gt;
+
+        Reviewed by Brent Fulgham.
+
+        * WebCryptoAPI/idlharness-expected.txt:
+
</ins><span class="cx"> 2016-11-10  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EME] Add no-op Web-facing APIs
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIidlharnessexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -59,8 +59,8 @@
</span><span class="cx"> FAIL SubtleCrypto interface: calling deriveKey(AlgorithmIdentifier,CryptoKey,AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property &quot;deriveKey&quot; not found in prototype chain
</span><span class="cx"> FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;deriveBits&quot; with the proper type (7) assert_inherits: property &quot;deriveBits&quot; not found in prototype chain
</span><span class="cx"> FAIL SubtleCrypto interface: calling deriveBits(AlgorithmIdentifier,CryptoKey,unsigned long) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property &quot;deriveBits&quot; not found in prototype chain
</span><del>-FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;importKey&quot; with the proper type (8) assert_inherits: property &quot;importKey&quot; not found in prototype chain
-FAIL SubtleCrypto interface: calling importKey(KeyFormat,[object Object],[object Object],AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property &quot;importKey&quot; not found in prototype chain
</del><ins>+PASS SubtleCrypto interface: crypto.subtle must inherit property &quot;importKey&quot; with the proper type (8) 
+PASS SubtleCrypto interface: calling importKey(KeyFormat,[object Object],[object Object],AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError 
</ins><span class="cx"> FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;exportKey&quot; with the proper type (9) assert_inherits: property &quot;exportKey&quot; not found in prototype chain
</span><span class="cx"> FAIL SubtleCrypto interface: calling exportKey(KeyFormat,CryptoKey) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property &quot;exportKey&quot; not found in prototype chain
</span><span class="cx"> FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;wrapKey&quot; with the proper type (10) assert_inherits: property &quot;wrapKey&quot; not found in prototype chain
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -327,11 +327,14 @@
</span><span class="cx">     crypto/CryptoAlgorithmParameters.idl
</span><span class="cx">     crypto/CryptoKey.idl
</span><span class="cx">     crypto/CryptoKeyPair.idl
</span><ins>+    crypto/JsonWebKey.idl
+    crypto/RsaOtherPrimesInfo.idl
</ins><span class="cx">     crypto/SubtleCrypto.idl
</span><span class="cx">     crypto/WebKitSubtleCrypto.idl
</span><span class="cx"> 
</span><span class="cx">     crypto/parameters/AesKeyGenParams.idl
</span><del>-    crypto/parameters/HmacKeyGenParams.idl
</del><ins>+    crypto/parameters/HmacKeyParams.idl
+    crypto/parameters/RsaHashedImportParams.idl
</ins><span class="cx">     crypto/parameters/RsaHashedKeyGenParams.idl
</span><span class="cx">     crypto/parameters/RsaKeyGenParams.idl
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/ChangeLog        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -1,3 +1,149 @@
</span><ins>+2016-11-04  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        Update SubtleCrypto::importKey to match the latest spec
+        https://bugs.webkit.org/show_bug.cgi?id=164446
+        &lt;rdar://problem/29123621&gt;
+
+        Reviewed by Brent Fulgham.
+
+        This patch does following few things:
+        1. It updates the SubtleCrypto::importKey method to match the latest spec:
+           https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey.
+           It also refers to the latest Editor's Draft at a certain degree:
+           https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-importKey.
+        2. It implements importKey operations of following algorithms: AES-CBC, AES-KW,
+           HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP.
+        3. It fixes some minor problems of SubtleCrypto::generateKey.
+        4. It addes move constructors for CryptoKeyAES, CryptoKeyHMAC, CryptoKeyRSA and
+           CryptoKeyDataRSAComponents.
+        5. It renames HmacKeyGenParams to HmacKeyParams to serve the purpose of both
+           HmacKeyGenParams and HmacImportParams which are essentially the same.
+        6. It enforces the key length in bits of CryptoKeyHMAC to be multiples of 8.
+        7. It also fixes the following bugs:
+           https://bugs.webkit.org/show_bug.cgi?id=126033,
+           https://bugs.webkit.org/show_bug.cgi?id=126034,
+           https://bugs.webkit.org/show_bug.cgi?id=151308.
+        P.S. We currently only support Raw and Jwk key format.
+
+        Tests: crypto/subtle/aes-cbc-import-jwk-key-length-128.html
+               crypto/subtle/aes-cbc-import-jwk-key-length-192.html
+               crypto/subtle/aes-cbc-import-jwk-key-length-256.html
+               crypto/subtle/aes-cbc-import-jwk-key-minimum.html
+               crypto/subtle/aes-cbc-import-jwk-key-non-extractable.html
+               crypto/subtle/aes-cbc-import-raw-key-length-128.html
+               crypto/subtle/aes-cbc-import-raw-key-length-192.html
+               crypto/subtle/aes-cbc-import-raw-key-length-256.html
+               crypto/subtle/aes-import-key-malformed-parameters.html
+               crypto/subtle/aes-kw-import-jwk-key-length-128.html
+               crypto/subtle/aes-kw-import-jwk-key-length-192.html
+               crypto/subtle/aes-kw-import-jwk-key-length-256.html
+               crypto/subtle/aes-kw-import-raw-key.html
+               crypto/subtle/generate-key-malformed-parameters.html
+               crypto/subtle/hmac-import-jwk-key-minimum.html
+               crypto/subtle/hmac-import-jwk-key-non-extractable.html
+               crypto/subtle/hmac-import-jwk-key-sha1.html
+               crypto/subtle/hmac-import-jwk-key-sha224.html
+               crypto/subtle/hmac-import-jwk-key-sha256.html
+               crypto/subtle/hmac-import-jwk-key-sha384.html
+               crypto/subtle/hmac-import-jwk-key-sha512.html
+               crypto/subtle/hmac-import-malformed-parameters.html
+               crypto/subtle/hmac-import-raw-key-customized-length.html
+               crypto/subtle/hmac-import-raw-key.html
+               crypto/subtle/import-key-malformed-parameters.html
+               crypto/subtle/rsa-import-key-malformed-parameters.html
+               crypto/subtle/rsa-oaep-import-jwk-private-key.html
+               crypto/subtle/rsa-oaep-import-jwk-public-key-sha1.html
+               crypto/subtle/rsa-oaep-import-jwk-public-key-sha224.html
+               crypto/subtle/rsa-oaep-import-jwk-public-key-sha256.html
+               crypto/subtle/rsa-oaep-import-jwk-public-key-sha384.html
+               crypto/subtle/rsa-oaep-import-jwk-public-key-sha512.html
+               crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-private-key.html
+               crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-leading-zero.html
+               crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-minimum.html
+               crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-non-extractable.html
+               crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key.html
+               crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-private-key.html
+               crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha1.html
+               crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha224.html
+               crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha256.html
+               crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha384.html
+               crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-sha512.html
+               crypto/workers/subtle/aes-import-jwk-key.html
+               crypto/workers/subtle/aes-import-raw-key.html
+               crypto/workers/subtle/hmac-import-jwk-key.html
+               crypto/workers/subtle/hmac-import-raw-key.html
+               crypto/workers/subtle/rsa-import-jwk-private-key.html
+               crypto/workers/subtle/rsa-import-jwk-public-key.html
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * PlatformEfl.cmake:
+        * PlatformGTK.cmake:
+        * PlatformMac.cmake:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSSubtleCryptoCustom.cpp:
+        (WebCore::normalizeCryptoAlgorithmParameters):
+        (WebCore::cryptoKeyUsageFromString):
+        (WebCore::cryptoKeyUsagesFromJSValue):
+        (WebCore::toKeyData):
+        (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
+        (WebCore::jsSubtleCryptoFunctionImportKeyPromise):
+        (WebCore::JSSubtleCrypto::importKey):
+        * crypto/CryptoAlgorithm.cpp:
+        (WebCore::CryptoAlgorithm::importKey):
+        * crypto/CryptoAlgorithm.h:
+        * crypto/CryptoAlgorithmParameters.h:
+        * crypto/JsonWebKey.h: Added.
+        * crypto/JsonWebKey.idl: Added.
+        * crypto/RsaOtherPrimesInfo.h: Added.
+        * crypto/RsaOtherPrimesInfo.idl: Added.
+        * crypto/SubtleCrypto.h:
+        * crypto/SubtleCrypto.idl:
+        * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
+        (WebCore::CryptoAlgorithmAES_CBC::generateKey):
+        (WebCore::CryptoAlgorithmAES_CBC::importKey):
+        * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
+        * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
+        (WebCore::CryptoAlgorithmAES_KW::generateKey):
+        (WebCore::CryptoAlgorithmAES_KW::importKey):
+        * crypto/algorithms/CryptoAlgorithmAES_KW.h:
+        * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
+        (WebCore::CryptoAlgorithmHMAC::generateKey):
+        (WebCore::CryptoAlgorithmHMAC::importKey):
+        * crypto/algorithms/CryptoAlgorithmHMAC.h:
+        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
+        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
+        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
+        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
+        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
+        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
+        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
+        (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
+        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
+        * crypto/keys/CryptoKeyAES.cpp:
+        (WebCore::CryptoKeyAES::CryptoKeyAES):
+        (WebCore::CryptoKeyAES::generate):
+        (WebCore::CryptoKeyAES::importRaw):
+        (WebCore::CryptoKeyAES::importJwk):
+        * crypto/keys/CryptoKeyAES.h:
+        * crypto/keys/CryptoKeyDataRSAComponents.cpp:
+        (WebCore::CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents):
+        * crypto/keys/CryptoKeyDataRSAComponents.h:
+        * crypto/keys/CryptoKeyHMAC.cpp:
+        (WebCore::CryptoKeyHMAC::CryptoKeyHMAC):
+        (WebCore::CryptoKeyHMAC::generate):
+        (WebCore::CryptoKeyHMAC::importRaw):
+        (WebCore::CryptoKeyHMAC::importJwk):
+        (WebCore::CryptoKeyHMAC::buildAlgorithm):
+        * crypto/keys/CryptoKeyHMAC.h:
+        * crypto/keys/CryptoKeyRSA.cpp: Added.
+        (WebCore::CryptoKeyRSA::importJwk):
+        * crypto/keys/CryptoKeyRSA.h:
+        * crypto/parameters/CryptoAlgorithmHmacKeyParams.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h.
+        * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h: Added.
+        * crypto/parameters/HmacKeyParams.idl: Renamed from Source/WebCore/crypto/parameters/HmacKeyGenParams.idl.
+        * crypto/parameters/RsaHashedImportParams.idl: Added.
+
</ins><span class="cx"> 2016-11-10  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         IndexedDB 2.0: REGRESSION(r208467) Fix flaky crashes in IDB GC-related code.
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/DerivedSources.make        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -252,10 +252,13 @@
</span><span class="cx">     $(WebCore)/crypto/CryptoAlgorithmParameters.idl \
</span><span class="cx">     $(WebCore)/crypto/CryptoKey.idl \
</span><span class="cx">     $(WebCore)/crypto/CryptoKeyPair.idl \
</span><ins>+    $(WebCore)/crypto/JsonWebKey.idl \
</ins><span class="cx">     $(WebCore)/crypto/parameters/AesKeyGenParams.idl \
</span><del>-    $(WebCore)/crypto/parameters/HmacKeyGenParams.idl \
</del><ins>+    $(WebCore)/crypto/parameters/HmacKeyParams.idl \
+    $(WebCore)/crypto/parameters/RsaHashedImportParams.idl \
</ins><span class="cx">     $(WebCore)/crypto/parameters/RsaHashedKeyGenParams.idl \
</span><span class="cx">     $(WebCore)/crypto/parameters/RsaKeyGenParams.idl \
</span><ins>+    $(WebCore)/crypto/RsaOtherPrimesInfo.idl \
</ins><span class="cx">     $(WebCore)/crypto/SubtleCrypto.idl \
</span><span class="cx">     $(WebCore)/crypto/WebKitSubtleCrypto.idl \
</span><span class="cx">     $(WebCore)/css/CSSFontFaceLoadEvent.idl \
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformEfl.cmake (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformEfl.cmake        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/PlatformEfl.cmake        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -438,6 +438,7 @@
</span><span class="cx">         crypto/keys/CryptoKeyDataOctetSequence.cpp
</span><span class="cx">         crypto/keys/CryptoKeyDataRSAComponents.cpp
</span><span class="cx">         crypto/keys/CryptoKeyHMAC.cpp
</span><ins>+        crypto/keys/CryptoKeyRSA.cpp
</ins><span class="cx">         crypto/keys/CryptoKeySerializationRaw.cpp
</span><span class="cx">     )
</span><span class="cx"> endif ()
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/PlatformGTK.cmake        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -435,6 +435,7 @@
</span><span class="cx">         crypto/keys/CryptoKeyDataOctetSequence.cpp
</span><span class="cx">         crypto/keys/CryptoKeyDataRSAComponents.cpp
</span><span class="cx">         crypto/keys/CryptoKeyHMAC.cpp
</span><ins>+        crypto/keys/CryptoKeyRSA.cpp
</ins><span class="cx">         crypto/keys/CryptoKeySerializationRaw.cpp
</span><span class="cx">     )
</span><span class="cx"> endif ()
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformMac.cmake (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformMac.cmake        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/PlatformMac.cmake        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -200,6 +200,7 @@
</span><span class="cx">     crypto/keys/CryptoKeyDataOctetSequence.cpp
</span><span class="cx">     crypto/keys/CryptoKeyDataRSAComponents.cpp
</span><span class="cx">     crypto/keys/CryptoKeyHMAC.cpp
</span><ins>+    crypto/keys/CryptoKeyRSA.cpp
</ins><span class="cx">     crypto/keys/CryptoKeySerializationRaw.cpp
</span><span class="cx"> 
</span><span class="cx">     crypto/mac/CryptoAlgorithmAES_CBCMac.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -2374,15 +2374,25 @@
</span><span class="cx">                 577483121DADC55D00716EF9 /* CryptoAlgorithmAesKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 577483111DADC55D00716EF9 /* CryptoAlgorithmAesKeyGenParams.h */; };
</span><span class="cx">                 577483141DAEC2EB00716EF9 /* JSAesKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 577483131DAEC2EA00716EF9 /* JSAesKeyGenParams.h */; };
</span><span class="cx">                 577483161DAEC32300716EF9 /* JSAesKeyGenParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 577483151DAEC32200716EF9 /* JSAesKeyGenParams.cpp */; };
</span><del>-                577483191DB4491F00716EF9 /* CryptoAlgorithmHmacKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 577483181DB4491F00716EF9 /* CryptoAlgorithmHmacKeyGenParams.h */; };
-                5774831B1DB459BA00716EF9 /* JSHmacKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5774831A1DB459BA00716EF9 /* JSHmacKeyGenParams.h */; };
-                5774831D1DB459DE00716EF9 /* JSHmacKeyGenParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5774831C1DB459DE00716EF9 /* JSHmacKeyGenParams.cpp */; };
</del><ins>+                577483191DB4491F00716EF9 /* CryptoAlgorithmHmacKeyParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 577483181DB4491F00716EF9 /* CryptoAlgorithmHmacKeyParams.h */; };
</ins><span class="cx">                 5778BD821DA4806C009E3009 /* SubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 5778BD811DA4802C009E3009 /* SubtleCrypto.h */; };
</span><span class="cx">                 5778BD841DA4817B009E3009 /* SubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */; };
</span><ins>+                579F6E051DCD7EE400546D80 /* CryptoAlgorithmRsaHashedKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E233741DCD6D3B00F28D01 /* CryptoAlgorithmRsaHashedKeyGenParams.h */; };
</ins><span class="cx">                 57A9C88E1DA70BF800BC7305 /* JSSubtleCryptoCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57A9C88D1DA70BF800BC7305 /* JSSubtleCryptoCustom.cpp */; };
</span><ins>+                57E2335B1DC7D5E500F28D01 /* JSJsonWebKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E2335A1DC7D5E500F28D01 /* JSJsonWebKey.h */; };
+                57E2335D1DC7D60800F28D01 /* JSRsaOtherPrimesInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E2335C1DC7D60800F28D01 /* JSRsaOtherPrimesInfo.h */; };
+                57E2335F1DC7D67B00F28D01 /* JSJsonWebKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57E2335E1DC7D67B00F28D01 /* JSJsonWebKey.cpp */; };
+                57E233611DC7D6AA00F28D01 /* JSRsaOtherPrimesInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57E233601DC7D6AA00F28D01 /* JSRsaOtherPrimesInfo.cpp */; };
+                57E233631DC7DA2400F28D01 /* RsaOtherPrimesInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E233621DC7DA2400F28D01 /* RsaOtherPrimesInfo.h */; };
+                57E233651DC7DB1F00F28D01 /* JsonWebKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E233641DC7DB1F00F28D01 /* JsonWebKey.h */; };
+                57E233671DCAB21C00F28D01 /* JSHmacKeyParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E233661DCAB21C00F28D01 /* JSHmacKeyParams.h */; };
+                57E233691DCAB24300F28D01 /* JSHmacKeyParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57E233681DCAB24300F28D01 /* JSHmacKeyParams.cpp */; };
+                57E2336B1DCC262400F28D01 /* CryptoKeyRSA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57E2336A1DCC262400F28D01 /* CryptoKeyRSA.cpp */; };
+                57E2336E1DCD43FD00F28D01 /* CryptoAlgorithmRsaHashedImportParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E2336D1DCD43FD00F28D01 /* CryptoAlgorithmRsaHashedImportParams.h */; };
+                57E233711DCD468F00F28D01 /* JSRsaHashedImportParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 57E233701DCD468F00F28D01 /* JSRsaHashedImportParams.h */; };
+                57E233731DCD46B600F28D01 /* JSRsaHashedImportParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57E233721DCD46B600F28D01 /* JSRsaHashedImportParams.cpp */; };
</ins><span class="cx">                 57EF5E601D20C83900171E60 /* TextCodecReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 57EF5E5F1D20C83900171E60 /* TextCodecReplacement.h */; };
</span><span class="cx">                 57EF5E621D20D28700171E60 /* TextCodecReplacement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57EF5E611D20D28700171E60 /* TextCodecReplacement.cpp */; };
</span><del>-                57F8273B1DB72D64009D2BF4 /* CryptoAlgorithmRsaHashedKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 57F8273A1DB72D64009D2BF4 /* CryptoAlgorithmRsaHashedKeyGenParams.h */; };
</del><span class="cx">                 57FEDD3F1DB6D59200EB96F5 /* CryptoAlgorithmRsaKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 57FEDD3E1DB6D59200EB96F5 /* CryptoAlgorithmRsaKeyGenParams.h */; };
</span><span class="cx">                 57FEDD411DB6D73A00EB96F5 /* JSRsaKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 57FEDD401DB6D73A00EB96F5 /* JSRsaKeyGenParams.h */; };
</span><span class="cx">                 57FEDD431DB6D76000EB96F5 /* JSRsaKeyGenParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57FEDD421DB6D76000EB96F5 /* JSRsaKeyGenParams.cpp */; };
</span><span class="lines">@@ -9587,18 +9597,31 @@
</span><span class="cx">                 577483111DADC55D00716EF9 /* CryptoAlgorithmAesKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmAesKeyGenParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 577483131DAEC2EA00716EF9 /* JSAesKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAesKeyGenParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 577483151DAEC32200716EF9 /* JSAesKeyGenParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAesKeyGenParams.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                577483171DB1FE8900716EF9 /* HmacKeyGenParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HmacKeyGenParams.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
-                577483181DB4491F00716EF9 /* CryptoAlgorithmHmacKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmHmacKeyGenParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                5774831A1DB459BA00716EF9 /* JSHmacKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHmacKeyGenParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                5774831C1DB459DE00716EF9 /* JSHmacKeyGenParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHmacKeyGenParams.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                577483171DB1FE8900716EF9 /* HmacKeyParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HmacKeyParams.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                577483181DB4491F00716EF9 /* CryptoAlgorithmHmacKeyParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmHmacKeyParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 5778BD801DA4733E009E3009 /* SubtleCrypto.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SubtleCrypto.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5778BD811DA4802C009E3009 /* SubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubtleCrypto.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubtleCrypto.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 57A9C88D1DA70BF800BC7305 /* JSSubtleCryptoCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSubtleCryptoCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                57E233571DC7D24800F28D01 /* JsonWebKey.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = JsonWebKey.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E233591DC7D37200F28D01 /* RsaOtherPrimesInfo.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RsaOtherPrimesInfo.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E2335A1DC7D5E500F28D01 /* JSJsonWebKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSJsonWebKey.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E2335C1DC7D60800F28D01 /* JSRsaOtherPrimesInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRsaOtherPrimesInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E2335E1DC7D67B00F28D01 /* JSJsonWebKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSJsonWebKey.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E233601DC7D6AA00F28D01 /* JSRsaOtherPrimesInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRsaOtherPrimesInfo.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E233621DC7DA2400F28D01 /* RsaOtherPrimesInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RsaOtherPrimesInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E233641DC7DB1F00F28D01 /* JsonWebKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JsonWebKey.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E233661DCAB21C00F28D01 /* JSHmacKeyParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHmacKeyParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E233681DCAB24300F28D01 /* JSHmacKeyParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHmacKeyParams.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E2336A1DCC262400F28D01 /* CryptoKeyRSA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyRSA.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E2336C1DCD437000F28D01 /* RsaHashedImportParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RsaHashedImportParams.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E2336D1DCD43FD00F28D01 /* CryptoAlgorithmRsaHashedImportParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaHashedImportParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E233701DCD468F00F28D01 /* JSRsaHashedImportParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRsaHashedImportParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E233721DCD46B600F28D01 /* JSRsaHashedImportParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRsaHashedImportParams.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                57E233741DCD6D3B00F28D01 /* CryptoAlgorithmRsaHashedKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaHashedKeyGenParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 57EF5E5F1D20C83900171E60 /* TextCodecReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCodecReplacement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 57EF5E611D20D28700171E60 /* TextCodecReplacement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextCodecReplacement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 57F827391DB72C22009D2BF4 /* RsaHashedKeyGenParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RsaHashedKeyGenParams.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                57F8273A1DB72D64009D2BF4 /* CryptoAlgorithmRsaHashedKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaHashedKeyGenParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 57FEDD3D1DB6D47F00EB96F5 /* RsaKeyGenParams.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RsaKeyGenParams.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 57FEDD3E1DB6D59200EB96F5 /* CryptoAlgorithmRsaKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaKeyGenParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 57FEDD401DB6D73A00EB96F5 /* JSRsaKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRsaKeyGenParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16510,9 +16533,9 @@
</span><span class="cx">                                 9908B0ED1BCACF9100ED0F65 /* ByteLengthQueuingStrategy.js */,
</span><span class="cx">                                 148B4FFF1B6904C500C954E4 /* CountQueuingStrategy.idl */,
</span><span class="cx">                                 9908B0EE1BCACF9100ED0F65 /* CountQueuingStrategy.js */,
</span><del>-                                9908B0F11BCACF9100ED3F64 /* ReadableByteStreamInternals.js */,
</del><span class="cx">                                 41189EF71AD8232800B93F64 /* ReadableByteStreamController.idl */,
</span><span class="cx">                                 9908B0F01BCACF9100ED3F64 /* ReadableByteStreamController.js */,
</span><ins>+                                9908B0F11BCACF9100ED3F64 /* ReadableByteStreamInternals.js */,
</ins><span class="cx">                                 41A023ED1A39DB7900F722CF /* ReadableStream.idl */,
</span><span class="cx">                                 9908B0EF1BCACF9100ED0F65 /* ReadableStream.js */,
</span><span class="cx">                                 41189EF71AD8232800B90A0D /* ReadableStreamDefaultController.idl */,
</span><span class="lines">@@ -17803,8 +17826,8 @@
</span><span class="cx">                                 BC94D1500C275C8B006BC617 /* History.cpp */,
</span><span class="cx">                                 BC94D1510C275C8B006BC617 /* History.h */,
</span><span class="cx">                                 BC94D1520C275C8B006BC617 /* History.idl */,
</span><ins>+                                0F4710D51DB6FE22002DCEC3 /* IntersectionObserver.cpp */,
</ins><span class="cx">                                 0F4710D61DB6FE22002DCEC3 /* IntersectionObserver.h */,
</span><del>-                                0F4710D51DB6FE22002DCEC3 /* IntersectionObserver.cpp */,
</del><span class="cx">                                 0F4710D71DB6FE22002DCEC3 /* IntersectionObserver.idl */,
</span><span class="cx">                                 0F8B45711DC3FBA300443C3F /* IntersectionObserverCallback.h */,
</span><span class="cx">                                 0F8B456F1DC3FB1000443C3F /* IntersectionObserverCallback.idl */,
</span><span class="lines">@@ -18033,11 +18056,11 @@
</span><span class="cx">                 71D6AA391DA4EAF700B23969 /* modern-media-controls */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                714131481DC9D6EF00336107 /* js-files */,
-                                71D02D901DB55C4E00DD5CF5 /* main.js */,
</del><span class="cx">                                 716FA0D71DB26591007323CC /* controls */,
</span><span class="cx">                                 71D6AA6F1DA4EAF700B23969 /* images */,
</span><ins>+                                714131481DC9D6EF00336107 /* js-files */,
</ins><span class="cx">                                 71D02D911DB55C4E00DD5CF5 /* media */,
</span><ins>+                                71D02D901DB55C4E00DD5CF5 /* main.js */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = &quot;modern-media-controls&quot;;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -22867,6 +22890,7 @@
</span><span class="cx">                                 E1C266DD18319F31003F8B33 /* CryptoKeyDataRSAComponents.h */,
</span><span class="cx">                                 E125F8331822F18A00D84CD9 /* CryptoKeyHMAC.cpp */,
</span><span class="cx">                                 E125F8341822F18A00D84CD9 /* CryptoKeyHMAC.h */,
</span><ins>+                                57E2336A1DCC262400F28D01 /* CryptoKeyRSA.cpp */,
</ins><span class="cx">                                 E164FAA218315BF400DB4E61 /* CryptoKeyRSA.h */,
</span><span class="cx">                                 E125F857182C1AA600D84CD9 /* CryptoKeySerializationRaw.cpp */,
</span><span class="cx">                                 E125F858182C1AA600D84CD9 /* CryptoKeySerializationRaw.h */,
</span><span class="lines">@@ -22881,16 +22905,18 @@
</span><span class="cx">                                 E125F8391824104800D84CD9 /* CryptoAlgorithmAesCbcParamsDeprecated.h */,
</span><span class="cx">                                 577483111DADC55D00716EF9 /* CryptoAlgorithmAesKeyGenParams.h */,
</span><span class="cx">                                 E19AC3F61824E5D100349426 /* CryptoAlgorithmAesKeyGenParamsDeprecated.h */,
</span><del>-                                577483181DB4491F00716EF9 /* CryptoAlgorithmHmacKeyGenParams.h */,
</del><ins>+                                577483181DB4491F00716EF9 /* CryptoAlgorithmHmacKeyParams.h */,
</ins><span class="cx">                                 E19DA29B18189ADD00088BC8 /* CryptoAlgorithmHmacKeyParamsDeprecated.h */,
</span><span class="cx">                                 E1C6571E1816E50300256CDD /* CryptoAlgorithmHmacParamsDeprecated.h */,
</span><del>-                                57F8273A1DB72D64009D2BF4 /* CryptoAlgorithmRsaHashedKeyGenParams.h */,
</del><ins>+                                57E2336D1DCD43FD00F28D01 /* CryptoAlgorithmRsaHashedImportParams.h */,
+                                57E233741DCD6D3B00F28D01 /* CryptoAlgorithmRsaHashedKeyGenParams.h */,
</ins><span class="cx">                                 57FEDD3E1DB6D59200EB96F5 /* CryptoAlgorithmRsaKeyGenParams.h */,
</span><span class="cx">                                 E1BD331D182D8F4200C05D9F /* CryptoAlgorithmRsaKeyGenParamsDeprecated.h */,
</span><span class="cx">                                 E1C266DA18319935003F8B33 /* CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h */,
</span><span class="cx">                                 E1FE1376184D1E3300892F13 /* CryptoAlgorithmRsaOaepParamsDeprecated.h */,
</span><span class="cx">                                 E1BD331B182D8EE900C05D9F /* CryptoAlgorithmRsaSsaParamsDeprecated.h */,
</span><del>-                                577483171DB1FE8900716EF9 /* HmacKeyGenParams.idl */,
</del><ins>+                                577483171DB1FE8900716EF9 /* HmacKeyParams.idl */,
+                                57E2336C1DCD437000F28D01 /* RsaHashedImportParams.idl */,
</ins><span class="cx">                                 57F827391DB72C22009D2BF4 /* RsaHashedKeyGenParams.idl */,
</span><span class="cx">                                 57FEDD3D1DB6D47F00EB96F5 /* RsaKeyGenParams.idl */,
</span><span class="cx">                         );
</span><span class="lines">@@ -23028,6 +23054,10 @@
</span><span class="cx">                                 E125F855182C0F8300D84CD9 /* CryptoKeySerialization.h */,
</span><span class="cx">                                 E19727151820549E00592D51 /* CryptoKeyType.h */,
</span><span class="cx">                                 E172AF6F180F289500FBADB9 /* CryptoKeyUsage.h */,
</span><ins>+                                57E233641DC7DB1F00F28D01 /* JsonWebKey.h */,
+                                57E233571DC7D24800F28D01 /* JsonWebKey.idl */,
+                                57E233621DC7DA2400F28D01 /* RsaOtherPrimesInfo.h */,
+                                57E233591DC7D37200F28D01 /* RsaOtherPrimesInfo.idl */,
</ins><span class="cx">                                 E18DF33418AAF12C00773E59 /* SerializedCryptoKeyWrap.h */,
</span><span class="cx">                                 5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */,
</span><span class="cx">                                 5778BD811DA4802C009E3009 /* SubtleCrypto.h */,
</span><span class="lines">@@ -23050,12 +23080,18 @@
</span><span class="cx">                                 E157A8DF1817331C009F821D /* JSCryptoKey.h */,
</span><span class="cx">                                 E1F80B8B183172B5007885C3 /* JSCryptoKeyPair.cpp */,
</span><span class="cx">                                 E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */,
</span><del>-                                5774831C1DB459DE00716EF9 /* JSHmacKeyGenParams.cpp */,
-                                5774831A1DB459BA00716EF9 /* JSHmacKeyGenParams.h */,
</del><ins>+                                57E233681DCAB24300F28D01 /* JSHmacKeyParams.cpp */,
+                                57E233661DCAB21C00F28D01 /* JSHmacKeyParams.h */,
+                                57E2335E1DC7D67B00F28D01 /* JSJsonWebKey.cpp */,
+                                57E2335A1DC7D5E500F28D01 /* JSJsonWebKey.h */,
+                                57E233721DCD46B600F28D01 /* JSRsaHashedImportParams.cpp */,
+                                57E233701DCD468F00F28D01 /* JSRsaHashedImportParams.h */,
</ins><span class="cx">                                 5768E4351DB7527300D0A4F7 /* JSRsaHashedKeyGenParams.cpp */,
</span><span class="cx">                                 5768E4331DB7524500D0A4F7 /* JSRsaHashedKeyGenParams.h */,
</span><span class="cx">                                 57FEDD421DB6D76000EB96F5 /* JSRsaKeyGenParams.cpp */,
</span><span class="cx">                                 57FEDD401DB6D73A00EB96F5 /* JSRsaKeyGenParams.h */,
</span><ins>+                                57E233601DC7D6AA00F28D01 /* JSRsaOtherPrimesInfo.cpp */,
+                                57E2335C1DC7D60800F28D01 /* JSRsaOtherPrimesInfo.h */,
</ins><span class="cx">                                 571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */,
</span><span class="cx">                                 571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */,
</span><span class="cx">                                 E1FF8F62180745D800132674 /* JSWebKitSubtleCrypto.cpp */,
</span><span class="lines">@@ -24644,6 +24680,8 @@
</span><span class="cx">                                 B5D31DFB11CF610B009F22B4 /* ActiveDOMCallback.h in Headers */,
</span><span class="cx">                                 7CD0BA051B8F79C9005CEBBE /* ActiveDOMCallbackMicrotask.h in Headers */,
</span><span class="cx">                                 E1C4DE690EA75C1E0023CCD6 /* ActiveDOMObject.h in Headers */,
</span><ins>+                                724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */,
+                                724EE5511DC80D8400A91FFB /* ActivityStateChangeObserver.h in Headers */,
</ins><span class="cx">                                 BCF7E491137CD7C7001DDAE7 /* AdjustViewSizeOrNot.h in Headers */,
</span><span class="cx">                                 84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */,
</span><span class="cx">                                 83BB5C881D5D6F45005A71F4 /* AllDescendantsCollection.h in Headers */,
</span><span class="lines">@@ -24976,7 +25014,7 @@
</span><span class="cx">                                 577483121DADC55D00716EF9 /* CryptoAlgorithmAesKeyGenParams.h in Headers */,
</span><span class="cx">                                 E19AC3F71824E5D100349426 /* CryptoAlgorithmAesKeyGenParamsDeprecated.h in Headers */,
</span><span class="cx">                                 E125F8321822F11B00D84CD9 /* CryptoAlgorithmHMAC.h in Headers */,
</span><del>-                                577483191DB4491F00716EF9 /* CryptoAlgorithmHmacKeyGenParams.h in Headers */,
</del><ins>+                                577483191DB4491F00716EF9 /* CryptoAlgorithmHmacKeyParams.h in Headers */,
</ins><span class="cx">                                 E19DA29C18189ADD00088BC8 /* CryptoAlgorithmHmacKeyParamsDeprecated.h in Headers */,
</span><span class="cx">                                 E1C6571F1816E50300256CDD /* CryptoAlgorithmHmacParamsDeprecated.h in Headers */,
</span><span class="cx">                                 E1C657251816E69D00256CDD /* CryptoAlgorithmIdentifier.h in Headers */,
</span><span class="lines">@@ -24985,6 +25023,7 @@
</span><span class="cx">                                 E1FF8F6D180DB5BE00132674 /* CryptoAlgorithmRegistry.h in Headers */,
</span><span class="cx">                                 E1FE136B183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.h in Headers */,
</span><span class="cx">                                 E1233F0D185A3E3B008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5.h in Headers */,
</span><ins>+                                57E2336E1DCD43FD00F28D01 /* CryptoAlgorithmRsaHashedImportParams.h in Headers */,
</ins><span class="cx">                                 57F8273B1DB72D64009D2BF4 /* CryptoAlgorithmRsaHashedKeyGenParams.h in Headers */,
</span><span class="cx">                                 57FEDD3F1DB6D59200EB96F5 /* CryptoAlgorithmRsaKeyGenParams.h in Headers */,
</span><span class="cx">                                 E1BD331E182D8F4200C05D9F /* CryptoAlgorithmRsaKeyGenParamsDeprecated.h in Headers */,
</span><span class="lines">@@ -25017,7 +25056,6 @@
</span><span class="cx">                                 E16A84FA14C85CCC002977DF /* CSSBorderImage.h in Headers */,
</span><span class="cx">                                 BC274B2F140EBEB200EADFA6 /* CSSBorderImageSliceValue.h in Headers */,
</span><span class="cx">                                 49AE2D8F134EE50C0072920A /* CSSCalculationValue.h in Headers */,
</span><del>-                                519DBC6F1DC011A700329BF5 /* IDBGetAllRecordsData.h in Headers */,
</del><span class="cx">                                 BC6049CC0DB560C200204739 /* CSSCanvasValue.h in Headers */,
</span><span class="cx">                                 BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */,
</span><span class="cx">                                 9DAC7C551AF2CAA200437C44 /* CSSContentDistributionValue.h in Headers */,
</span><span class="lines">@@ -25239,6 +25277,10 @@
</span><span class="cx">                                 2ED609BD1145B07100C8684E /* DOMFormData.h in Headers */,
</span><span class="cx">                                 A8185F3B09765766005826D9 /* DOMImplementation.h in Headers */,
</span><span class="cx">                                 E3150EA71DA7219300194012 /* DOMJITHelpers.h in Headers */,
</span><ins>+                                E3C99A091DC3D41C00794AD3 /* DOMJITCheckDOM.h in Headers */,
+                                E3A776671DC85D2800B690D8 /* DOMJITIDLConvert.h in Headers */,
+                                E3A776681DC85D2800B690D8 /* DOMJITIDLType.h in Headers */,
+                                E35802B61DC8435D00A9773C /* DOMJITIDLTypeFilter.h in Headers */,
</ins><span class="cx">                                 A9C6E4E40D745E05006442E9 /* DOMMimeType.h in Headers */,
</span><span class="cx">                                 A9C6E4E80D745E18006442E9 /* DOMMimeTypeArray.h in Headers */,
</span><span class="cx">                                 52B6C9C315E3F4DF00690B05 /* DOMNamedFlowCollection.h in Headers */,
</span><span class="lines">@@ -25672,6 +25714,8 @@
</span><span class="cx">                                 5148453F1BB9D07E006A72ED /* IDBError.h in Headers */,
</span><span class="cx">                                 5185FC8B1BB4C4E80012898F /* IDBEventDispatcher.h in Headers */,
</span><span class="cx">                                 5185FC8D1BB4C4E80012898F /* IDBFactory.h in Headers */,
</span><ins>+                                519DBC6F1DC011A700329BF5 /* IDBGetAllRecordsData.h in Headers */,
+                                519DBC721DC10F5200329BF5 /* IDBGetAllResult.h in Headers */,
</ins><span class="cx">                                 5105F0691D4BA9D900FB80BC /* IDBGetRecordData.h in Headers */,
</span><span class="cx">                                 5185FC8F1BB4C4E80012898F /* IDBGetResult.h in Headers */,
</span><span class="cx">                                 5185FC911BB4C4E80012898F /* IDBIndex.h in Headers */,
</span><span class="lines">@@ -25792,6 +25836,7 @@
</span><span class="cx">                                 A54A0C5E1DB6D9C40017A90B /* InspectorWorkerAgent.h in Headers */,
</span><span class="cx">                                 F3ABFE0C130E9DA000E7F7D1 /* InstrumentingAgents.h in Headers */,
</span><span class="cx">                                 0F4710DC1DB6FE22002DCEC3 /* IntersectionObserver.h in Headers */,
</span><ins>+                                0F8B45721DC3FBA300443C3F /* IntersectionObserverCallback.h in Headers */,
</ins><span class="cx">                                 0F4710DF1DB6FE22002DCEC3 /* IntersectionObserverEntry.h in Headers */,
</span><span class="cx">                                 B27535720B053814002CE64F /* IntPoint.h in Headers */,
</span><span class="cx">                                 E462A4A1113E71BE004A4220 /* IntPointHash.h in Headers */,
</span><span class="lines">@@ -25940,7 +25985,7 @@
</span><span class="cx">                                 460CBF361D4BCD0E0092E88E /* JSDOMWindowProperties.h in Headers */,
</span><span class="cx">                                 BCBFB53D0DCD29CF0019B3E5 /* JSDOMWindowShell.h in Headers */,
</span><span class="cx">                                 65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */,
</span><del>-                                E3A776671DC85D2800B690D8 /* DOMJITIDLConvert.h in Headers */,
</del><ins>+                                E318039D1DC40099009932C2 /* JSDynamicDowncast.h in Headers */,
</ins><span class="cx">                                 FD7868BA136B999200D403DF /* JSDynamicsCompressorNode.h in Headers */,
</span><span class="cx">                                 65DF31FA09D1CC60000BE325 /* JSElement.h in Headers */,
</span><span class="cx">                                 ADEC78F818EE5308001315C2 /* JSElementCustom.h in Headers */,
</span><span class="lines">@@ -25970,7 +26015,6 @@
</span><span class="cx">                                 B6D9D27B14EAC0860090D75E /* JSFocusEvent.h in Headers */,
</span><span class="cx">                                 C280833F1C6DC26F001451B6 /* JSFontFace.h in Headers */,
</span><span class="cx">                                 1C24EEA91C72A7B40080F8FC /* JSFontFaceSet.h in Headers */,
</span><del>-                                0F8B45721DC3FBA300443C3F /* IntersectionObserverCallback.h in Headers */,
</del><span class="cx">                                 FDA15EAC12B03EE1003A583A /* JSGainNode.h in Headers */,
</span><span class="cx">                                 518F5002194CAC3A0081BAAE /* JSGamepad.h in Headers */,
</span><span class="cx">                                 518F5004194CAC3A0081BAAE /* JSGamepadButton.h in Headers */,
</span><span class="lines">@@ -25979,7 +26023,7 @@
</span><span class="cx">                                 0FDA7C1F188322FC00C954B5 /* JSGestureEvent.h in Headers */,
</span><span class="cx">                                 8482B7521198CB6B00BFB005 /* JSHashChangeEvent.h in Headers */,
</span><span class="cx">                                 BC94D14F0C275C68006BC617 /* JSHistory.h in Headers */,
</span><del>-                                5774831B1DB459BA00716EF9 /* JSHmacKeyGenParams.h in Headers */,
</del><ins>+                                57E233671DCAB21C00F28D01 /* JSHmacKeyParams.h in Headers */,
</ins><span class="cx">                                 BC97E413109154FA0010D361 /* JSHTMLAllCollection.h in Headers */,
</span><span class="cx">                                 1A4A2DF00A1B852A00C807F8 /* JSHTMLAnchorElement.h in Headers */,
</span><span class="cx">                                 1A4A2DF20A1B852A00C807F8 /* JSHTMLAppletElement.h in Headers */,
</span><span class="lines">@@ -26076,7 +26120,9 @@
</span><span class="cx">                                 A86629D309DA2B48009633A6 /* JSInputEvent.h in Headers */,
</span><span class="cx">                                 7A0E771F10C00DB100A0276E /* JSInspectorFrontendHost.h in Headers */,
</span><span class="cx">                                 0F4710E61DB700C7002DCEC3 /* JSIntersectionObserver.h in Headers */,
</span><ins>+                                0F8B45761DC41DBA00443C3F /* JSIntersectionObserverCallback.h in Headers */,
</ins><span class="cx">                                 0F4710E81DB700C7002DCEC3 /* JSIntersectionObserverEntry.h in Headers */,
</span><ins>+                                57E2335B1DC7D5E500F28D01 /* JSJsonWebKey.h in Headers */,
</ins><span class="cx">                                 A86629D309DA2B48009633A5 /* JSKeyboardEvent.h in Headers */,
</span><span class="cx">                                 12A253E11C8FFF6600C22295 /* JSKeyframeEffect.h in Headers */,
</span><span class="cx">                                 935F45430F7C3B5F00D7C1FB /* JSLazyEventListener.h in Headers */,
</span><span class="lines">@@ -26142,6 +26188,7 @@
</span><span class="cx">                                 77A17AA712F28B2A004E02F6 /* JSOESVertexArrayObject.h in Headers */,
</span><span class="cx">                                 FDF6BAF9134A4C9800822920 /* JSOfflineAudioCompletionEvent.h in Headers */,
</span><span class="cx">                                 FDA9326716703BA9008982DC /* JSOfflineAudioContext.h in Headers */,
</span><ins>+                                57E233651DC7DB1F00F28D01 /* JsonWebKey.h in Headers */,
</ins><span class="cx">                                 FDEA6243152102E200479DF0 /* JSOscillatorNode.h in Headers */,
</span><span class="cx">                                 0704A40C1D6DFC690086DCDB /* JSOverconstrainedError.h in Headers */,
</span><span class="cx">                                 0704A4161D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.h in Headers */,
</span><span class="lines">@@ -26173,8 +26220,10 @@
</span><span class="cx">                                 BCFE2F120C1B58380020235F /* JSRect.h in Headers */,
</span><span class="cx">                                 4998AECE13F9D6C90090B1AA /* JSRequestAnimationFrameCallback.h in Headers */,
</span><span class="cx">                                 BC74DA491013F468007987AD /* JSRGBColor.h in Headers */,
</span><ins>+                                57E233711DCD468F00F28D01 /* JSRsaHashedImportParams.h in Headers */,
</ins><span class="cx">                                 5768E4341DB7524500D0A4F7 /* JSRsaHashedKeyGenParams.h in Headers */,
</span><span class="cx">                                 57FEDD411DB6D73A00EB96F5 /* JSRsaKeyGenParams.h in Headers */,
</span><ins>+                                57E2335D1DC7D60800F28D01 /* JSRsaOtherPrimesInfo.h in Headers */,
</ins><span class="cx">                                 073794E619EE2FF200E5A045 /* JSRTCConfiguration.h in Headers */,
</span><span class="cx">                                 07969DAC17D14151007FF842 /* JSRTCDataChannel.h in Headers */,
</span><span class="cx">                                 07969DAE17D14151007FF842 /* JSRTCDataChannelEvent.h in Headers */,
</span><span class="lines">@@ -26494,7 +26543,6 @@
</span><span class="cx">                                 FFEFAB2A18380DA000514534 /* LineLayoutState.h in Headers */,
</span><span class="cx">                                 FFDBC047183D27B700407109 /* LineWidth.h in Headers */,
</span><span class="cx">                                 A7AD2F880EC89D07008AB002 /* LinkHash.h in Headers */,
</span><del>-                                519DBC721DC10F5200329BF5 /* IDBGetAllResult.h in Headers */,
</del><span class="cx">                                 1A4DA4221CDD3A8300F4473C /* LinkIconCollector.h in Headers */,
</span><span class="cx">                                 1A250E0D1CDD632000D0BE63 /* LinkIconType.h in Headers */,
</span><span class="cx">                                 98CE432A129E00E5005821DC /* LinkLoader.h in Headers */,
</span><span class="lines">@@ -26605,13 +26653,11 @@
</span><span class="cx">                                 C90843D01B18E47D00B68564 /* MediaRemoteControls.h in Headers */,
</span><span class="cx">                                 CD8ACA8F1D23971900ECC59E /* MediaRemoteSoftLink.h in Headers */,
</span><span class="cx">                                 CD8ACA8B1D23946400ECC59E /* MediaRemoteSPI.h in Headers */,
</span><del>-                                724EE5511DC80D8400A91FFB /* ActivityStateChangeObserver.h in Headers */,
</del><span class="cx">                                 CEEFCD7A19DB31F7003876D7 /* MediaResourceLoader.h in Headers */,
</span><span class="cx">                                 1BF9DB3C1D3973AD0026AEB7 /* MediaSample.h in Headers */,
</span><span class="cx">                                 1B124D8D1D380B7000ECDFB0 /* MediaSampleAVFObjC.h in Headers */,
</span><span class="cx">                                 CDBEAEAD19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h in Headers */,
</span><span class="cx">                                 C9027F421B1D0AD200BFBFEF /* MediaSession.h in Headers */,
</span><del>-                                83C45B8E1DC2B68A008871BA /* ValidationBubble.h in Headers */,
</del><span class="cx">                                 C9F87CFE1B28F40E00979B83 /* MediaSessionEvents.h in Headers */,
</span><span class="cx">                                 C96F5EC81B5872260091EA9D /* MediaSessionInterruptionProvider.h in Headers */,
</span><span class="cx">                                 C96F5EC51B5872260091EA9D /* MediaSessionInterruptionProviderMac.h in Headers */,
</span><span class="lines">@@ -27173,6 +27219,7 @@
</span><span class="cx">                                 A8CFF5E10A155A05000A4234 /* RootInlineBox.h in Headers */,
</span><span class="cx">                                 49E911C90EF86D47009D0CAF /* RotateTransformOperation.h in Headers */,
</span><span class="cx">                                 A73F95FF12C97BFE0031AAF9 /* RoundedRect.h in Headers */,
</span><ins>+                                57E233631DC7DA2400F28D01 /* RsaOtherPrimesInfo.h in Headers */,
</ins><span class="cx">                                 07AB996918DA3C010018771E /* RTCConfiguration.h in Headers */,
</span><span class="cx">                                 07AB996F18DA3C740018771E /* RTCConfigurationPrivate.h in Headers */,
</span><span class="cx">                                 078E091E17D14D1C00420AA1 /* RTCDataChannel.h in Headers */,
</span><span class="lines">@@ -27516,7 +27563,6 @@
</span><span class="cx">                                 08525E631278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h in Headers */,
</span><span class="cx">                                 084DB59B128008CC002A6D64 /* SVGAnimatedString.h in Headers */,
</span><span class="cx">                                 08250939128BD4D800E2ED8E /* SVGAnimatedTransformList.h in Headers */,
</span><del>-                                E3A776681DC85D2800B690D8 /* DOMJITIDLType.h in Headers */,
</del><span class="cx">                                 085A15931289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h in Headers */,
</span><span class="cx">                                 439D334313A6911C00C20F4F /* SVGAnimatedType.h in Headers */,
</span><span class="cx">                                 439D334413A6911C00C20F4F /* SVGAnimatedTypeAnimator.h in Headers */,
</span><span class="lines">@@ -27666,7 +27712,6 @@
</span><span class="cx">                                 B2227A8F0D00BF220071B782 /* SVGPolyElement.h in Headers */,
</span><span class="cx">                                 B2227A910D00BF220071B782 /* SVGPolygonElement.h in Headers */,
</span><span class="cx">                                 B2227A940D00BF220071B782 /* SVGPolylineElement.h in Headers */,
</span><del>-                                E3C99A091DC3D41C00794AD3 /* DOMJITCheckDOM.h in Headers */,
</del><span class="cx">                                 B2227A970D00BF220071B782 /* SVGPreserveAspectRatio.h in Headers */,
</span><span class="cx">                                 088A0E0A126EF1DB00978F7A /* SVGProperty.h in Headers */,
</span><span class="cx">                                 081DD49C13BA1A6000DC7627 /* SVGPropertyInfo.h in Headers */,
</span><span class="lines">@@ -27758,7 +27803,6 @@
</span><span class="cx">                                 B2C3DA400D006C1D00EF6F26 /* TextCodecUserDefined.h in Headers */,
</span><span class="cx">                                 B2C3DA420D006C1D00EF6F26 /* TextCodecUTF16.h in Headers */,
</span><span class="cx">                                 9343CB8212F25E510033C5EE /* TextCodecUTF8.h in Headers */,
</span><del>-                                0F8B45761DC41DBA00443C3F /* JSIntersectionObserverCallback.h in Headers */,
</del><span class="cx">                                 142B97CA13138943008BEF4B /* TextControlInnerElements.h in Headers */,
</span><span class="cx">                                 582DE3251C30C85400BE02A8 /* TextDecorationPainter.h in Headers */,
</span><span class="cx">                                 97BC84B412371180000C6161 /* TextDocument.h in Headers */,
</span><span class="lines">@@ -27867,7 +27911,6 @@
</span><span class="cx">                                 F55B3DDE1251F12D003EF269 /* URLInputType.h in Headers */,
</span><span class="cx">                                 5C6E65431D5CEFBF00F7862E /* URLParser.h in Headers */,
</span><span class="cx">                                 7CC289DF1AA0FE5D009A9CE3 /* URLRegistry.h in Headers */,
</span><del>-                                E318039D1DC40099009932C2 /* JSDynamicDowncast.h in Headers */,
</del><span class="cx">                                 93D437A21D57B3FE00AB85EA /* URLUtils.h in Headers */,
</span><span class="cx">                                 A72763BF16689BFB002FCACB /* UserActionElementSet.h in Headers */,
</span><span class="cx">                                 868160D618766A130021E79D /* UserActivity.h in Headers */,
</span><span class="lines">@@ -27895,6 +27938,7 @@
</span><span class="cx">                                 BCDF317C11F8D683003C5BF8 /* UserTypingGestureIndicator.h in Headers */,
</span><span class="cx">                                 1FAFBF1915A5FA7400083A20 /* UTIUtilities.h in Headers */,
</span><span class="cx">                                 2E3BBF081162DA1100B9409A /* UUID.h in Headers */,
</span><ins>+                                83C45B8E1DC2B68A008871BA /* ValidationBubble.h in Headers */,
</ins><span class="cx">                                 F5A154281279534D00D0B0C0 /* ValidationMessage.h in Headers */,
</span><span class="cx">                                 F513A3EA15FF4841001526DB /* ValidationMessageClient.h in Headers */,
</span><span class="cx">                                 15C7708D100D3C6B005BA267 /* ValidityState.h in Headers */,
</span><span class="lines">@@ -28055,7 +28099,6 @@
</span><span class="cx">                                 97AABD2314FA09D5007457AE /* WebSocketExtensionDispatcher.h in Headers */,
</span><span class="cx">                                 4A5A2ADC161E7E00005889DD /* WebSocketExtensionParser.h in Headers */,
</span><span class="cx">                                 97AABD2414FA09D5007457AE /* WebSocketExtensionProcessor.h in Headers */,
</span><del>-                                E35802B61DC8435D00A9773C /* DOMJITIDLTypeFilter.h in Headers */,
</del><span class="cx">                                 97AABD2514FA09D5007457AE /* WebSocketFrame.h in Headers */,
</span><span class="cx">                                 97AABD2714FA09D5007457AE /* WebSocketHandshake.h in Headers */,
</span><span class="cx">                                 31DEA4561B39F4D900F77178 /* WebSystemBackdropLayer.h in Headers */,
</span><span class="lines">@@ -28074,7 +28117,6 @@
</span><span class="cx">                                 B10B6980140C174000BC1C26 /* WebVTTToken.h in Headers */,
</span><span class="cx">                                 B10B6982140C174000BC1C26 /* WebVTTTokenizer.h in Headers */,
</span><span class="cx">                                 CD8203101395ACE700F956C6 /* WebWindowAnimation.h in Headers */,
</span><del>-                                724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */,
</del><span class="cx">                                 F55B3DE01251F12D003EF269 /* WeekInputType.h in Headers */,
</span><span class="cx">                                 85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */,
</span><span class="cx">                                 2EBBC3D81B65988300F5253D /* WheelEventDeltaFilter.h in Headers */,
</span><span class="lines">@@ -28522,7 +28564,6 @@
</span><span class="cx">                                 FD31603D12B0267600C1A359 /* AnalyserNode.cpp in Sources */,
</span><span class="cx">                                 31A795C81888BCB500382F90 /* ANGLEInstancedArrays.cpp in Sources */,
</span><span class="cx">                                 490707E61219C04300D90E51 /* ANGLEWebKitBridge.cpp in Sources */,
</span><del>-                                0F8B45751DC41DBA00443C3F /* JSIntersectionObserverCallback.cpp in Sources */,
</del><span class="cx">                                 49E912AA0EFAC906009D0CAF /* Animation.cpp in Sources */,
</span><span class="cx">                                 316FE1110E6E1DA700BF6088 /* AnimationBase.cpp in Sources */,
</span><span class="cx">                                 316FE1130E6E1DA700BF6088 /* AnimationController.cpp in Sources */,
</span><span class="lines">@@ -28712,7 +28753,6 @@
</span><span class="cx">                                 CDEA76351460B71A008B31F1 /* Clock.cpp in Sources */,
</span><span class="cx">                                 CDEA76341460B56F008B31F1 /* ClockGeneric.cpp in Sources */,
</span><span class="cx">                                 9BD8A95A18BEFC7600987E9A /* CollectionIndexCache.cpp in Sources */,
</span><del>-                                519DBC6E1DC011A200329BF5 /* IDBGetAllRecordsData.cpp in Sources */,
</del><span class="cx">                                 B27535660B053814002CE64F /* Color.cpp in Sources */,
</span><span class="cx">                                 0FCF33240F2B9715004B6795 /* ColorCG.cpp in Sources */,
</span><span class="cx">                                 1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */,
</span><span class="lines">@@ -28810,12 +28850,12 @@
</span><span class="cx">                                 E125F8351822F18A00D84CD9 /* CryptoKeyHMAC.cpp in Sources */,
</span><span class="cx">                                 E19AC3F9182566F700349426 /* CryptoKeyMac.cpp in Sources */,
</span><span class="cx">                                 E1F80B8718317252007885C3 /* CryptoKeyPair.cpp in Sources */,
</span><ins>+                                57E2336B1DCC262400F28D01 /* CryptoKeyRSA.cpp in Sources */,
</ins><span class="cx">                                 E164FAA518315E1A00DB4E61 /* CryptoKeyRSAMac.cpp in Sources */,
</span><span class="cx">                                 E125F859182C1AA600D84CD9 /* CryptoKeySerializationRaw.cpp in Sources */,
</span><span class="cx">                                 31BC742D1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.cpp in Sources */,
</span><span class="cx">                                 CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */,
</span><span class="cx">                                 94DE5C811D7F3A1400164F2A /* CSSAtRuleID.cpp in Sources */,
</span><del>-                                41E408391DCB748900EFCE19 /* PeerConnectionBackend.cpp in Sources */,
</del><span class="cx">                                 FBD6AF8B15EF25E5008B7110 /* CSSBasicShapes.cpp in Sources */,
</span><span class="cx">                                 E16A84F914C85CCC002977DF /* CSSBorderImage.cpp in Sources */,
</span><span class="cx">                                 BC274B31140EBED800EADFA6 /* CSSBorderImageSliceValue.cpp in Sources */,
</span><span class="lines">@@ -29007,6 +29047,7 @@
</span><span class="cx">                                 BC1BDF24156C1883001C1243 /* DOMError.cpp in Sources */,
</span><span class="cx">                                 2ED609BC1145B07100C8684E /* DOMFormData.cpp in Sources */,
</span><span class="cx">                                 A8185F3E09765766005826D9 /* DOMImplementation.cpp in Sources */,
</span><ins>+                                E398FC241DC32A20003C4684 /* DOMJITHelpers.cpp in Sources */,
</ins><span class="cx">                                 A9C6E4E30D745E05006442E9 /* DOMMimeType.cpp in Sources */,
</span><span class="cx">                                 A9C6E4E70D745E18006442E9 /* DOMMimeTypeArray.cpp in Sources */,
</span><span class="cx">                                 52B6C9C215E3F4DF00690B05 /* DOMNamedFlowCollection.cpp in Sources */,
</span><span class="lines">@@ -29297,7 +29338,6 @@
</span><span class="cx">                                 A871DE240A152AC800B12A68 /* HTMLIFrameElement.cpp in Sources */,
</span><span class="cx">                                 A8EA7D310A19385500A8EF5F /* HTMLImageElement.cpp in Sources */,
</span><span class="cx">                                 A8EA7D300A19385500A8EF5F /* HTMLImageLoader.cpp in Sources */,
</span><del>-                                E3B7C0631DC34160001FB0B8 /* JSDocumentDOMJIT.cpp in Sources */,
</del><span class="cx">                                 A81369CD097374F600D74463 /* HTMLInputElement.cpp in Sources */,
</span><span class="cx">                                 93309DE5099E64920056E581 /* HTMLInterchange.cpp in Sources */,
</span><span class="cx">                                 A81369E5097374F600D74463 /* HTMLKeygenElement.cpp in Sources */,
</span><span class="lines">@@ -29308,7 +29348,6 @@
</span><span class="cx">                                 A8EA7D320A19385500A8EF5F /* HTMLMapElement.cpp in Sources */,
</span><span class="cx">                                 A8EA7CAC0A192B9C00A8EF5F /* HTMLMarqueeElement.cpp in Sources */,
</span><span class="cx">                                 E44613A40CD6331000FADA75 /* HTMLMediaElement.cpp in Sources */,
</span><del>-                                519DBC731DC10F5600329BF5 /* IDBGetAllResult.cpp in Sources */,
</del><span class="cx">                                 C968B2E81B1E778100EF1F81 /* HTMLMediaElementMediaSession.cpp in Sources */,
</span><span class="cx">                                 0779BF0D18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp in Sources */,
</span><span class="cx">                                 A8EA79F80A1916DF00A8EF5F /* HTMLMenuElement.cpp in Sources */,
</span><span class="lines">@@ -29392,6 +29431,8 @@
</span><span class="cx">                                 5148453E1BB9D07E006A72ED /* IDBError.cpp in Sources */,
</span><span class="cx">                                 5185FC8A1BB4C4E80012898F /* IDBEventDispatcher.cpp in Sources */,
</span><span class="cx">                                 5185FC8C1BB4C4E80012898F /* IDBFactory.cpp in Sources */,
</span><ins>+                                519DBC6E1DC011A200329BF5 /* IDBGetAllRecordsData.cpp in Sources */,
+                                519DBC731DC10F5600329BF5 /* IDBGetAllResult.cpp in Sources */,
</ins><span class="cx">                                 5105F06B1D4BB12700FB80BC /* IDBGetRecordData.cpp in Sources */,
</span><span class="cx">                                 512F1A781C07EB6600908239 /* IDBGetResult.cpp in Sources */,
</span><span class="cx">                                 5185FC901BB4C4E80012898F /* IDBIndex.cpp in Sources */,
</span><span class="lines">@@ -29515,7 +29556,6 @@
</span><span class="cx">                                 577483161DAEC32300716EF9 /* JSAesKeyGenParams.cpp in Sources */,
</span><span class="cx">                                 FDA15EC912B03F50003A583A /* JSAnalyserNode.cpp in Sources */,
</span><span class="cx">                                 31A795C61888BADC00382F90 /* JSANGLEInstancedArrays.cpp in Sources */,
</span><del>-                                83C45B8C1DC2B667008871BA /* ValidationBubbleMac.mm in Sources */,
</del><span class="cx">                                 12A253E21C8FFF6600C22295 /* JSAnimatable.cpp in Sources */,
</span><span class="cx">                                 120DE3FE1C87E18800B6D4DD /* JSAnimationEffect.cpp in Sources */,
</span><span class="cx">                                 3198480B1A1E6CE400A13318 /* JSAnimationEvent.cpp in Sources */,
</span><span class="lines">@@ -29610,7 +29650,6 @@
</span><span class="cx">                                 9BD4E9161C462872005065BC /* JSCustomElementInterface.cpp in Sources */,
</span><span class="cx">                                 9BE6710B1D5AEB2100345514 /* JSCustomElementRegistry.cpp in Sources */,
</span><span class="cx">                                 9BC5F9E01D5AAF6B002B749D /* JSCustomElementRegistryCustom.cpp in Sources */,
</span><del>-                                E398FC241DC32A20003C4684 /* DOMJITHelpers.cpp in Sources */,
</del><span class="cx">                                 E4778B7F115A581A00B5D372 /* JSCustomEvent.cpp in Sources */,
</span><span class="cx">                                 DEC297611B4F2F8D005F5945 /* JSCustomEventCustom.cpp in Sources */,
</span><span class="cx">                                 51EC92650CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp in Sources */,
</span><span class="lines">@@ -29632,6 +29671,7 @@
</span><span class="cx">                                 659DDC8209E198BA001BF3C6 /* JSDocument.cpp in Sources */,
</span><span class="cx">                                 1221E05D1C02B444006A1A00 /* JSDocumentAnimation.cpp in Sources */,
</span><span class="cx">                                 49C7BA8D1042F5B10009D447 /* JSDocumentCustom.cpp in Sources */,
</span><ins>+                                E3B7C0631DC34160001FB0B8 /* JSDocumentDOMJIT.cpp in Sources */,
</ins><span class="cx">                                 1A494EDE0A123F4C00FDAFC1 /* JSDocumentFragment.cpp in Sources */,
</span><span class="cx">                                 7C33F3621B4A050400502CAF /* JSDocumentFragmentCustom.cpp in Sources */,
</span><span class="cx">                                 1221E05F1C02B444006A1A00 /* JSDocumentTimeline.cpp in Sources */,
</span><span class="lines">@@ -29723,7 +29763,7 @@
</span><span class="cx">                                 8482B7511198CB6B00BFB005 /* JSHashChangeEvent.cpp in Sources */,
</span><span class="cx">                                 BC94D14E0C275C68006BC617 /* JSHistory.cpp in Sources */,
</span><span class="cx">                                 BCE7B1930D4E86960075A539 /* JSHistoryCustom.cpp in Sources */,
</span><del>-                                5774831D1DB459DE00716EF9 /* JSHmacKeyGenParams.cpp in Sources */,
</del><ins>+                                57E233691DCAB24300F28D01 /* JSHmacKeyParams.cpp in Sources */,
</ins><span class="cx">                                 BC97E412109154FA0010D361 /* JSHTMLAllCollection.cpp in Sources */,
</span><span class="cx">                                 BC97E42C10915B060010D361 /* JSHTMLAllCollectionCustom.cpp in Sources */,
</span><span class="cx">                                 1A4A2DEF0A1B852A00C807F8 /* JSHTMLAnchorElement.cpp in Sources */,
</span><span class="lines">@@ -29734,7 +29774,6 @@
</span><span class="cx">                                 E44614370CD689C400FADA75 /* JSHTMLAudioElement.cpp in Sources */,
</span><span class="cx">                                 A80E7B120A19D606007FB8C5 /* JSHTMLBaseElement.cpp in Sources */,
</span><span class="cx">                                 1AE2AA220A1CDAB400B42B25 /* JSHTMLBodyElement.cpp in Sources */,
</span><del>-                                837B7D201DC3F55000D051FC /* ValidationBubbleIOS.mm in Sources */,
</del><span class="cx">                                 1AE2AA240A1CDAB400B42B25 /* JSHTMLBRElement.cpp in Sources */,
</span><span class="cx">                                 A80E7EA00A1A83E3007FB8C5 /* JSHTMLButtonElement.cpp in Sources */,
</span><span class="cx">                                 938E666009F09B81008A48EC /* JSHTMLCanvasElement.cpp in Sources */,
</span><span class="lines">@@ -29845,7 +29884,9 @@
</span><span class="cx">                                 7A0E771E10C00DB100A0276E /* JSInspectorFrontendHost.cpp in Sources */,
</span><span class="cx">                                 7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */,
</span><span class="cx">                                 0F4710E51DB700C7002DCEC3 /* JSIntersectionObserver.cpp in Sources */,
</span><ins>+                                0F8B45751DC41DBA00443C3F /* JSIntersectionObserverCallback.cpp in Sources */,
</ins><span class="cx">                                 0F4710E71DB700C7002DCEC3 /* JSIntersectionObserverEntry.cpp in Sources */,
</span><ins>+                                57E2335F1DC7D67B00F28D01 /* JSJsonWebKey.cpp in Sources */,
</ins><span class="cx">                                 A86629D409DA2B48009633A5 /* JSKeyboardEvent.cpp in Sources */,
</span><span class="cx">                                 12A253E01C8FFF6600C22295 /* JSKeyframeEffect.cpp in Sources */,
</span><span class="cx">                                 935F45420F7C3B5F00D7C1FB /* JSLazyEventListener.cpp in Sources */,
</span><span class="lines">@@ -29959,8 +30000,10 @@
</span><span class="cx">                                 BCFE2F110C1B58370020235F /* JSRect.cpp in Sources */,
</span><span class="cx">                                 4998AECD13F9D6C90090B1AA /* JSRequestAnimationFrameCallback.cpp in Sources */,
</span><span class="cx">                                 BC74DA481013F468007987AD /* JSRGBColor.cpp in Sources */,
</span><ins>+                                57E233731DCD46B600F28D01 /* JSRsaHashedImportParams.cpp in Sources */,
</ins><span class="cx">                                 5768E4361DB7527400D0A4F7 /* JSRsaHashedKeyGenParams.cpp in Sources */,
</span><span class="cx">                                 57FEDD431DB6D76000EB96F5 /* JSRsaKeyGenParams.cpp in Sources */,
</span><ins>+                                57E233611DC7D6AA00F28D01 /* JSRsaOtherPrimesInfo.cpp in Sources */,
</ins><span class="cx">                                 073794E519EE2FF200E5A045 /* JSRTCConfiguration.cpp in Sources */,
</span><span class="cx">                                 07969DAB17D14151007FF842 /* JSRTCDataChannel.cpp in Sources */,
</span><span class="cx">                                 07969DAD17D14151007FF842 /* JSRTCDataChannelEvent.cpp in Sources */,
</span><span class="lines">@@ -30590,6 +30633,7 @@
</span><span class="cx">                                 1A8A64671D19FDFF00D0E00F /* PaymentRequestValidator.cpp in Sources */,
</span><span class="cx">                                 B27535640B053814002CE64F /* PDFDocumentImage.cpp in Sources */,
</span><span class="cx">                                 2D6E468417D660F500ECF8BB /* PDFDocumentImageMac.mm in Sources */,
</span><ins>+                                41E408391DCB748900EFCE19 /* PeerConnectionBackend.cpp in Sources */,
</ins><span class="cx">                                 8A7CC97012076F8A001D4588 /* PendingScript.cpp in Sources */,
</span><span class="cx">                                 E526AF3F1727F8F200E41781 /* Performance.cpp in Sources */,
</span><span class="cx">                                 CB38FD4B1CCCF36600592A3F /* PerformanceEntry.cpp in Sources */,
</span><span class="lines">@@ -31407,6 +31451,8 @@
</span><span class="cx">                                 BCDF317B11F8D683003C5BF8 /* UserTypingGestureIndicator.cpp in Sources */,
</span><span class="cx">                                 1FAFBF1815A5FA6E00083A20 /* UTIUtilities.mm in Sources */,
</span><span class="cx">                                 2E3BBF071162DA1100B9409A /* UUID.cpp in Sources */,
</span><ins>+                                837B7D201DC3F55000D051FC /* ValidationBubbleIOS.mm in Sources */,
+                                83C45B8C1DC2B667008871BA /* ValidationBubbleMac.mm in Sources */,
</ins><span class="cx">                                 F5A154271279534D00D0B0C0 /* ValidationMessage.cpp in Sources */,
</span><span class="cx">                                 FD3160AE12B026F700C1A359 /* VectorMath.cpp in Sources */,
</span><span class="cx">                                 52D5A18F1C54592300DE34A3 /* VideoFullscreenLayerManager.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSSubtleCryptoCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -35,7 +35,9 @@
</span><span class="cx"> #include &quot;JSCryptoKey.h&quot;
</span><span class="cx"> #include &quot;JSCryptoKeyPair.h&quot;
</span><span class="cx"> #include &quot;JSDOMPromise.h&quot;
</span><del>-#include &quot;JSHmacKeyGenParams.h&quot;
</del><ins>+#include &quot;JSHmacKeyParams.h&quot;
+#include &quot;JSJsonWebKey.h&quot;
+#include &quot;JSRsaHashedImportParams.h&quot;
</ins><span class="cx"> #include &quot;JSRsaHashedKeyGenParams.h&quot;
</span><span class="cx"> #include &quot;JSRsaKeyGenParams.h&quot;
</span><span class="cx"> #include &quot;ScriptState.h&quot;
</span><span class="lines">@@ -47,8 +49,9 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> enum class Operations {
</span><ins>+    Digest,
</ins><span class="cx">     GenerateKey,
</span><del>-    Digest,
</del><ins>+    ImportKey,
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> static std::unique_ptr&lt;CryptoAlgorithmParameters&gt; normalizeCryptoAlgorithmParameters(ExecState&amp;, JSValue, Operations);
</span><span class="lines">@@ -86,6 +89,20 @@
</span><span class="cx"> 
</span><span class="cx">         std::unique_ptr&lt;CryptoAlgorithmParameters&gt; result;
</span><span class="cx">         switch (operation) {
</span><ins>+        case Operations::Digest:
+            switch (identifier) {
+            case CryptoAlgorithmIdentifier::SHA_1:
+            case CryptoAlgorithmIdentifier::SHA_224:
+            case CryptoAlgorithmIdentifier::SHA_256:
+            case CryptoAlgorithmIdentifier::SHA_384:
+            case CryptoAlgorithmIdentifier::SHA_512:
+                result = std::make_unique&lt;CryptoAlgorithmParameters&gt;(params);
+                break;
+            default:
+                setDOMException(&amp;state, NOT_SUPPORTED_ERR);
+                return nullptr;
+            }
+            break;
</ins><span class="cx">         case Operations::GenerateKey:
</span><span class="cx">             switch (identifier) {
</span><span class="cx">             case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5: {
</span><span class="lines">@@ -116,11 +133,11 @@
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">             case CryptoAlgorithmIdentifier::HMAC: {
</span><del>-                auto params = convertDictionary&lt;CryptoAlgorithmHmacKeyGenParams&gt;(state, value);
</del><ins>+                auto params = convertDictionary&lt;CryptoAlgorithmHmacKeyParams&gt;(state, value);
</ins><span class="cx">                 RETURN_IF_EXCEPTION(scope, nullptr);
</span><span class="cx">                 params.hashIdentifier = toHashIdentifier(state, params.hash);
</span><span class="cx">                 RETURN_IF_EXCEPTION(scope, nullptr);
</span><del>-                result = std::make_unique&lt;CryptoAlgorithmHmacKeyGenParams&gt;(params);
</del><ins>+                result = std::make_unique&lt;CryptoAlgorithmHmacKeyParams&gt;(params);
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">             default:
</span><span class="lines">@@ -128,15 +145,37 @@
</span><span class="cx">                 return nullptr;
</span><span class="cx">             }
</span><span class="cx">             break;
</span><del>-        case Operations::Digest:
</del><ins>+        case Operations::ImportKey:
</ins><span class="cx">             switch (identifier) {
</span><del>-            case CryptoAlgorithmIdentifier::SHA_1:
-            case CryptoAlgorithmIdentifier::SHA_224:
-            case CryptoAlgorithmIdentifier::SHA_256:
-            case CryptoAlgorithmIdentifier::SHA_384:
-            case CryptoAlgorithmIdentifier::SHA_512:
</del><ins>+            case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5:
</ins><span class="cx">                 result = std::make_unique&lt;CryptoAlgorithmParameters&gt;(params);
</span><span class="cx">                 break;
</span><ins>+            case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
+            case CryptoAlgorithmIdentifier::RSA_PSS:
+            case CryptoAlgorithmIdentifier::RSA_OAEP: {
+                auto params = convertDictionary&lt;CryptoAlgorithmRsaHashedImportParams&gt;(state, value);
+                RETURN_IF_EXCEPTION(scope, nullptr);
+                params.hashIdentifier = toHashIdentifier(state, params.hash);
+                RETURN_IF_EXCEPTION(scope, nullptr);
+                result = std::make_unique&lt;CryptoAlgorithmRsaHashedImportParams&gt;(params);
+                break;
+            }
+            case CryptoAlgorithmIdentifier::AES_CTR:
+            case CryptoAlgorithmIdentifier::AES_CBC:
+            case CryptoAlgorithmIdentifier::AES_CMAC:
+            case CryptoAlgorithmIdentifier::AES_GCM:
+            case CryptoAlgorithmIdentifier::AES_CFB:
+            case CryptoAlgorithmIdentifier::AES_KW:
+                result = std::make_unique&lt;CryptoAlgorithmParameters&gt;(params);
+                break;
+            case CryptoAlgorithmIdentifier::HMAC: {
+                auto params = convertDictionary&lt;CryptoAlgorithmHmacKeyParams&gt;(state, value);
+                RETURN_IF_EXCEPTION(scope, nullptr);
+                params.hashIdentifier = toHashIdentifier(state, params.hash);
+                RETURN_IF_EXCEPTION(scope, nullptr);
+                result = std::make_unique&lt;CryptoAlgorithmHmacKeyParams&gt;(params);
+                break;
+            }
</ins><span class="cx">             default:
</span><span class="cx">                 setDOMException(&amp;state, NOT_SUPPORTED_ERR);
</span><span class="cx">                 return nullptr;
</span><span class="lines">@@ -155,6 +194,29 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static CryptoKeyUsage cryptoKeyUsageFromString(const String&amp; usageString)
+{
+    CryptoKeyUsage result = 0;
+    if (usageString == &quot;encrypt&quot;)
+        result = CryptoKeyUsageEncrypt;
+    else if (usageString == &quot;decrypt&quot;)
+        result = CryptoKeyUsageDecrypt;
+    else if (usageString == &quot;sign&quot;)
+        result = CryptoKeyUsageSign;
+    else if (usageString == &quot;verify&quot;)
+        result = CryptoKeyUsageVerify;
+    else if (usageString == &quot;deriveKey&quot;)
+        result = CryptoKeyUsageDeriveKey;
+    else if (usageString == &quot;deriveBits&quot;)
+        result = CryptoKeyUsageDeriveBits;
+    else if (usageString == &quot;wrapKey&quot;)
+        result = CryptoKeyUsageWrapKey;
+    else if (usageString == &quot;unwrapKey&quot;)
+        result = CryptoKeyUsageUnwrapKey;
+
+    return result;
+}
+
</ins><span class="cx"> static CryptoKeyUsage cryptoKeyUsagesFromJSValue(ExecState&amp; state, JSValue iterable)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state.vm();
</span><span class="lines">@@ -166,24 +228,12 @@
</span><span class="cx"> 
</span><span class="cx">         String usageString = nextItem.toWTFString(state);
</span><span class="cx">         RETURN_IF_EXCEPTION(scope, void());
</span><del>-        if (usageString == &quot;encrypt&quot;)
-            result |= CryptoKeyUsageEncrypt;
-        else if (usageString == &quot;decrypt&quot;)
-            result |= CryptoKeyUsageDecrypt;
-        else if (usageString == &quot;sign&quot;)
-            result |= CryptoKeyUsageSign;
-        else if (usageString == &quot;verify&quot;)
-            result |= CryptoKeyUsageVerify;
-        else if (usageString == &quot;deriveKey&quot;)
-            result |= CryptoKeyUsageDeriveKey;
-        else if (usageString == &quot;deriveBits&quot;)
-            result |= CryptoKeyUsageDeriveBits;
-        else if (usageString == &quot;wrapKey&quot;)
-            result |= CryptoKeyUsageWrapKey;
-        else if (usageString == &quot;unwrapKey&quot;)
-            result |= CryptoKeyUsageUnwrapKey;
-        else
</del><ins>+        CryptoKeyUsage usage = cryptoKeyUsageFromString(usageString);
+        if (!usage)
</ins><span class="cx">             throwTypeError(state, scope, ASCIILiteral(&quot;Invalid KeyUsages&quot;));
</span><ins>+
+        // Maybe we shouldn't silently bypass duplicated usages?
+        result |= usage;
</ins><span class="cx">     });
</span><span class="cx">     RETURN_IF_EXCEPTION(scope, 0);
</span><span class="cx">     return result;
</span><span class="lines">@@ -226,6 +276,46 @@
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static KeyData toKeyData(ExecState&amp; state, SubtleCrypto::KeyFormat format, JSValue value)
+{
+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
+    KeyData result;
+    switch (format) {
+    case SubtleCrypto::KeyFormat::Spki:
+    case SubtleCrypto::KeyFormat::Pkcs8:
+        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
+        return result;
+    case SubtleCrypto::KeyFormat::Raw: {
+        BufferSource bufferSource = convert&lt;IDLBufferSource&gt;(state, value);
+        RETURN_IF_EXCEPTION(scope, result);
+        Vector&lt;uint8_t&gt; vector;
+        vector.append(bufferSource.data(), bufferSource.length());
+        result = WTFMove(vector);
+        return result;
+    }
+    case SubtleCrypto::KeyFormat::Jwk: {
+        result = convertDictionary&lt;JsonWebKey&gt;(state, value);
+        RETURN_IF_EXCEPTION(scope, result);
+        CryptoKeyUsage usages = 0;
+        if (WTF::get&lt;JsonWebKey&gt;(result).key_ops) {
+            for (auto usageString : WTF::get&lt;JsonWebKey&gt;(result).key_ops.value()) {
+                CryptoKeyUsage usage = cryptoKeyUsageFromString(usageString);
+                if (!usage)
+                    throwTypeError(&amp;state, scope, ASCIILiteral(&quot;Invalid key_ops&quot;));
+                // Maybe we shouldn't silently bypass duplicated usages?
+                usages |= cryptoKeyUsageFromString(usageString);
+            }
+        }
+        WTF::get&lt;JsonWebKey&gt;(result).usages = usages;
+        return result;
+    }
+    }
+    ASSERT_NOT_REACHED();
+    return result;
+}
+
</ins><span class="cx"> static void jsSubtleCryptoFunctionGenerateKeyPromise(ExecState&amp; state, Ref&lt;DeferredPromise&gt;&amp;&amp; promise)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state.vm();
</span><span class="lines">@@ -242,7 +332,7 @@
</span><span class="cx">     auto extractable = state.uncheckedArgument(1).toBoolean(&amp;state);
</span><span class="cx">     RETURN_IF_EXCEPTION(scope, void());
</span><span class="cx"> 
</span><del>-    auto keyUsages = cryptoKeyUsagesFromJSValue(state, state.argument(2));
</del><ins>+    auto keyUsages = cryptoKeyUsagesFromJSValue(state, state.uncheckedArgument(2));
</ins><span class="cx">     RETURN_IF_EXCEPTION(scope, void());
</span><span class="cx"> 
</span><span class="cx">     auto algorithm = createAlgorithm(state, params-&gt;identifier);
</span><span class="lines">@@ -275,11 +365,61 @@
</span><span class="cx">     algorithm-&gt;generateKey(WTFMove(params), extractable, keyUsages, WTFMove(callback), WTFMove(exceptionCallback), scriptExecutionContextFromExecState(&amp;state));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void jsSubtleCryptoFunctionImportKeyPromise(ExecState&amp; state, Ref&lt;DeferredPromise&gt;&amp;&amp; promise)
+{
+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
+    if (UNLIKELY(state.argumentCount() &lt; 5)) {
+        promise-&gt;reject&lt;JSValue&gt;(createNotEnoughArgumentsError(&amp;state));
+        return;
+    }
+
+    auto format = convertEnumeration&lt;SubtleCrypto::KeyFormat&gt;(state, state.uncheckedArgument(0));
+    RETURN_IF_EXCEPTION(scope, void());
+
+    auto keyData = toKeyData(state, format, state.uncheckedArgument(1));
+    RETURN_IF_EXCEPTION(scope, void());
+
+    auto params = normalizeCryptoAlgorithmParameters(state, state.uncheckedArgument(2), Operations::ImportKey);
+    RETURN_IF_EXCEPTION(scope, void());
+
+    auto extractable = state.uncheckedArgument(3).toBoolean(&amp;state);
+    RETURN_IF_EXCEPTION(scope, void());
+
+    auto keyUsages = cryptoKeyUsagesFromJSValue(state, state.uncheckedArgument(4));
+    RETURN_IF_EXCEPTION(scope, void());
+
+    auto algorithm = createAlgorithm(state, params-&gt;identifier);
+    RETURN_IF_EXCEPTION(scope, void());
+
+    auto callback = [capturedPromise = promise.copyRef()](CryptoKey&amp; key) mutable {
+        if ((key.type() == CryptoKeyType::Private || key.type() == CryptoKeyType::Secret) &amp;&amp; !key.usagesBitmap()) {
+            rejectWithException(WTFMove(capturedPromise), SYNTAX_ERR);
+            return;
+        }
+        capturedPromise-&gt;resolve(key);
+    };
+    auto exceptionCallback = [capturedPromise =  promise.copyRef()](ExceptionCode ec) mutable {
+        rejectWithException(WTFMove(capturedPromise), ec);
+    };
+
+    // The spec suggests we should perform the following task asynchronously as of 11 December 2014:
+    // https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey
+    // That's simply not necessary. Therefore, we perform it synchronously.
+    algorithm-&gt;importKey(format, WTFMove(keyData), WTFMove(params), extractable, keyUsages, WTFMove(callback), WTFMove(exceptionCallback));
+}
+
</ins><span class="cx"> JSValue JSSubtleCrypto::generateKey(ExecState&amp; state)
</span><span class="cx"> {
</span><span class="cx">     return callPromiseFunction&lt;jsSubtleCryptoFunctionGenerateKeyPromise, PromiseExecutionScope::WindowOrWorker&gt;(state);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSValue JSSubtleCrypto::importKey(ExecState&amp; state)
+{
+    return callPromiseFunction&lt;jsSubtleCryptoFunctionImportKeyPromise, PromiseExecutionScope::WindowOrWorker&gt;(state);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoCryptoAlgorithmcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/CryptoAlgorithm.cpp (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/CryptoAlgorithm.cpp        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/CryptoAlgorithm.cpp        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -45,6 +45,11 @@
</span><span class="cx">     exceptionCallback(NOT_SUPPORTED_ERR);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CryptoAlgorithm::importKey(SubtleCrypto::KeyFormat, KeyData&amp;&amp;, const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool, CryptoKeyUsage, KeyCallback&amp;&amp;, ExceptionCallback&amp;&amp; exceptionCallback)
+{
+    exceptionCallback(NOT_SUPPORTED_ERR);
+}
+
</ins><span class="cx"> void CryptoAlgorithm::encrypt(const CryptoAlgorithmParametersDeprecated&amp;, const CryptoKey&amp;, const CryptoOperationData&amp;, VectorCallback&amp;&amp;, VoidCallback&amp;&amp;, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     ec = NOT_SUPPORTED_ERR;
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoCryptoAlgorithmh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/CryptoAlgorithm.h (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/CryptoAlgorithm.h        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/CryptoAlgorithm.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -28,9 +28,12 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CryptoAlgorithmIdentifier.h&quot;
</span><span class="cx"> #include &quot;CryptoKeyUsage.h&quot;
</span><ins>+#include &quot;JsonWebKey.h&quot;
+#include &quot;SubtleCrypto.h&quot;
</ins><span class="cx"> #include &lt;wtf/Function.h&gt;
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><ins>+#include &lt;wtf/Variant.h&gt;
</ins><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><span class="lines">@@ -49,6 +52,8 @@
</span><span class="cx"> // Data is mutable, so async operations should copy it first.
</span><span class="cx"> typedef std::pair&lt;const uint8_t*, size_t&gt; CryptoOperationData;
</span><span class="cx"> 
</span><ins>+using KeyData = Variant&lt;Vector&lt;uint8_t&gt;, JsonWebKey&gt;;
+
</ins><span class="cx"> class CryptoAlgorithm : public RefCounted&lt;CryptoAlgorithm&gt; {
</span><span class="cx"> public:
</span><span class="cx">     virtual ~CryptoAlgorithm();
</span><span class="lines">@@ -63,6 +68,7 @@
</span><span class="cx">     using ExceptionCallback = WTF::Function&lt;void(ExceptionCode)&gt;;
</span><span class="cx"> 
</span><span class="cx">     virtual void generateKey(const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&amp;&amp;, ExceptionCallback&amp;&amp;, ScriptExecutionContext*);
</span><ins>+    virtual void importKey(SubtleCrypto::KeyFormat, KeyData&amp;&amp;, const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool extractable, CryptoKeyUsage, KeyCallback&amp;&amp;, ExceptionCallback&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     // The following will be deprecated.
</span><span class="cx">     virtual void encrypt(const CryptoAlgorithmParametersDeprecated&amp;, const CryptoKey&amp;, const CryptoOperationData&amp;, VectorCallback&amp;&amp;, VoidCallback&amp;&amp; failureCallback, ExceptionCode&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoCryptoAlgorithmParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/CryptoAlgorithmParameters.h (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/CryptoAlgorithmParameters.h        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/CryptoAlgorithmParameters.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -38,8 +38,9 @@
</span><span class="cx">     enum class Class {
</span><span class="cx">         None,
</span><span class="cx">         AesKeyGenParams,
</span><del>-        HmacKeyGenParams,
</del><ins>+        HmacKeyParams,
</ins><span class="cx">         RsaHashedKeyGenParams,
</span><ins>+        RsaHashedImportParams,
</ins><span class="cx">         RsaKeyGenParams,
</span><span class="cx">     };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoJsonWebKeyhfromrev208547trunkSourceWebCorecryptoparametersCryptoAlgorithmHmacKeyGenParamsh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/JsonWebKey.h (from rev 208547, trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/JsonWebKey.h                                (rev 0)
+++ trunk/Source/WebCore/crypto/JsonWebKey.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include &quot;CryptoKeyUsage.h&quot;
+#include &quot;RsaOtherPrimesInfo.h&quot;
+#include &lt;wtf/Vector.h&gt;
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+namespace WebCore {
+
+struct JsonWebKey {
+    String kty;
+    Optional&lt;String&gt; use;
+    // FIXME: Consider merging key_ops and usages.
+    Optional&lt;Vector&lt;String&gt;&gt; key_ops;
+    CryptoKeyUsage usages;
+    Optional&lt;String&gt; alg;
+
+    Optional&lt;bool&gt; ext;
+
+    Optional&lt;String&gt; crv;
+    Optional&lt;String&gt; x;
+    Optional&lt;String&gt; y;
+    Optional&lt;String&gt; d;
+    Optional&lt;String&gt; n;
+    Optional&lt;String&gt; e;
+    Optional&lt;String&gt; p;
+    Optional&lt;String&gt; q;
+    Optional&lt;String&gt; dp;
+    Optional&lt;String&gt; dq;
+    Optional&lt;String&gt; qi;
+    Optional&lt;Vector&lt;RsaOtherPrimesInfo&gt;&gt; oth;
+    Optional&lt;String&gt; k;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SUBTLE_CRYPTO)
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptoJsonWebKeyidlfromrev208547trunkSourceWebCorecryptoparametersHmacKeyGenParamsidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/JsonWebKey.idl (from rev 208547, trunk/Source/WebCore/crypto/parameters/HmacKeyGenParams.idl) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/JsonWebKey.idl                                (rev 0)
+++ trunk/Source/WebCore/crypto/JsonWebKey.idl        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=SUBTLE_CRYPTO,
+] dictionary JsonWebKey {
+    // The following fields are defined in Section 3.1 of JSON Web Key
+    required DOMString kty;
+    DOMString use;
+    sequence&lt;DOMString&gt; key_ops;
+    DOMString alg;
+
+    // The following fields are defined in JSON Web Key Parameters Registration
+    boolean ext;
+
+    // The following fields are defined in Section 6 of JSON Web Algorithms
+    DOMString crv;
+    DOMString x;
+    DOMString y;
+    DOMString d;
+    DOMString n;
+    DOMString e;
+    DOMString p;
+    DOMString q;
+    DOMString dp;
+    DOMString dq;
+    DOMString qi;
+    sequence&lt;RsaOtherPrimesInfo&gt; oth;
+    DOMString k;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptoRsaOtherPrimesInfohfromrev208547trunkSourceWebCorecryptoSubtleCryptoh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/RsaOtherPrimesInfo.h (from rev 208547, trunk/Source/WebCore/crypto/SubtleCrypto.h) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/RsaOtherPrimesInfo.h                                (rev 0)
+++ trunk/Source/WebCore/crypto/RsaOtherPrimesInfo.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include &lt;wtf/text/WTFString.h&gt;
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+namespace WebCore {
+
+struct RsaOtherPrimesInfo {
+    String r;
+    String d;
+    String t;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SUBTLE_CRYPTO)
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptoRsaOtherPrimesInfoidlfromrev208547trunkSourceWebCorecryptoSubtleCryptoidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/RsaOtherPrimesInfo.idl (from rev 208547, trunk/Source/WebCore/crypto/SubtleCrypto.idl) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/RsaOtherPrimesInfo.idl                                (rev 0)
+++ trunk/Source/WebCore/crypto/RsaOtherPrimesInfo.idl        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=SUBTLE_CRYPTO,
+] dictionary RsaOtherPrimesInfo {
+    // The following fields are defined in Section 6.3.2.7 of JSON Web Algorithms
+    required DOMString r;
+    required DOMString d;
+    required DOMString t;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptoSubtleCryptoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/SubtleCrypto.h (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/SubtleCrypto.h        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/SubtleCrypto.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -35,6 +35,8 @@
</span><span class="cx"> 
</span><span class="cx"> class SubtleCrypto : public ContextDestructionObserver, public RefCounted&lt;SubtleCrypto&gt; {
</span><span class="cx"> public:
</span><ins>+    enum class KeyFormat { Raw, Spki, Pkcs8, Jwk };
+
</ins><span class="cx">     static Ref&lt;SubtleCrypto&gt; create(ScriptExecutionContext&amp; context) { return adoptRef(*new SubtleCrypto(context)); }
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoSubtleCryptoidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/SubtleCrypto.idl (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/SubtleCrypto.idl        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/SubtleCrypto.idl        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -23,6 +23,8 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+enum KeyFormat { &quot;raw&quot;, &quot;spki&quot;, &quot;pkcs8&quot;, &quot;jwk&quot; };
+
</ins><span class="cx"> [
</span><span class="cx">     Conditional=SUBTLE_CRYPTO,
</span><span class="cx">     Exposed=(Window,Worker),
</span><span class="lines">@@ -31,4 +33,5 @@
</span><span class="cx"> ] interface SubtleCrypto {
</span><span class="cx">     // FIXME: Should this return a Promise&lt;(CryptoKey or CryptoKeyPair)&gt;?
</span><span class="cx">     [Custom] Promise&lt;any&gt; generateKey(AlgorithmIdentifier algorithm, boolean extractable, sequence&lt;KeyUsage&gt; keyUsages);
</span><ins>+    [Custom] Promise&lt;CryptoKey&gt; importKey(KeyFormat format, (BufferSource or JsonWebKey) keyData, AlgorithmIdentifier algorithm, boolen extractable, sequence&lt;KeyUsage&gt; keyUsages);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmAES_CBCcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -39,6 +39,11 @@
</span><span class="cx"> 
</span><span class="cx"> const char* const CryptoAlgorithmAES_CBC::s_name = &quot;AES-CBC&quot;;
</span><span class="cx"> 
</span><ins>+static inline bool usagesAreInvalidForCryptoAlgorithmAES_CBC(CryptoKeyUsage usages)
+{
+    return usages &amp; (CryptoKeyUsageSign | CryptoKeyUsageVerify | CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits);
+}
+
</ins><span class="cx"> CryptoAlgorithmAES_CBC::CryptoAlgorithmAES_CBC()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -70,7 +75,7 @@
</span><span class="cx"> {
</span><span class="cx">     const auto&amp; aesParameters = downcast&lt;CryptoAlgorithmAesKeyGenParams&gt;(*parameters);
</span><span class="cx"> 
</span><del>-    if (usages &amp; (CryptoKeyUsageSign | CryptoKeyUsageVerify | CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits)) {
</del><ins>+    if (usagesAreInvalidForCryptoAlgorithmAES_CBC(usages)) {
</ins><span class="cx">         exceptionCallback(SYNTAX_ERR);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -84,6 +89,45 @@
</span><span class="cx">     callback(result.get(), nullptr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CryptoAlgorithmAES_CBC::importKey(SubtleCrypto::KeyFormat format, KeyData&amp;&amp; data, const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp; parameters, bool extractable, CryptoKeyUsage usages, KeyCallback&amp;&amp; callback, ExceptionCallback&amp;&amp; exceptionCallback)
+{
+    if (usagesAreInvalidForCryptoAlgorithmAES_CBC(usages)) {
+        exceptionCallback(SYNTAX_ERR);
+        return;
+    }
+
+    RefPtr&lt;CryptoKeyAES&gt; result;
+    switch (format) {
+    case SubtleCrypto::KeyFormat::Raw:
+        result = CryptoKeyAES::importRaw(parameters-&gt;identifier, WTFMove(WTF::get&lt;Vector&lt;uint8_t&gt;&gt;(data)), extractable, usages);
+        break;
+    case SubtleCrypto::KeyFormat::Jwk: {
+        auto checkAlgCallback = [](size_t length, const Optional&lt;String&gt;&amp; alg) -&gt; bool {
+            switch (length) {
+            case CryptoKeyAES::s_length128:
+                return !alg || alg.value() == &quot;A128CBC&quot;;
+            case CryptoKeyAES::s_length192:
+                return !alg || alg.value() == &quot;A192CBC&quot;;
+            case CryptoKeyAES::s_length256:
+                return !alg || alg.value() == &quot;A256CBC&quot;;
+            }
+            return false;
+        };
+        result = CryptoKeyAES::importJwk(parameters-&gt;identifier, WTFMove(WTF::get&lt;JsonWebKey&gt;(data)), extractable, usages, WTFMove(checkAlgCallback));
+        break;
+    }
+    default:
+        exceptionCallback(NOT_SUPPORTED_ERR);
+        return;
+    }
+    if (!result) {
+        exceptionCallback(DataError);
+        return;
+    }
+
+    callback(*result);
+}
+
</ins><span class="cx"> void CryptoAlgorithmAES_CBC::encrypt(const CryptoAlgorithmParametersDeprecated&amp; parameters, const CryptoKey&amp; key, const CryptoOperationData&amp; data, VectorCallback&amp;&amp; callback, VoidCallback&amp;&amp; failureCallback, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     const CryptoAlgorithmAesCbcParamsDeprecated&amp; aesCBCParameters = downcast&lt;CryptoAlgorithmAesCbcParamsDeprecated&gt;(parameters);
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmAES_CBCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.h (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.h        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     CryptoAlgorithmIdentifier identifier() const override;
</span><span class="cx"> 
</span><span class="cx">     void generateKey(const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&amp;&amp;, ExceptionCallback&amp;&amp;, ScriptExecutionContext*) final;
</span><ins>+    void importKey(SubtleCrypto::KeyFormat, KeyData&amp;&amp;, const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool extractable, CryptoKeyUsage, KeyCallback&amp;&amp;, ExceptionCallback&amp;&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     // The following will be deprecated.
</span><span class="cx">     void encrypt(const CryptoAlgorithmParametersDeprecated&amp;, const CryptoKey&amp;, const CryptoOperationData&amp;, VectorCallback&amp;&amp;, VoidCallback&amp;&amp; failureCallback, ExceptionCode&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmAES_KWcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -38,6 +38,11 @@
</span><span class="cx"> 
</span><span class="cx"> const char* const CryptoAlgorithmAES_KW::s_name = &quot;AES-KW&quot;;
</span><span class="cx"> 
</span><ins>+static inline bool usagesAreInvalidForCryptoAlgorithmAES_KW(CryptoKeyUsage usages)
+{
+    return usages &amp; (CryptoKeyUsageSign | CryptoKeyUsageVerify | CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits | CryptoKeyUsageEncrypt | CryptoKeyUsageDecrypt);
+}
+
</ins><span class="cx"> CryptoAlgorithmAES_KW::CryptoAlgorithmAES_KW()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -69,7 +74,7 @@
</span><span class="cx"> {
</span><span class="cx">     const auto&amp; aesParameters = downcast&lt;CryptoAlgorithmAesKeyGenParams&gt;(*parameters);
</span><span class="cx"> 
</span><del>-    if (usages &amp; (CryptoKeyUsageSign | CryptoKeyUsageVerify | CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits | CryptoKeyUsageEncrypt | CryptoKeyUsageDecrypt)) {
</del><ins>+    if (usagesAreInvalidForCryptoAlgorithmAES_KW(usages)) {
</ins><span class="cx">         exceptionCallback(SYNTAX_ERR);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -83,6 +88,45 @@
</span><span class="cx">     callback(result.get(), nullptr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CryptoAlgorithmAES_KW::importKey(SubtleCrypto::KeyFormat format, KeyData&amp;&amp; data, const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp; parameters, bool extractable, CryptoKeyUsage usages, KeyCallback&amp;&amp; callback, ExceptionCallback&amp;&amp; exceptionCallback)
+{
+    if (usagesAreInvalidForCryptoAlgorithmAES_KW(usages)) {
+        exceptionCallback(SYNTAX_ERR);
+        return;
+    }
+
+    RefPtr&lt;CryptoKeyAES&gt; result;
+    switch (format) {
+    case SubtleCrypto::KeyFormat::Raw:
+        result = CryptoKeyAES::importRaw(parameters-&gt;identifier, WTFMove(WTF::get&lt;Vector&lt;uint8_t&gt;&gt;(data)), extractable, usages);
+        break;
+    case SubtleCrypto::KeyFormat::Jwk: {
+        auto checkAlgCallback = [](size_t length, const Optional&lt;String&gt;&amp; alg) -&gt; bool {
+            switch (length) {
+            case CryptoKeyAES::s_length128:
+                return !alg || alg.value() == &quot;A128KW&quot;;
+            case CryptoKeyAES::s_length192:
+                return !alg || alg.value() == &quot;A192KW&quot;;
+            case CryptoKeyAES::s_length256:
+                return !alg || alg.value() == &quot;A256KW&quot;;
+            }
+            return false;
+        };
+        result = CryptoKeyAES::importJwk(parameters-&gt;identifier, WTFMove(WTF::get&lt;JsonWebKey&gt;(data)), extractable, usages, WTFMove(checkAlgCallback));
+        break;
+    }
+    default:
+        exceptionCallback(NOT_SUPPORTED_ERR);
+        return;
+    }
+    if (!result) {
+        exceptionCallback(DataError);
+        return;
+    }
+
+    callback(*result);
+}
+
</ins><span class="cx"> void CryptoAlgorithmAES_KW::encryptForWrapKey(const CryptoAlgorithmParametersDeprecated&amp;, const CryptoKey&amp; key, const CryptoOperationData&amp; data, VectorCallback&amp;&amp; callback, VoidCallback&amp;&amp; failureCallback, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (!keyAlgorithmMatches(key)) {
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmAES_KWh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.h (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.h        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx">     CryptoAlgorithmIdentifier identifier() const override;
</span><span class="cx"> 
</span><span class="cx">     void generateKey(const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&amp;&amp;, ExceptionCallback&amp;&amp;, ScriptExecutionContext*) final;
</span><ins>+    void importKey(SubtleCrypto::KeyFormat, KeyData&amp;&amp;, const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool extractable, CryptoKeyUsage, KeyCallback&amp;&amp;, ExceptionCallback&amp;&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     // The following will be deprecated.
</span><span class="cx">     void encryptForWrapKey(const CryptoAlgorithmParametersDeprecated&amp;, const CryptoKey&amp;, const CryptoOperationData&amp;, VectorCallback&amp;&amp;, VoidCallback&amp;&amp; failureCallback, ExceptionCode&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmHMACcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><span class="cx"> 
</span><del>-#include &quot;CryptoAlgorithmHmacKeyGenParams.h&quot;
</del><ins>+#include &quot;CryptoAlgorithmHmacKeyParams.h&quot;
</ins><span class="cx"> #include &quot;CryptoAlgorithmHmacKeyParamsDeprecated.h&quot;
</span><span class="cx"> #include &quot;CryptoAlgorithmHmacParamsDeprecated.h&quot;
</span><span class="cx"> #include &quot;CryptoKeyDataOctetSequence.h&quot;
</span><span class="lines">@@ -39,6 +39,11 @@
</span><span class="cx"> 
</span><span class="cx"> const char* const CryptoAlgorithmHMAC::s_name = &quot;HMAC&quot;;
</span><span class="cx"> 
</span><ins>+static inline bool usagesAreInvalidForCryptoAlgorithmHMAC(CryptoKeyUsage usages)
+{
+    return usages &amp; (CryptoKeyUsageEncrypt | CryptoKeyUsageDecrypt | CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits | CryptoKeyUsageWrapKey | CryptoKeyUsageUnwrapKey);
+}
+
</ins><span class="cx"> CryptoAlgorithmHMAC::CryptoAlgorithmHMAC()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -70,9 +75,9 @@
</span><span class="cx"> 
</span><span class="cx"> void CryptoAlgorithmHMAC::generateKey(const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp; parameters, bool extractable, CryptoKeyUsage usages, KeyOrKeyPairCallback&amp;&amp; callback, ExceptionCallback&amp;&amp; exceptionCallback, ScriptExecutionContext*)
</span><span class="cx"> {
</span><del>-    const auto&amp; hmacParameters = downcast&lt;CryptoAlgorithmHmacKeyGenParams&gt;(*parameters);
</del><ins>+    const auto&amp; hmacParameters = downcast&lt;CryptoAlgorithmHmacKeyParams&gt;(*parameters);
</ins><span class="cx"> 
</span><del>-    if (usages &amp; (CryptoKeyUsageEncrypt | CryptoKeyUsageDecrypt | CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits | CryptoKeyUsageWrapKey | CryptoKeyUsageUnwrapKey)) {
</del><ins>+    if (usagesAreInvalidForCryptoAlgorithmHMAC(usages)) {
</ins><span class="cx">         exceptionCallback(SYNTAX_ERR);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -91,6 +96,53 @@
</span><span class="cx">     callback(result.get(), nullptr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CryptoAlgorithmHMAC::importKey(SubtleCrypto::KeyFormat format, KeyData&amp;&amp; data, const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp; parameters, bool extractable, CryptoKeyUsage usages, KeyCallback&amp;&amp; callback, ExceptionCallback&amp;&amp; exceptionCallback)
+{
+    const auto&amp; hmacParameters = downcast&lt;CryptoAlgorithmHmacKeyParams&gt;(*parameters);
+
+    if (usagesAreInvalidForCryptoAlgorithmHMAC(usages)) {
+        exceptionCallback(SYNTAX_ERR);
+        return;
+    }
+
+    RefPtr&lt;CryptoKeyHMAC&gt; result;
+    switch (format) {
+    case SubtleCrypto::KeyFormat::Raw:
+        result = CryptoKeyHMAC::importRaw(hmacParameters.length.valueOr(0), hmacParameters.hashIdentifier, WTFMove(WTF::get&lt;Vector&lt;uint8_t&gt;&gt;(data)), extractable, usages);
+        break;
+    case SubtleCrypto::KeyFormat::Jwk: {
+        auto checkAlgCallback = [](CryptoAlgorithmIdentifier hash, const Optional&lt;String&gt;&amp; alg) -&gt; bool {
+            switch (hash) {
+            case CryptoAlgorithmIdentifier::SHA_1:
+                return !alg || alg.value() == &quot;HS1&quot;;
+            case CryptoAlgorithmIdentifier::SHA_224:
+                return !alg || alg.value() == &quot;HS224&quot;;
+            case CryptoAlgorithmIdentifier::SHA_256:
+                return !alg || alg.value() == &quot;HS256&quot;;
+            case CryptoAlgorithmIdentifier::SHA_384:
+                return !alg || alg.value() == &quot;HS384&quot;;
+            case CryptoAlgorithmIdentifier::SHA_512:
+                return !alg || alg.value() == &quot;HS512&quot;;
+            default:
+                return false;
+            }
+            return false;
+        };
+        result = CryptoKeyHMAC::importJwk(hmacParameters.length.valueOr(0), hmacParameters.hashIdentifier, WTFMove(WTF::get&lt;JsonWebKey&gt;(data)), extractable, usages, WTFMove(checkAlgCallback));
+        break;
+    }
+    default:
+        exceptionCallback(NOT_SUPPORTED_ERR);
+        return;
+    }
+    if (!result) {
+        exceptionCallback(DataError);
+        return;
+    }
+
+    callback(*result);
+}
+
</ins><span class="cx"> void CryptoAlgorithmHMAC::sign(const CryptoAlgorithmParametersDeprecated&amp; parameters, const CryptoKey&amp; key, const CryptoOperationData&amp; data, VectorCallback&amp;&amp; callback, VoidCallback&amp;&amp; failureCallback, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     const CryptoAlgorithmHmacParamsDeprecated&amp; hmacParameters = downcast&lt;CryptoAlgorithmHmacParamsDeprecated&gt;(parameters);
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmHMACh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.h (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.h        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     CryptoAlgorithmIdentifier identifier() const override;
</span><span class="cx"> 
</span><span class="cx">     void generateKey(const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&amp;&amp;, ExceptionCallback&amp;&amp;, ScriptExecutionContext*) final;
</span><ins>+    void importKey(SubtleCrypto::KeyFormat, KeyData&amp;&amp;, const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool extractable, CryptoKeyUsage, KeyCallback&amp;&amp;, ExceptionCallback&amp;&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     // The following will be deprecated.
</span><span class="cx">     void sign(const CryptoAlgorithmParametersDeprecated&amp;, const CryptoKey&amp;, const CryptoOperationData&amp;, VectorCallback&amp;&amp;, VoidCallback&amp;&amp; failureCallback, ExceptionCode&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSAES_PKCS1_v1_5cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -88,6 +88,39 @@
</span><span class="cx">     CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5, CryptoAlgorithmIdentifier::SHA_1, false, rsaParameters.modulusLength, rsaParameters.publicExponentVector(), extractable, usages, WTFMove(keyPairCallback), WTFMove(failureCallback), context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CryptoAlgorithmRSAES_PKCS1_v1_5::importKey(SubtleCrypto::KeyFormat format, KeyData&amp;&amp; data, const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp; parameters, bool extractable, CryptoKeyUsage usages, KeyCallback&amp;&amp; callback, ExceptionCallback&amp;&amp; exceptionCallback)
+{
+    RefPtr&lt;CryptoKeyRSA&gt; result;
+    switch (format) {
+    case SubtleCrypto::KeyFormat::Jwk: {
+        JsonWebKey key = WTFMove(WTF::get&lt;JsonWebKey&gt;(data));
+        if ((key.d &amp;&amp; (usages ^ CryptoKeyUsageDecrypt)) || (!key.d &amp;&amp; (usages ^ CryptoKeyUsageEncrypt))) {
+            exceptionCallback(SYNTAX_ERR);
+            return;
+        }
+        if (usages &amp;&amp; key.use &amp;&amp; key.use.value() != &quot;enc&quot;) {
+            exceptionCallback(DataError);
+            return;
+        }
+        if (key.alg &amp;&amp; key.alg.value() != &quot;RSA1_5&quot;) {
+            exceptionCallback(DataError);
+            return;
+        }
+        result = CryptoKeyRSA::importJwk(parameters-&gt;identifier, Nullopt, WTFMove(key), extractable, usages);
+        break;
+    }
+    default:
+        exceptionCallback(NOT_SUPPORTED_ERR);
+        return;
+    }
+    if (!result) {
+        exceptionCallback(DataError);
+        return;
+    }
+
+    callback(*result);
+}
+
</ins><span class="cx"> void CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt(const CryptoAlgorithmParametersDeprecated&amp;, const CryptoKey&amp; key, const CryptoOperationData&amp; data, VectorCallback&amp;&amp; callback, VoidCallback&amp;&amp; failureCallback, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (!keyAlgorithmMatches(key)) {
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSAES_PKCS1_v1_5h"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     CryptoAlgorithmIdentifier identifier() const override;
</span><span class="cx"> 
</span><span class="cx">     void generateKey(const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&amp;&amp;, ExceptionCallback&amp;&amp;, ScriptExecutionContext*) final;
</span><ins>+    void importKey(SubtleCrypto::KeyFormat, KeyData&amp;&amp;, const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool extractable, CryptoKeyUsage, KeyCallback&amp;&amp;, ExceptionCallback&amp;&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     // The following will be deprecated.
</span><span class="cx">     void encrypt(const CryptoAlgorithmParametersDeprecated&amp;, const CryptoKey&amp;, const CryptoOperationData&amp;, VectorCallback&amp;&amp;, VoidCallback&amp;&amp; failureCallback, ExceptionCode&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSASSA_PKCS1_v1_5cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><span class="cx"> 
</span><ins>+#include &quot;CryptoAlgorithmRsaHashedImportParams.h&quot;
</ins><span class="cx"> #include &quot;CryptoAlgorithmRsaHashedKeyGenParams.h&quot;
</span><span class="cx"> #include &quot;CryptoAlgorithmRsaKeyGenParamsDeprecated.h&quot;
</span><span class="cx"> #include &quot;CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h&quot;
</span><span class="lines">@@ -91,6 +92,64 @@
</span><span class="cx">     CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5, rsaParameters.hashIdentifier, true, rsaParameters.modulusLength, rsaParameters.publicExponentVector(), extractable, usages, WTFMove(keyPairCallback), WTFMove(failureCallback), context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey(SubtleCrypto::KeyFormat format, KeyData&amp;&amp; data, const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp; parameters, bool extractable, CryptoKeyUsage usages, KeyCallback&amp;&amp; callback, ExceptionCallback&amp;&amp; exceptionCallback)
+{
+    const auto&amp; rsaParameters = downcast&lt;CryptoAlgorithmRsaHashedImportParams&gt;(*parameters);
+
+    RefPtr&lt;CryptoKeyRSA&gt; result;
+    switch (format) {
+    case SubtleCrypto::KeyFormat::Jwk: {
+        JsonWebKey key = WTFMove(WTF::get&lt;JsonWebKey&gt;(data));
+
+        if ((key.d &amp;&amp; (usages ^ CryptoKeyUsageSign)) || (!key.d &amp;&amp; (usages ^ CryptoKeyUsageVerify))) {
+            exceptionCallback(SYNTAX_ERR);
+            return;
+        }
+        if (usages &amp;&amp; key.use &amp;&amp; key.use.value() != &quot;sig&quot;) {
+            exceptionCallback(DataError);
+            return;
+        }
+
+        bool isMatched = false;
+        switch (rsaParameters.hashIdentifier) {
+        case CryptoAlgorithmIdentifier::SHA_1:
+            isMatched = !key.alg || key.alg.value() == &quot;RS1&quot;;
+            break;
+        case CryptoAlgorithmIdentifier::SHA_224:
+            isMatched = !key.alg || key.alg.value() == &quot;RS224&quot;;
+            break;
+        case CryptoAlgorithmIdentifier::SHA_256:
+            isMatched = !key.alg || key.alg.value() == &quot;RS256&quot;;
+            break;
+        case CryptoAlgorithmIdentifier::SHA_384:
+            isMatched = !key.alg || key.alg.value() == &quot;RS384&quot;;
+            break;
+        case CryptoAlgorithmIdentifier::SHA_512:
+            isMatched = !key.alg || key.alg.value() == &quot;RS512&quot;;
+            break;
+        default:
+            break;
+        }
+        if (!isMatched) {
+            exceptionCallback(DataError);
+            return;
+        }
+
+        result = CryptoKeyRSA::importJwk(rsaParameters.identifier, rsaParameters.hashIdentifier, WTFMove(key), extractable, usages);
+        break;
+    }
+    default:
+        exceptionCallback(NOT_SUPPORTED_ERR);
+        return;
+    }
+    if (!result) {
+        exceptionCallback(DataError);
+        return;
+    }
+
+    callback(*result);
+}
+
</ins><span class="cx"> void CryptoAlgorithmRSASSA_PKCS1_v1_5::sign(const CryptoAlgorithmParametersDeprecated&amp; parameters, const CryptoKey&amp; key, const CryptoOperationData&amp; data, VectorCallback&amp;&amp; callback, VoidCallback&amp;&amp; failureCallback, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     const CryptoAlgorithmRsaSsaParamsDeprecated&amp; rsaSSAParameters = downcast&lt;CryptoAlgorithmRsaSsaParamsDeprecated&gt;(parameters);
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSASSA_PKCS1_v1_5h"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     CryptoAlgorithmIdentifier identifier() const override;
</span><span class="cx"> 
</span><span class="cx">     void generateKey(const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&amp;&amp;, ExceptionCallback&amp;&amp;, ScriptExecutionContext*) final;
</span><ins>+    void importKey(SubtleCrypto::KeyFormat, KeyData&amp;&amp;, const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool extractable, CryptoKeyUsage, KeyCallback&amp;&amp;, ExceptionCallback&amp;&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     // The following will be deprecated.
</span><span class="cx">     void sign(const CryptoAlgorithmParametersDeprecated&amp;, const CryptoKey&amp;, const CryptoOperationData&amp;, VectorCallback&amp;&amp;, VoidCallback&amp;&amp; failureCallback, ExceptionCode&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSA_OAEPcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><span class="cx"> 
</span><ins>+#include &quot;CryptoAlgorithmRsaHashedImportParams.h&quot;
</ins><span class="cx"> #include &quot;CryptoAlgorithmRsaHashedKeyGenParams.h&quot;
</span><span class="cx"> #include &quot;CryptoAlgorithmRsaKeyGenParamsDeprecated.h&quot;
</span><span class="cx"> #include &quot;CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h&quot;
</span><span class="lines">@@ -91,6 +92,75 @@
</span><span class="cx">     CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSA_OAEP, rsaParameters.hashIdentifier, true, rsaParameters.modulusLength, rsaParameters.publicExponentVector(), extractable, usages, WTFMove(keyPairCallback), WTFMove(failureCallback), context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CryptoAlgorithmRSA_OAEP::importKey(SubtleCrypto::KeyFormat format, KeyData&amp;&amp; data, const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp; parameters, bool extractable, CryptoKeyUsage usages, KeyCallback&amp;&amp; callback, ExceptionCallback&amp;&amp; exceptionCallback)
+{
+    const auto&amp; rsaParameters = downcast&lt;CryptoAlgorithmRsaHashedImportParams&gt;(*parameters);
+
+    RefPtr&lt;CryptoKeyRSA&gt; result;
+    switch (format) {
+    case SubtleCrypto::KeyFormat::Jwk: {
+        JsonWebKey key = WTFMove(WTF::get&lt;JsonWebKey&gt;(data));
+
+        bool isUsagesAllowed = false;
+        if (key.d) {
+            isUsagesAllowed = isUsagesAllowed || !(usages ^ CryptoKeyUsageDecrypt);
+            isUsagesAllowed = isUsagesAllowed || !(usages ^ CryptoKeyUsageUnwrapKey);
+            isUsagesAllowed = isUsagesAllowed || !(usages ^ (CryptoKeyUsageDecrypt | CryptoKeyUsageUnwrapKey));
+        } else {
+            isUsagesAllowed = isUsagesAllowed || !(usages ^ CryptoKeyUsageEncrypt);
+            isUsagesAllowed = isUsagesAllowed || !(usages ^ CryptoKeyUsageWrapKey);
+            isUsagesAllowed = isUsagesAllowed || !(usages ^ (CryptoKeyUsageEncrypt | CryptoKeyUsageWrapKey));
+        }
+        if (!isUsagesAllowed) {
+            exceptionCallback(SYNTAX_ERR);
+            return;
+        }
+
+        if (usages &amp;&amp; key.use &amp;&amp; key.use.value() != &quot;enc&quot;) {
+            exceptionCallback(DataError);
+            return;
+        }
+
+        bool isMatched = false;
+        switch (rsaParameters.hashIdentifier) {
+        case CryptoAlgorithmIdentifier::SHA_1:
+            isMatched = !key.alg || key.alg.value() == &quot;RSA-OAEP&quot;;
+            break;
+        case CryptoAlgorithmIdentifier::SHA_224:
+            isMatched = !key.alg || key.alg.value() == &quot;RSA-OAEP-224&quot;;
+            break;
+        case CryptoAlgorithmIdentifier::SHA_256:
+            isMatched = !key.alg || key.alg.value() == &quot;RSA-OAEP-256&quot;;
+            break;
+        case CryptoAlgorithmIdentifier::SHA_384:
+            isMatched = !key.alg || key.alg.value() == &quot;RSA-OAEP-384&quot;;
+            break;
+        case CryptoAlgorithmIdentifier::SHA_512:
+            isMatched = !key.alg || key.alg.value() == &quot;RSA-OAEP-512&quot;;
+            break;
+        default:
+            break;
+        }
+        if (!isMatched) {
+            exceptionCallback(DataError);
+            return;
+        }
+
+        result = CryptoKeyRSA::importJwk(rsaParameters.identifier, rsaParameters.hashIdentifier, WTFMove(key), extractable, usages);
+        break;
+    }
+    default:
+        exceptionCallback(NOT_SUPPORTED_ERR);
+        return;
+    }
+    if (!result) {
+        exceptionCallback(DataError);
+        return;
+    }
+
+    callback(*result);
+}
+
</ins><span class="cx"> void CryptoAlgorithmRSA_OAEP::encrypt(const CryptoAlgorithmParametersDeprecated&amp; parameters, const CryptoKey&amp; key, const CryptoOperationData&amp; data, VectorCallback&amp;&amp; callback, VoidCallback&amp;&amp; failureCallback, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     const CryptoAlgorithmRsaOaepParamsDeprecated&amp; rsaOAEPParameters = downcast&lt;CryptoAlgorithmRsaOaepParamsDeprecated&gt;(parameters);
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoalgorithmsCryptoAlgorithmRSA_OAEPh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.h (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.h        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     CryptoAlgorithmIdentifier identifier() const override;
</span><span class="cx"> 
</span><span class="cx">     void generateKey(const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool extractable, CryptoKeyUsage, KeyOrKeyPairCallback&amp;&amp;, ExceptionCallback&amp;&amp;, ScriptExecutionContext*) final;
</span><ins>+    void importKey(SubtleCrypto::KeyFormat, KeyData&amp;&amp;, const std::unique_ptr&lt;CryptoAlgorithmParameters&gt;&amp;&amp;, bool extractable, CryptoKeyUsage, KeyCallback&amp;&amp;, ExceptionCallback&amp;&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     // The following will be deprecated.
</span><span class="cx">     void encrypt(const CryptoAlgorithmParametersDeprecated&amp;, const CryptoKey&amp;, const CryptoOperationData&amp;, VectorCallback&amp;&amp;, VoidCallback&amp;&amp; failureCallback, ExceptionCode&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCorecryptokeysCryptoKeyAEScpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/keys/CryptoKeyAES.cpp (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/keys/CryptoKeyAES.cpp        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/keys/CryptoKeyAES.cpp        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -30,10 +30,17 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CryptoAlgorithmRegistry.h&quot;
</span><span class="cx"> #include &quot;CryptoKeyDataOctetSequence.h&quot;
</span><ins>+#include &quot;JsonWebKey.h&quot;
+#include &lt;wtf/text/Base64.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+static inline bool lengthIsValid(size_t length)
+{
+    return (length == CryptoKeyAES::s_length128) || (length == CryptoKeyAES::s_length192) || (length == CryptoKeyAES::s_length256);
+}
+
</ins><span class="cx"> CryptoKeyAES::CryptoKeyAES(CryptoAlgorithmIdentifier algorithm, const Vector&lt;uint8_t&gt;&amp; key, bool extractable, CryptoKeyUsage usage)
</span><span class="cx">     : CryptoKey(algorithm, CryptoKeyType::Secret, extractable, usage)
</span><span class="cx">     , m_key(key)
</span><span class="lines">@@ -41,6 +48,13 @@
</span><span class="cx">     ASSERT(isValidAESAlgorithm(algorithm));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+CryptoKeyAES::CryptoKeyAES(CryptoAlgorithmIdentifier algorithm, Vector&lt;uint8_t&gt;&amp;&amp; key, bool extractable, CryptoKeyUsage usage)
+    : CryptoKey(algorithm, CryptoKeyType::Secret, extractable, usage)
+    , m_key(WTFMove(key))
+{
+    ASSERT(isValidAESAlgorithm(algorithm));
+}
+
</ins><span class="cx"> CryptoKeyAES::~CryptoKeyAES()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -57,11 +71,39 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CryptoKeyAES&gt; CryptoKeyAES::generate(CryptoAlgorithmIdentifier algorithm, size_t lengthBits, bool extractable, CryptoKeyUsage usages)
</span><span class="cx"> {
</span><del>-    if ((lengthBits != 128) &amp;&amp; (lengthBits != 192) &amp;&amp; (lengthBits != 256))
</del><ins>+    if (!lengthIsValid(lengthBits))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     return adoptRef(new CryptoKeyAES(algorithm, randomData(lengthBits / 8), extractable, usages));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr&lt;CryptoKeyAES&gt; CryptoKeyAES::importRaw(CryptoAlgorithmIdentifier algorithm, Vector&lt;uint8_t&gt;&amp;&amp; keyData, bool extractable, CryptoKeyUsage usages)
+{
+    if (!lengthIsValid(keyData.size() * 8))
+        return nullptr;
+    return adoptRef(new CryptoKeyAES(algorithm, WTFMove(keyData), extractable, usages));
+}
+
+RefPtr&lt;CryptoKeyAES&gt; CryptoKeyAES::importJwk(CryptoAlgorithmIdentifier algorithm, JsonWebKey&amp;&amp; keyData, bool extractable, CryptoKeyUsage usages, CheckAlgCallback&amp;&amp; callback)
+{
+    if (keyData.kty != &quot;oct&quot;)
+        return nullptr;
+    if (!keyData.k)
+        return nullptr;
+    Vector&lt;uint8_t&gt; octetSequence;
+    if (!base64URLDecode(keyData.k.value(), octetSequence))
+        return nullptr;
+    if (!callback(octetSequence.size() * 8, keyData.alg))
+        return nullptr;
+    if (usages &amp;&amp; keyData.use &amp;&amp; keyData.use.value() != &quot;enc&quot;)
+        return nullptr;
+    if (keyData.usages &amp;&amp; ((keyData.usages &amp; usages) != usages))
+        return nullptr;
+    if (keyData.ext &amp;&amp; !keyData.ext.value() &amp;&amp; extractable)
+        return nullptr;
+
+    return adoptRef(new CryptoKeyAES(algorithm, WTFMove(octetSequence), extractable, usages));
+}
+
</ins><span class="cx"> std::unique_ptr&lt;KeyAlgorithm&gt; CryptoKeyAES::buildAlgorithm() const
</span><span class="cx"> {
</span><span class="cx">     return std::make_unique&lt;AesKeyAlgorithm&gt;(CryptoAlgorithmRegistry::singleton().nameForIdentifier(algorithmIdentifier()), m_key.size() * 8);
</span></span></pre></div>
<a id="trunkSourceWebCorecryptokeysCryptoKeyAESh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/keys/CryptoKeyAES.h (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/keys/CryptoKeyAES.h        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/keys/CryptoKeyAES.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CryptoAlgorithmIdentifier.h&quot;
</span><span class="cx"> #include &quot;CryptoKey.h&quot;
</span><ins>+#include &lt;wtf/Function.h&gt;
</ins><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><span class="lines">@@ -34,6 +35,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+struct JsonWebKey;
+
</ins><span class="cx"> class AesKeyAlgorithm final : public KeyAlgorithm {
</span><span class="cx"> public:
</span><span class="cx">     AesKeyAlgorithm(const String&amp; name, size_t length)
</span><span class="lines">@@ -52,6 +55,10 @@
</span><span class="cx"> 
</span><span class="cx"> class CryptoKeyAES final : public CryptoKey {
</span><span class="cx"> public:
</span><ins>+    static const int s_length128 = 128;
+    static const int s_length192 = 192;
+    static const int s_length256 = 256;
+
</ins><span class="cx">     static Ref&lt;CryptoKeyAES&gt; create(CryptoAlgorithmIdentifier algorithm, const Vector&lt;uint8_t&gt;&amp; key, bool extractable, CryptoKeyUsage usage)
</span><span class="cx">     {
</span><span class="cx">         return adoptRef(*new CryptoKeyAES(algorithm, key, extractable, usage));
</span><span class="lines">@@ -61,6 +68,9 @@
</span><span class="cx">     static bool isValidAESAlgorithm(CryptoAlgorithmIdentifier);
</span><span class="cx"> 
</span><span class="cx">     static RefPtr&lt;CryptoKeyAES&gt; generate(CryptoAlgorithmIdentifier, size_t lengthBits, bool extractable, CryptoKeyUsage);
</span><ins>+    static RefPtr&lt;CryptoKeyAES&gt; importRaw(CryptoAlgorithmIdentifier, Vector&lt;uint8_t&gt;&amp;&amp; keyData, bool extractable, CryptoKeyUsage);
+    using CheckAlgCallback = WTF::Function&lt;bool(size_t, const Optional&lt;String&gt;&amp;)&gt;;
+    static RefPtr&lt;CryptoKeyAES&gt; importJwk(CryptoAlgorithmIdentifier, JsonWebKey&amp;&amp;, bool extractable, CryptoKeyUsage, CheckAlgCallback&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     CryptoKeyClass keyClass() const final { return CryptoKeyClass::AES; }
</span><span class="cx"> 
</span><span class="lines">@@ -68,6 +78,7 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     CryptoKeyAES(CryptoAlgorithmIdentifier, const Vector&lt;uint8_t&gt;&amp; key, bool extractable, CryptoKeyUsage);
</span><ins>+    CryptoKeyAES(CryptoAlgorithmIdentifier, Vector&lt;uint8_t&gt;&amp;&amp; key, bool extractable, CryptoKeyUsage);
</ins><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;KeyAlgorithm&gt; buildAlgorithm() const final;
</span><span class="cx">     std::unique_ptr&lt;CryptoKeyData&gt; exportData() const final;
</span></span></pre></div>
<a id="trunkSourceWebCorecryptokeysCryptoKeyDataRSAComponentscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/keys/CryptoKeyDataRSAComponents.cpp (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/keys/CryptoKeyDataRSAComponents.cpp        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/keys/CryptoKeyDataRSAComponents.cpp        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -38,6 +38,14 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents(Vector&lt;uint8_t&gt;&amp;&amp; modulus, Vector&lt;uint8_t&gt;&amp;&amp; exponent)
+    : CryptoKeyData(CryptoKeyData::Format::RSAComponents)
+    , m_type(Type::Public)
+    , m_modulus(WTFMove(modulus))
+    , m_exponent(WTFMove(exponent))
+{
+}
+
</ins><span class="cx"> CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents(const Vector&lt;uint8_t&gt;&amp; modulus, const Vector&lt;uint8_t&gt;&amp; exponent, const Vector&lt;uint8_t&gt;&amp; privateExponent)
</span><span class="cx">     : CryptoKeyData(CryptoKeyData::Format::RSAComponents)
</span><span class="cx">     , m_type(Type::Private)
</span><span class="lines">@@ -48,6 +56,16 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents(Vector&lt;uint8_t&gt;&amp;&amp; modulus, Vector&lt;uint8_t&gt;&amp;&amp; exponent, Vector&lt;uint8_t&gt;&amp;&amp; privateExponent)
+    : CryptoKeyData(CryptoKeyData::Format::RSAComponents)
+    , m_type(Type::Private)
+    , m_modulus(WTFMove(modulus))
+    , m_exponent(WTFMove(exponent))
+    , m_privateExponent(WTFMove(privateExponent))
+    , m_hasAdditionalPrivateKeyParameters(false)
+{
+}
+
</ins><span class="cx"> CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents(const Vector&lt;uint8_t&gt;&amp; modulus, const Vector&lt;uint8_t&gt;&amp; exponent, const Vector&lt;uint8_t&gt;&amp; privateExponent, const PrimeInfo&amp; firstPrimeInfo, const PrimeInfo&amp; secondPrimeInfo, const Vector&lt;PrimeInfo&gt;&amp; otherPrimeInfos)
</span><span class="cx">     : CryptoKeyData(CryptoKeyData::Format::RSAComponents)
</span><span class="cx">     , m_type(Type::Private)
</span><span class="lines">@@ -61,6 +79,19 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents(Vector&lt;uint8_t&gt;&amp;&amp; modulus, Vector&lt;uint8_t&gt;&amp;&amp; exponent, Vector&lt;uint8_t&gt;&amp;&amp; privateExponent, PrimeInfo&amp;&amp; firstPrimeInfo, PrimeInfo&amp;&amp; secondPrimeInfo, Vector&lt;PrimeInfo&gt;&amp;&amp; otherPrimeInfos)
+    : CryptoKeyData(CryptoKeyData::Format::RSAComponents)
+    , m_type(Type::Private)
+    , m_modulus(WTFMove(modulus))
+    , m_exponent(WTFMove(exponent))
+    , m_privateExponent(WTFMove(privateExponent))
+    , m_hasAdditionalPrivateKeyParameters(true)
+    , m_firstPrimeInfo(WTFMove(firstPrimeInfo))
+    , m_secondPrimeInfo(WTFMove(secondPrimeInfo))
+    , m_otherPrimeInfos(WTFMove(otherPrimeInfos))
+{
+}
+
</ins><span class="cx"> CryptoKeyDataRSAComponents::~CryptoKeyDataRSAComponents()
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecryptokeysCryptoKeyDataRSAComponentsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/keys/CryptoKeyDataRSAComponents.h (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/keys/CryptoKeyDataRSAComponents.h        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/keys/CryptoKeyDataRSAComponents.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -50,16 +50,28 @@
</span><span class="cx">     {
</span><span class="cx">         return std::unique_ptr&lt;CryptoKeyDataRSAComponents&gt;(new CryptoKeyDataRSAComponents(modulus, exponent));
</span><span class="cx">     }
</span><ins>+    static std::unique_ptr&lt;CryptoKeyDataRSAComponents&gt; createPublic(Vector&lt;uint8_t&gt;&amp;&amp; modulus, Vector&lt;uint8_t&gt;&amp;&amp; exponent)
+    {
+        return std::unique_ptr&lt;CryptoKeyDataRSAComponents&gt;(new CryptoKeyDataRSAComponents(WTFMove(modulus), WTFMove(exponent)));
+    }
</ins><span class="cx"> 
</span><span class="cx">     static std::unique_ptr&lt;CryptoKeyDataRSAComponents&gt; createPrivate(const Vector&lt;uint8_t&gt;&amp; modulus, const Vector&lt;uint8_t&gt;&amp; exponent, const Vector&lt;uint8_t&gt;&amp; privateExponent)
</span><span class="cx">     {
</span><span class="cx">         return std::unique_ptr&lt;CryptoKeyDataRSAComponents&gt;(new CryptoKeyDataRSAComponents(modulus, exponent, privateExponent));
</span><span class="cx">     }
</span><ins>+    static std::unique_ptr&lt;CryptoKeyDataRSAComponents&gt; createPrivate(Vector&lt;uint8_t&gt;&amp;&amp; modulus, Vector&lt;uint8_t&gt;&amp;&amp; exponent, Vector&lt;uint8_t&gt;&amp;&amp; privateExponent)
+    {
+        return std::unique_ptr&lt;CryptoKeyDataRSAComponents&gt;(new CryptoKeyDataRSAComponents(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent)));
+    }
</ins><span class="cx"> 
</span><span class="cx">     static std::unique_ptr&lt;CryptoKeyDataRSAComponents&gt; createPrivateWithAdditionalData(const Vector&lt;uint8_t&gt;&amp; modulus, const Vector&lt;uint8_t&gt;&amp; exponent, const Vector&lt;uint8_t&gt;&amp; privateExponent, const PrimeInfo&amp; firstPrimeInfo, const PrimeInfo&amp; secondPrimeInfo, const Vector&lt;PrimeInfo&gt;&amp; otherPrimeInfos)
</span><span class="cx">     {
</span><span class="cx">         return std::unique_ptr&lt;CryptoKeyDataRSAComponents&gt;(new CryptoKeyDataRSAComponents(modulus, exponent, privateExponent, firstPrimeInfo, secondPrimeInfo, otherPrimeInfos));
</span><span class="cx">     }
</span><ins>+    static std::unique_ptr&lt;CryptoKeyDataRSAComponents&gt; createPrivateWithAdditionalData(Vector&lt;uint8_t&gt;&amp;&amp; modulus, Vector&lt;uint8_t&gt;&amp;&amp; exponent, Vector&lt;uint8_t&gt;&amp;&amp; privateExponent, PrimeInfo&amp;&amp; firstPrimeInfo, PrimeInfo&amp;&amp; secondPrimeInfo, Vector&lt;PrimeInfo&gt;&amp;&amp; otherPrimeInfos)
+    {
+        return std::unique_ptr&lt;CryptoKeyDataRSAComponents&gt;(new CryptoKeyDataRSAComponents(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent), WTFMove(firstPrimeInfo), WTFMove(secondPrimeInfo), WTFMove(otherPrimeInfos)));
+    }
</ins><span class="cx"> 
</span><span class="cx">     virtual ~CryptoKeyDataRSAComponents();
</span><span class="cx"> 
</span><span class="lines">@@ -78,8 +90,13 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     CryptoKeyDataRSAComponents(const Vector&lt;uint8_t&gt;&amp; modulus, const Vector&lt;uint8_t&gt;&amp; exponent);
</span><ins>+    CryptoKeyDataRSAComponents(Vector&lt;uint8_t&gt;&amp;&amp; modulus, Vector&lt;uint8_t&gt;&amp;&amp; exponent);
+
</ins><span class="cx">     CryptoKeyDataRSAComponents(const Vector&lt;uint8_t&gt;&amp; modulus, const Vector&lt;uint8_t&gt;&amp; exponent, const Vector&lt;uint8_t&gt;&amp; privateExponent);
</span><ins>+    CryptoKeyDataRSAComponents(Vector&lt;uint8_t&gt;&amp;&amp; modulus, Vector&lt;uint8_t&gt;&amp;&amp; exponent, Vector&lt;uint8_t&gt;&amp;&amp; privateExponent);
+
</ins><span class="cx">     CryptoKeyDataRSAComponents(const Vector&lt;uint8_t&gt;&amp; modulus, const Vector&lt;uint8_t&gt;&amp; exponent, const Vector&lt;uint8_t&gt;&amp; privateExponent, const PrimeInfo&amp; firstPrimeInfo, const PrimeInfo&amp; secondPrimeInfo, const Vector&lt;PrimeInfo&gt;&amp; otherPrimeInfos);
</span><ins>+    CryptoKeyDataRSAComponents(Vector&lt;uint8_t&gt;&amp;&amp; modulus, Vector&lt;uint8_t&gt;&amp;&amp; exponent, Vector&lt;uint8_t&gt;&amp;&amp; privateExponent, PrimeInfo&amp;&amp; firstPrimeInfo, PrimeInfo&amp;&amp; secondPrimeInfo, Vector&lt;PrimeInfo&gt;&amp;&amp; otherPrimeInfos);
</ins><span class="cx"> 
</span><span class="cx">     Type m_type;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecryptokeysCryptoKeyHMACcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/keys/CryptoKeyHMAC.cpp (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/keys/CryptoKeyHMAC.cpp        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/keys/CryptoKeyHMAC.cpp        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -28,8 +28,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><span class="cx"> 
</span><ins>+#include &quot;CryptoAlgorithmHmacKeyParams.h&quot;
</ins><span class="cx"> #include &quot;CryptoAlgorithmRegistry.h&quot;
</span><span class="cx"> #include &quot;CryptoKeyDataOctetSequence.h&quot;
</span><ins>+#include &quot;JsonWebKey.h&quot;
+#include &lt;wtf/text/Base64.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -41,6 +44,13 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+CryptoKeyHMAC::CryptoKeyHMAC(Vector&lt;uint8_t&gt;&amp;&amp; key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsage usage)
+    : CryptoKey(CryptoAlgorithmIdentifier::HMAC, CryptoKeyType::Secret, extractable, usage)
+    , m_hash(hash)
+    , m_key(WTFMove(key))
+{
+}
+
</ins><span class="cx"> CryptoKeyHMAC::~CryptoKeyHMAC()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -62,14 +72,52 @@
</span><span class="cx">             return nullptr;
</span><span class="cx">         }
</span><span class="cx">     }
</span><ins>+    // CommonHMAC only supports key length that is a multiple of 8. Therefore, here we are a little bit different
+    // from the spec as of 11 December 2014: https://www.w3.org/TR/WebCryptoAPI/#hmac-operations
+    if (lengthBits % 8)
+        return nullptr;
</ins><span class="cx"> 
</span><del>-    return adoptRef(new CryptoKeyHMAC(randomData(lengthBits), hash, extractable, usages));
</del><ins>+    return adoptRef(new CryptoKeyHMAC(randomData(lengthBits / 8), hash, extractable, usages));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr&lt;CryptoKeyHMAC&gt; CryptoKeyHMAC::importRaw(size_t lengthBits, CryptoAlgorithmIdentifier hash, Vector&lt;uint8_t&gt;&amp;&amp; keyData, bool extractable, CryptoKeyUsage usages)
+{
+    size_t length = keyData.size() * 8;
+    if (!length)
+        return nullptr;
+    // CommonHMAC only supports key length that is a multiple of 8. Therefore, here we are a little bit different
+    // from the spec as of 11 December 2014: https://www.w3.org/TR/WebCryptoAPI/#hmac-operations
+    if (lengthBits &amp;&amp; lengthBits != length)
+        return nullptr;
+
+    return adoptRef(new CryptoKeyHMAC(WTFMove(keyData), hash, extractable, usages));
+}
+
+RefPtr&lt;CryptoKeyHMAC&gt; CryptoKeyHMAC::importJwk(size_t lengthBits, CryptoAlgorithmIdentifier hash, JsonWebKey&amp;&amp; keyData, bool extractable, CryptoKeyUsage usages, CheckAlgCallback&amp;&amp; callback)
+{
+    if (keyData.kty != &quot;oct&quot;)
+        return nullptr;
+    if (!keyData.k)
+        return nullptr;
+    Vector&lt;uint8_t&gt; octetSequence;
+    if (!base64URLDecode(keyData.k.value(), octetSequence))
+        return nullptr;
+    if (!callback(hash, keyData.alg))
+        return nullptr;
+    if (usages &amp;&amp; keyData.use &amp;&amp; keyData.use.value() != &quot;sig&quot;)
+        return nullptr;
+    if (keyData.usages &amp;&amp; ((keyData.usages &amp; usages) != usages))
+        return nullptr;
+    if (keyData.ext &amp;&amp; !keyData.ext.value() &amp;&amp; extractable)
+        return nullptr;
+
+    return CryptoKeyHMAC::importRaw(lengthBits, hash, WTFMove(octetSequence), extractable, usages);
+}
+
</ins><span class="cx"> std::unique_ptr&lt;KeyAlgorithm&gt; CryptoKeyHMAC::buildAlgorithm() const
</span><span class="cx"> {
</span><span class="cx">     return std::make_unique&lt;HmacKeyAlgorithm&gt;(CryptoAlgorithmRegistry::singleton().nameForIdentifier(algorithmIdentifier()),
</span><del>-        CryptoAlgorithmRegistry::singleton().nameForIdentifier(m_hash), m_key.size());
</del><ins>+        CryptoAlgorithmRegistry::singleton().nameForIdentifier(m_hash), m_key.size() * 8);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr&lt;CryptoKeyData&gt; CryptoKeyHMAC::exportData() const
</span></span></pre></div>
<a id="trunkSourceWebCorecryptokeysCryptoKeyHMACh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/keys/CryptoKeyHMAC.h (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/keys/CryptoKeyHMAC.h        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/keys/CryptoKeyHMAC.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #define CryptoKeyHMAC_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CryptoKey.h&quot;
</span><ins>+#include &lt;wtf/Function.h&gt;
</ins><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><span class="lines">@@ -33,6 +34,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+struct JsonWebKey;
+
</ins><span class="cx"> class HmacKeyAlgorithm final : public KeyAlgorithm {
</span><span class="cx"> public:
</span><span class="cx">     HmacKeyAlgorithm(const String&amp; name, const String&amp; hash, size_t length)
</span><span class="lines">@@ -60,8 +63,10 @@
</span><span class="cx">     }
</span><span class="cx">     virtual ~CryptoKeyHMAC();
</span><span class="cx"> 
</span><del>-    // If lengthBytes is 0, a recommended length is used, which is the size of the associated hash function's block size.
-    static RefPtr&lt;CryptoKeyHMAC&gt; generate(size_t lengthBytes, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsage);
</del><ins>+    static RefPtr&lt;CryptoKeyHMAC&gt; generate(size_t lengthBits, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsage);
+    static RefPtr&lt;CryptoKeyHMAC&gt; importRaw(size_t lengthBits, CryptoAlgorithmIdentifier hash, Vector&lt;uint8_t&gt;&amp;&amp; keyData, bool extractable, CryptoKeyUsage);
+    using CheckAlgCallback = WTF::Function&lt;bool(CryptoAlgorithmIdentifier, const Optional&lt;String&gt;&amp;)&gt;;
+    static RefPtr&lt;CryptoKeyHMAC&gt; importJwk(size_t lengthBits, CryptoAlgorithmIdentifier hash, JsonWebKey&amp;&amp;, bool extractable, CryptoKeyUsage, CheckAlgCallback&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     CryptoKeyClass keyClass() const final { return CryptoKeyClass::HMAC; }
</span><span class="cx"> 
</span><span class="lines">@@ -71,6 +76,7 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     CryptoKeyHMAC(const Vector&lt;uint8_t&gt;&amp; key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsage);
</span><ins>+    CryptoKeyHMAC(Vector&lt;uint8_t&gt;&amp;&amp; key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsage);
</ins><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;KeyAlgorithm&gt; buildAlgorithm() const final;
</span><span class="cx">     std::unique_ptr&lt;CryptoKeyData&gt; exportData() const final;
</span></span></pre></div>
<a id="trunkSourceWebCorecryptokeysCryptoKeyRSAcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp                                (rev 0)
+++ trunk/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,113 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;CryptoKeyRSA.h&quot;
+
+#include &quot;CryptoKeyDataRSAComponents.h&quot;
+#include &quot;JsonWebKey.h&quot;
+#include &lt;wtf/text/Base64.h&gt;
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+namespace WebCore {
+
+RefPtr&lt;CryptoKeyRSA&gt; CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm, Optional&lt;CryptoAlgorithmIdentifier&gt; hash, JsonWebKey&amp;&amp; keyData, bool extractable, CryptoKeyUsage usages)
+{
+    if (keyData.kty != &quot;RSA&quot;)
+        return nullptr;
+    if (keyData.usages &amp;&amp; ((keyData.usages &amp; usages) != usages))
+        return nullptr;
+    if (keyData.ext &amp;&amp; !keyData.ext.value() &amp;&amp; extractable)
+        return nullptr;
+
+    if (!keyData.n || !keyData.e)
+        return nullptr;
+    Vector&lt;uint8_t&gt; modulus;
+    if (!WTF::base64URLDecode(keyData.n.value(), modulus))
+        return nullptr;
+    // Per RFC 7518 Section 6.3.1.1: https://tools.ietf.org/html/rfc7518#section-6.3.1.1
+    if (!modulus[0])
+        modulus.remove(0);
+    Vector&lt;uint8_t&gt; exponent;
+    if (!WTF::base64URLDecode(keyData.e.value(), exponent))
+        return nullptr;
+    if (!keyData.d) {
+        // import public key
+        auto publicKeyComponents = CryptoKeyDataRSAComponents::createPublic(WTFMove(modulus), WTFMove(exponent));
+        // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is Nullopt.
+        return CryptoKeyRSA::create(algorithm, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, *publicKeyComponents, extractable, usages);
+    }
+
+    // import private key
+    Vector&lt;uint8_t&gt; privateExponent;
+    if (!WTF::base64URLDecode(keyData.d.value(), privateExponent))
+        return nullptr;
+    if (!keyData.p &amp;&amp; !keyData.q &amp;&amp; !keyData.dp &amp;&amp; !keyData.dp &amp;&amp; !keyData.qi) {
+        auto privateKeyComponents = CryptoKeyDataRSAComponents::createPrivate(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent));
+        // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is Nullopt.
+        return CryptoKeyRSA::create(algorithm, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
+    }
+
+    if (!keyData.p || !keyData.q || !keyData.dp || !keyData.dq || !keyData.qi)
+        return nullptr;
+    CryptoKeyDataRSAComponents::PrimeInfo firstPrimeInfo;
+    CryptoKeyDataRSAComponents::PrimeInfo secondPrimeInfo;
+    if (!WTF::base64URLDecode(keyData.p.value(), firstPrimeInfo.primeFactor))
+        return nullptr;
+    if (!WTF::base64URLDecode(keyData.dp.value(), firstPrimeInfo.factorCRTExponent))
+        return nullptr;
+    if (!WTF::base64URLDecode(keyData.q.value(), secondPrimeInfo.primeFactor))
+        return nullptr;
+    if (!WTF::base64URLDecode(keyData.dq.value(), secondPrimeInfo.factorCRTExponent))
+        return nullptr;
+    if (!WTF::base64URLDecode(keyData.qi.value(), secondPrimeInfo.factorCRTCoefficient))
+        return nullptr;
+    if (!keyData.oth) {
+        auto privateKeyComponents = CryptoKeyDataRSAComponents::createPrivateWithAdditionalData(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent), WTFMove(firstPrimeInfo), WTFMove(secondPrimeInfo), { });
+        // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is Nullopt.
+        return CryptoKeyRSA::create(algorithm, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
+    }
+
+    Vector&lt;CryptoKeyDataRSAComponents::PrimeInfo&gt; otherPrimeInfos;
+    for (auto value : keyData.oth.value()) {
+        CryptoKeyDataRSAComponents::PrimeInfo info;
+        if (!WTF::base64URLDecode(value.r, info.primeFactor))
+            return nullptr;
+        if (!WTF::base64URLDecode(value.d, info.factorCRTExponent))
+            return nullptr;
+        if (!WTF::base64URLDecode(value.t, info.factorCRTCoefficient))
+            return nullptr;
+        otherPrimeInfos.append(info);
+    }
+
+    auto privateKeyComponents = CryptoKeyDataRSAComponents::createPrivateWithAdditionalData(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent), WTFMove(firstPrimeInfo), WTFMove(secondPrimeInfo), WTFMove(otherPrimeInfos));
+    // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is Nullopt.
+    return CryptoKeyRSA::create(algorithm, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(SUBTLE_CRYPTO)
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptokeysCryptoKeyRSAh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/keys/CryptoKeyRSA.h (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/keys/CryptoKeyRSA.h        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/keys/CryptoKeyRSA.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -48,6 +48,8 @@
</span><span class="cx"> class PromiseWrapper;
</span><span class="cx"> class ScriptExecutionContext;
</span><span class="cx"> 
</span><ins>+struct JsonWebKey;
+
</ins><span class="cx"> class RsaKeyAlgorithm : public KeyAlgorithm {
</span><span class="cx"> public:
</span><span class="cx">     RsaKeyAlgorithm(const String&amp; name, size_t modulusLength, Vector&lt;uint8_t&gt;&amp;&amp; publicExponent)
</span><span class="lines">@@ -99,6 +101,7 @@
</span><span class="cx">     using KeyPairCallback = WTF::Function&lt;void(CryptoKeyPair&amp;)&gt;;
</span><span class="cx">     using VoidCallback = WTF::Function&lt;void()&gt;;
</span><span class="cx">     static void generatePair(CryptoAlgorithmIdentifier, CryptoAlgorithmIdentifier hash, bool hasHash, unsigned modulusLength, const Vector&lt;uint8_t&gt;&amp; publicExponent, bool extractable, CryptoKeyUsage, KeyPairCallback, VoidCallback failureCallback, ScriptExecutionContext*);
</span><ins>+    static RefPtr&lt;CryptoKeyRSA&gt; importJwk(CryptoAlgorithmIdentifier, Optional&lt;CryptoAlgorithmIdentifier&gt; hash, JsonWebKey&amp;&amp;, bool extractable, CryptoKeyUsage);
</ins><span class="cx"> 
</span><span class="cx">     PlatformRSAKey platformKey() const { return m_platformKey; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoparametersCryptoAlgorithmHmacKeyGenParamsh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -1,49 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include &quot;CryptoAlgorithmParameters.h&quot;
-#include &lt;runtime/JSCJSValue.h&gt;
-
-#if ENABLE(SUBTLE_CRYPTO)
-
-namespace WebCore {
-
-class CryptoAlgorithmHmacKeyGenParams final : public CryptoAlgorithmParameters {
-public:
-    // FIXME: Consider merging hash and hashIdentifier.
-    JSC::JSValue hash;
-    CryptoAlgorithmIdentifier hashIdentifier;
-    Optional&lt;unsigned long&gt; length;
-
-    Class parametersClass() const final { return Class::HmacKeyGenParams; }
-};
-
-} // namespace WebCore
-
-SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(HmacKeyGenParams)
-
-#endif // ENABLE(SUBTLE_CRYPTO)
</del></span></pre></div>
<a id="trunkSourceWebCorecryptoparametersCryptoAlgorithmHmacKeyParamshfromrev208547trunkSourceWebCorecryptoparametersCryptoAlgorithmHmacKeyGenParamsh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h (from rev 208547, trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h                                (rev 0)
+++ trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include &quot;CryptoAlgorithmParameters.h&quot;
+#include &lt;runtime/JSCJSValue.h&gt;
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+namespace WebCore {
+
+class CryptoAlgorithmHmacKeyParams final : public CryptoAlgorithmParameters {
+public:
+    // FIXME: Consider merging hash and hashIdentifier.
+    JSC::JSValue hash;
+    CryptoAlgorithmIdentifier hashIdentifier;
+    Optional&lt;unsigned long&gt; length;
+
+    Class parametersClass() const final { return Class::HmacKeyParams; }
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(HmacKeyParams)
+
+#endif // ENABLE(SUBTLE_CRYPTO)
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptoparametersCryptoAlgorithmRsaHashedImportParamshfromrev208547trunkSourceWebCorecryptoparametersCryptoAlgorithmHmacKeyGenParamsh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h (from rev 208547, trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyGenParams.h) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h                                (rev 0)
+++ trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include &quot;CryptoAlgorithmParameters.h&quot;
+#include &lt;runtime/JSCJSValue.h&gt;
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+namespace WebCore {
+
+class CryptoAlgorithmRsaHashedImportParams final : public CryptoAlgorithmParameters {
+public:
+    // FIXME: Consider merging hash and hashIdentifier.
+    JSC::JSValue hash;
+    CryptoAlgorithmIdentifier hashIdentifier;
+
+    Class parametersClass() const final { return Class::RsaHashedImportParams; }
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_CRYPTO_ALGORITHM_PARAMETERS(RsaHashedImportParams)
+
+#endif // ENABLE(SUBTLE_CRYPTO)
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptoparametersHmacKeyGenParamsidl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/crypto/parameters/HmacKeyGenParams.idl (208547 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/parameters/HmacKeyGenParams.idl        2016-11-10 18:31:59 UTC (rev 208547)
+++ trunk/Source/WebCore/crypto/parameters/HmacKeyGenParams.idl        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -1,36 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    Conditional=SUBTLE_CRYPTO,
-    ImplementedAs=CryptoAlgorithmHmacKeyGenParams
-] dictionary HmacKeyGenParams : CryptoAlgorithmParameters {
-    // The inner hash function to use.
-    required any hash;
-    // The length (in bits) of the key to generate. If unspecified, the
-    // recommended length will be used, which is the size of the associated hash function's block
-    // size.
-    [EnforceRange] unsigned long length;
-};
</del></span></pre></div>
<a id="trunkSourceWebCorecryptoparametersHmacKeyParamsidlfromrev208547trunkSourceWebCorecryptoparametersHmacKeyGenParamsidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/parameters/HmacKeyParams.idl (from rev 208547, trunk/Source/WebCore/crypto/parameters/HmacKeyGenParams.idl) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/parameters/HmacKeyParams.idl                                (rev 0)
+++ trunk/Source/WebCore/crypto/parameters/HmacKeyParams.idl        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// This is a unified dictionary for HmacImportParams and HmacKeyGenParams.
+// https://www.w3.org/TR/WebCryptoAPI/#hmac-importparams, and
+// https://www.w3.org/TR/WebCryptoAPI/#hmac-keygen-params
+[
+    Conditional=SUBTLE_CRYPTO,
+    ImplementedAs=CryptoAlgorithmHmacKeyParams
+] dictionary HmacKeyParams : CryptoAlgorithmParameters {
+    // The inner hash function to use.
+    required any hash;
+    // The length (in bits) of the key to generate. If unspecified, the
+    // recommended length will be used, which is the size of the associated hash function's block
+    // size.
+    [EnforceRange] unsigned long length;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptoparametersRsaHashedImportParamsidlfromrev208547trunkSourceWebCorecryptoSubtleCryptoidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/parameters/RsaHashedImportParams.idl (from rev 208547, trunk/Source/WebCore/crypto/SubtleCrypto.idl) (0 => 208548)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/parameters/RsaHashedImportParams.idl                                (rev 0)
+++ trunk/Source/WebCore/crypto/parameters/RsaHashedImportParams.idl        2016-11-10 18:36:44 UTC (rev 208548)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=SUBTLE_CRYPTO,
+    ImplementedAs=CryptoAlgorithmRsaHashedImportParams
+] dictionary RsaHashedImportParams : CryptoAlgorithmParameters {
+    // The hash algorithm to use
+    required any hash;
+};
</ins></span></pre>
</div>
</div>

</body>
</html>