<!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>[206883] 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/206883">206883</a></dd>
<dt>Author</dt> <dd>jiewen_tan@apple.com</dd>
<dt>Date</dt> <dd>2016-10-06 14:32:02 -0700 (Thu, 06 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add a dummy SubtleCrypto interface
https://bugs.webkit.org/show_bug.cgi?id=162992
&lt;rdar://problem/28643573&gt;

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/digest/test_digest-expected.txt:
* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

Add a dummy SubtleCrypto interface and rename KeyPair to CryptoKeyPair.

Tests: crypto/subtle/gc-2.html
       crypto/subtle/gc-3.html
       crypto/subtle/gc.html
       crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html
       crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html
       crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html
       crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html
       crypto/webkitSubtle/aes-cbc-generate-key.html
       crypto/webkitSubtle/aes-cbc-import-jwk.html
       crypto/webkitSubtle/aes-cbc-invalid-length.html
       crypto/webkitSubtle/aes-cbc-unwrap-failure.html
       crypto/webkitSubtle/aes-cbc-unwrap-rsa.html
       crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html
       crypto/webkitSubtle/aes-cbc-wrap-rsa.html
       crypto/webkitSubtle/aes-cbc-wrong-key-class.html
       crypto/webkitSubtle/aes-export-key.html
       crypto/webkitSubtle/aes-kw-key-manipulation.html
       crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html
       crypto/webkitSubtle/aes-postMessage.html
       crypto/webkitSubtle/argument-conversion.html
       crypto/webkitSubtle/array-buffer-view-offset.html
       crypto/webkitSubtle/crypto-key-algorithm-gc.html
       crypto/webkitSubtle/crypto-key-usages-gc.html
       crypto/webkitSubtle/hmac-check-algorithm.html
       crypto/webkitSubtle/hmac-export-key.html
       crypto/webkitSubtle/hmac-generate-key.html
       crypto/webkitSubtle/hmac-import-jwk.html
       crypto/webkitSubtle/hmac-postMessage.html
       crypto/webkitSubtle/hmac-sign-verify-empty-key.html
       crypto/webkitSubtle/hmac-sign-verify.html
       crypto/webkitSubtle/import-jwk.html
       crypto/webkitSubtle/jwk-export-use-values.html
       crypto/webkitSubtle/jwk-import-use-values.html
       crypto/webkitSubtle/rsa-export-generated-keys.html
       crypto/webkitSubtle/rsa-export-key.html
       crypto/webkitSubtle/rsa-export-private-key.html
       crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html
       crypto/webkitSubtle/rsa-indexeddb-non-exportable.html
       crypto/webkitSubtle/rsa-indexeddb-private.html
       crypto/webkitSubtle/rsa-indexeddb.html
       crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html
       crypto/webkitSubtle/rsa-oaep-key-manipulation.html
       crypto/webkitSubtle/rsa-oaep-plaintext-length.html
       crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html
       crypto/webkitSubtle/rsa-postMessage.html
       crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html
       crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html
       crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html
       crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html
       crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html
       crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html
       crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html
       crypto/webkitSubtle/sha-1.html
       crypto/webkitSubtle/sha-224.html
       crypto/webkitSubtle/sha-256.html
       crypto/webkitSubtle/sha-384.html
       crypto/webkitSubtle/sha-512.html
       crypto/webkitSubtle/unimplemented-unwrap-crash.html
       crypto/webkitSubtle/unwrapKey-check-usage.html
       crypto/webkitSubtle/wrapKey-check-usage.html
       crypto/workers/subtle/aes-postMessage-worker.html
       crypto/workers/subtle/gc-worker.html
       crypto/workers/subtle/hmac-postMessage-worker.html
       crypto/workers/subtle/hrsa-postMessage-worker.html
       crypto/workers/subtle/multiple-postMessage-worker.html
       crypto/workers/subtle/rsa-postMessage-worker.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* crypto/CryptoKeyPair.idl:
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::SubtleCrypto):
* crypto/SubtleCrypto.h:
(WebCore::SubtleCrypto::create):
* crypto/SubtleCrypto.idl: Added.
* page/Crypto.cpp:
(WebCore::Crypto::Crypto):
(WebCore::Crypto::subtle):
* page/Crypto.h:
* page/Crypto.idl:

LayoutTests:

* crypto/resources/common.js:
* crypto/subtle/gc-2-expected.txt: Added.
* crypto/subtle/gc-2.html: Added.
* crypto/subtle/gc-3-expected.txt: Added.
* crypto/subtle/gc-3.html: Added.
* crypto/subtle/gc-expected.txt: Added.
* crypto/subtle/gc.html: Added.
* crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt.
* crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html.
* crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt.
* crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html.
* crypto/webkitSubtle/aes-cbc-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt.
* crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt.
* crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html.
* crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html.
* crypto/webkitSubtle/aes-cbc-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt.
* crypto/webkitSubtle/aes-cbc-generate-key.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-generate-key.html.
* crypto/webkitSubtle/aes-cbc-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt.
* crypto/webkitSubtle/aes-cbc-import-jwk.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-import-jwk.html.
* crypto/webkitSubtle/aes-cbc-invalid-length-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt.
* crypto/webkitSubtle/aes-cbc-invalid-length.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-invalid-length.html.
* crypto/webkitSubtle/aes-cbc-unwrap-failure-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt.
* crypto/webkitSubtle/aes-cbc-unwrap-failure.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html.
* crypto/webkitSubtle/aes-cbc-unwrap-rsa-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt.
* crypto/webkitSubtle/aes-cbc-unwrap-rsa.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html.
* crypto/webkitSubtle/aes-cbc-wrap-rsa-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt.
* crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt.
* crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html.
* crypto/webkitSubtle/aes-cbc-wrap-rsa.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html.
* crypto/webkitSubtle/aes-cbc-wrong-key-class-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt.
* crypto/webkitSubtle/aes-cbc-wrong-key-class.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html.
* crypto/webkitSubtle/aes-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-export-key-expected.txt.
* crypto/webkitSubtle/aes-export-key.html: Renamed from LayoutTests/crypto/subtle/aes-export-key.html.
* crypto/webkitSubtle/aes-kw-key-manipulation-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt.
* crypto/webkitSubtle/aes-kw-key-manipulation.html: Renamed from LayoutTests/crypto/subtle/aes-kw-key-manipulation.html.
* crypto/webkitSubtle/aes-kw-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt.
* crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html.
* crypto/webkitSubtle/aes-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-postMessage-expected.txt.
* crypto/webkitSubtle/aes-postMessage.html: Renamed from LayoutTests/crypto/subtle/aes-postMessage.html.
* crypto/webkitSubtle/argument-conversion-expected.txt: Renamed from LayoutTests/crypto/subtle/argument-conversion-expected.txt.
* crypto/webkitSubtle/argument-conversion.html: Renamed from LayoutTests/crypto/subtle/argument-conversion.html.
* crypto/webkitSubtle/array-buffer-view-offset-expected.txt: Renamed from LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt.
* crypto/webkitSubtle/array-buffer-view-offset.html: Renamed from LayoutTests/crypto/subtle/array-buffer-view-offset.html.
* crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt: Renamed from LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt.
* crypto/webkitSubtle/crypto-key-algorithm-gc.html: Renamed from LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html.
* crypto/webkitSubtle/crypto-key-usages-gc-expected.txt: Renamed from LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt.
* crypto/webkitSubtle/crypto-key-usages-gc.html: Renamed from LayoutTests/crypto/subtle/crypto-key-usages-gc.html.
* crypto/webkitSubtle/hmac-check-algorithm-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-check-algorithm-expected.txt.
* crypto/webkitSubtle/hmac-check-algorithm.html: Renamed from LayoutTests/crypto/subtle/hmac-check-algorithm.html.
* crypto/webkitSubtle/hmac-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-export-key-expected.txt.
* crypto/webkitSubtle/hmac-export-key.html: Renamed from LayoutTests/crypto/subtle/hmac-export-key.html.
* crypto/webkitSubtle/hmac-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-export-key.html.
* crypto/webkitSubtle/hmac-generate-key.html: Renamed from LayoutTests/crypto/subtle/hmac-generate-key.html.
* crypto/webkitSubtle/hmac-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt.
* crypto/webkitSubtle/hmac-import-jwk.html: Renamed from LayoutTests/crypto/subtle/hmac-import-jwk.html.
* crypto/webkitSubtle/hmac-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-postMessage-expected.txt.
* crypto/webkitSubtle/hmac-postMessage.html: Renamed from LayoutTests/crypto/subtle/hmac-postMessage.html.
* crypto/webkitSubtle/hmac-sign-verify-empty-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt.
* crypto/webkitSubtle/hmac-sign-verify-empty-key.html: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html.
* crypto/webkitSubtle/hmac-sign-verify-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt.
* crypto/webkitSubtle/hmac-sign-verify.html: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify.html.
* crypto/webkitSubtle/import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/import-jwk-expected.txt.
* crypto/webkitSubtle/import-jwk.html: Renamed from LayoutTests/crypto/subtle/import-jwk-expected.html.
* crypto/webkitSubtle/jwk-export-use-values-expected.txt: Renamed from LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt.
* crypto/webkitSubtle/jwk-export-use-values.html: Renamed from LayoutTests/crypto/subtle/jwk-export-use-values.html.
* crypto/webkitSubtle/jwk-import-use-values-expected.txt: Renamed from LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt.
* crypto/webkitSubtle/jwk-import-use-values.html: Renamed from LayoutTests/crypto/subtle/jwk-import-use-values.html.
* crypto/webkitSubtle/resources/rsa-indexeddb-non-exportable.js: Renamed from LayoutTests/crypto/subtle/resources/rsa-indexeddb-non-exportable.js.
* crypto/webkitSubtle/resources/rsa-indexeddb.js: Renamed from LayoutTests/crypto/subtle/resources/rsa-indexeddb.js.
* crypto/webkitSubtle/rsa-export-generated-keys-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt.
* crypto/webkitSubtle/rsa-export-generated-keys.html: Renamed from LayoutTests/crypto/subtle/rsa-export-generated-keys.html.
* crypto/webkitSubtle/rsa-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-key-expected.txt.
* crypto/webkitSubtle/rsa-export-key.html: Renamed from LayoutTests/crypto/subtle/rsa-export-key.html.
* crypto/webkitSubtle/rsa-export-private-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt.
* crypto/webkitSubtle/rsa-export-private-key.html: Renamed from LayoutTests/crypto/subtle/rsa-export-private-key.html.
* crypto/webkitSubtle/rsa-indexeddb-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt.
* crypto/webkitSubtle/rsa-indexeddb-non-exportable-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt.
* crypto/webkitSubtle/rsa-indexeddb-non-exportable-private-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt.
* crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html.
* crypto/webkitSubtle/rsa-indexeddb-non-exportable.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html.
* crypto/webkitSubtle/rsa-indexeddb-private-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt.
* crypto/webkitSubtle/rsa-indexeddb-private.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-private.html.
* crypto/webkitSubtle/rsa-indexeddb.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb.html.
* crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt.
* crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html.
* crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt.
* crypto/webkitSubtle/rsa-oaep-key-manipulation.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html.
* crypto/webkitSubtle/rsa-oaep-plaintext-length-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt.
* crypto/webkitSubtle/rsa-oaep-plaintext-length.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html.
* crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt.
* crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html.
* crypto/webkitSubtle/rsa-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-postMessage-expected.txt.
* crypto/webkitSubtle/rsa-postMessage.html: Renamed from LayoutTests/crypto/subtle/rsa-postMessage.html.
* crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt.
* crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html.
* crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt.
* crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt: Added.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html.
* crypto/webkitSubtle/sha-1-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-1-expected.txt.
* crypto/webkitSubtle/sha-1.html: Renamed from LayoutTests/crypto/subtle/sha-1.html.
* crypto/webkitSubtle/sha-224-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-224-expected.txt.
* crypto/webkitSubtle/sha-224.html: Renamed from LayoutTests/crypto/subtle/sha-224.html.
* crypto/webkitSubtle/sha-256-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-256-expected.txt.
* crypto/webkitSubtle/sha-256.html: Renamed from LayoutTests/crypto/subtle/sha-256.html.
* crypto/webkitSubtle/sha-384-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-384-expected.txt.
* crypto/webkitSubtle/sha-384.html: Renamed from LayoutTests/crypto/subtle/sha-384.html.
* crypto/webkitSubtle/sha-512-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-512-expected.txt.
* crypto/webkitSubtle/sha-512.html: Renamed from LayoutTests/crypto/subtle/sha-512.html.
* crypto/webkitSubtle/unimplemented-unwrap-crash-expected.txt: Renamed from LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt.
* crypto/webkitSubtle/unimplemented-unwrap-crash.html: Renamed from LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html.
* crypto/webkitSubtle/unwrapKey-check-usage-expected.txt: Renamed from LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt.
* crypto/webkitSubtle/unwrapKey-check-usage.html: Renamed from LayoutTests/crypto/subtle/unwrapKey-check-usage.html.
* crypto/webkitSubtle/wrapKey-check-usage-expected.txt: Renamed from LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt.
* crypto/webkitSubtle/wrapKey-check-usage.html: Renamed from LayoutTests/crypto/subtle/wrapKey-check-usage.html.
* crypto/workers/subtle/aes-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt.
* crypto/workers/subtle/aes-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/aes-postMessage-worker.html.
* crypto/workers/subtle/gc-worker-expected.txt: Added.
* crypto/workers/subtle/gc-worker.html: Added.
* crypto/workers/subtle/hmac-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt.
* crypto/workers/subtle/hmac-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/hmac-postMessage-worker.html.
* crypto/workers/subtle/hrsa-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt.
* crypto/workers/subtle/hrsa-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/hrsa-postMessage-worker.html.
* crypto/workers/subtle/multiple-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt.
* crypto/workers/subtle/multiple-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/multiple-postMessage-worker.html.
* crypto/workers/subtle/resources/aes-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/aes-postMessage-worker.js.
* crypto/workers/subtle/resources/gc-worker.js: Added.
* crypto/workers/subtle/resources/hmac-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js.
* crypto/workers/subtle/resources/hrsa-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js.
* crypto/workers/subtle/resources/rsa-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js.
* crypto/workers/subtle/rsa-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt.
* crypto/workers/subtle/rsa-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/rsa-postMessage-worker.html.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator-wk1/TestExpectations:
* platform/win/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestscryptoresourcescommonjs">trunk/LayoutTests/crypto/resources/common.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIdigesttest_digestexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cWebCryptoAPIidlharnessexpectedtxt">trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformeflTestExpectations">trunk/LayoutTests/platform/efl/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk1TestExpectations">trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformwinTestExpectations">trunk/LayoutTests/platform/win/TestExpectations</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="#trunkSourceWebCoreDerivedSourcescpp">trunk/Source/WebCore/DerivedSources.cpp</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="#trunkSourceWebCorecryptoCryptoKeyPairidl">trunk/Source/WebCore/crypto/CryptoKeyPair.idl</a></li>
<li><a href="#trunkSourceWebCorepageCryptocpp">trunk/Source/WebCore/page/Crypto.cpp</a></li>
<li><a href="#trunkSourceWebCorepageCryptoh">trunk/Source/WebCore/page/Crypto.h</a></li>
<li><a href="#trunkSourceWebCorepageCryptoidl">trunk/Source/WebCore/page/Crypto.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscryptosubtlegc2expectedtxt">trunk/LayoutTests/crypto/subtle/gc-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegc2html">trunk/LayoutTests/crypto/subtle/gc-2.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegc3expectedtxt">trunk/LayoutTests/crypto/subtle/gc-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegc3html">trunk/LayoutTests/crypto/subtle/gc-3.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegcexpectedtxt">trunk/LayoutTests/crypto/subtle/gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegchtml">trunk/LayoutTests/crypto/subtle/gc.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbc192encryptdecryptexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbc192encryptdecrypthtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbc256encryptdecryptexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbc256encryptdecrypthtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcencryptdecryptexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcencryptdecryptwithpaddingexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcencryptdecryptwithpaddinghtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcencryptdecrypthtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcgeneratekeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcgeneratekeyhtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcimportjwkexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcimportjwkhtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcinvalidlengthexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcinvalidlengthhtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcunwrapfailureexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcunwrapfailurehtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcunwraprsaexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcunwraprsahtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcwraprsaexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcwraprsanonextractableexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcwraprsanonextractablehtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcwraprsahtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcwrongkeyclassexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaescbcwrongkeyclasshtml">trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaesexportkeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-export-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaesexportkeyhtml">trunk/LayoutTests/crypto/webkitSubtle/aes-export-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaeskwkeymanipulationexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaeskwkeymanipulationhtml">trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaeskwwrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaeskwwrapunwrapaeshtml">trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaespostMessageexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleaespostMessagehtml">trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleargumentconversionexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/argument-conversion-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleargumentconversionhtml">trunk/LayoutTests/crypto/webkitSubtle/argument-conversion.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlearraybufferviewoffsetexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlearraybufferviewoffsethtml">trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlecryptokeyalgorithmgcexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlecryptokeyalgorithmgchtml">trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlecryptokeyusagesgcexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlecryptokeyusagesgchtml">trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmaccheckalgorithmexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmaccheckalgorithmhtml">trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacexportkeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacexportkeyhtml">trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key.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="#trunkLayoutTestscryptowebkitSubtlehmacsignverifyemptykeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlehmacsignverifyemptykeyhtml">trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key.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="#trunkLayoutTestscryptowebkitSubtleimportjwkexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleimportjwkhtml">trunk/LayoutTests/crypto/webkitSubtle/import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlejwkexportusevaluesexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlejwkexportusevalueshtml">trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlejwkimportusevaluesexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlejwkimportusevalueshtml">trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleresourcesrsaindexeddbnonexportablejs">trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb-non-exportable.js</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleresourcesrsaindexeddbjs">trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb.js</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaexportgeneratedkeysexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaexportgeneratedkeyshtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaexportkeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaexportkeyhtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaexportprivatekeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaexportprivatekeyhtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportableexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportableprivateexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportableprivatehtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportablehtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbprivateexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbprivatehtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaindexeddbhtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepgeneratenonextractablekeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepgeneratenonextractablekeyhtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepkeymanipulationexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepkeymanipulationhtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepplaintextlengthexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepplaintextlengthhtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepwrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaoaepwrapunwrapaeshtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersapostMessageexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersapostMessagehtml">trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5decryptexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5decrypthtml">trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5wrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5wrapunwrapaeshtml">trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponentexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponenthtml">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeyhtml">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwkexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwksmallkeyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwksmallkeyhtml">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwkhtml">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5signverifyexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5signverifyhtml">trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha1expectedtxt">trunk/LayoutTests/crypto/webkitSubtle/sha-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha1html">trunk/LayoutTests/crypto/webkitSubtle/sha-1.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha224expectedtxt">trunk/LayoutTests/crypto/webkitSubtle/sha-224-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha224html">trunk/LayoutTests/crypto/webkitSubtle/sha-224.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha256expectedtxt">trunk/LayoutTests/crypto/webkitSubtle/sha-256-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha256html">trunk/LayoutTests/crypto/webkitSubtle/sha-256.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha384expectedtxt">trunk/LayoutTests/crypto/webkitSubtle/sha-384-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha384html">trunk/LayoutTests/crypto/webkitSubtle/sha-384.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha512expectedtxt">trunk/LayoutTests/crypto/webkitSubtle/sha-512-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlesha512html">trunk/LayoutTests/crypto/webkitSubtle/sha-512.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleunimplementedunwrapcrashexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleunimplementedunwrapcrashhtml">trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleunwrapKeycheckusageexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtleunwrapKeycheckusagehtml">trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlewrapKeycheckusageexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlewrapKeycheckusagehtml">trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage.html</a></li>
<li>trunk/LayoutTests/crypto/workers/subtle/</li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleaespostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleaespostMessageworkerhtml">trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlegcworkerexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/gc-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlegcworkerhtml">trunk/LayoutTests/crypto/workers/subtle/gc-worker.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="#trunkLayoutTestscryptoworkerssubtlehrsapostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlehrsapostMessageworkerhtml">trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlemultiplepostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlemultiplepostMessageworkerhtml">trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker.html</a></li>
<li>trunk/LayoutTests/crypto/workers/subtle/resources/</li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourcesaespostMessageworkerjs">trunk/LayoutTests/crypto/workers/subtle/resources/aes-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourcesgcworkerjs">trunk/LayoutTests/crypto/workers/subtle/resources/gc-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourceshmacpostMessageworkerjs">trunk/LayoutTests/crypto/workers/subtle/resources/hmac-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourceshrsapostMessageworkerjs">trunk/LayoutTests/crypto/workers/subtle/resources/hrsa-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtleresourcesrsapostMessageworkerjs">trunk/LayoutTests/crypto/workers/subtle/resources/rsa-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlersapostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkerssubtlersapostMessageworkerhtml">trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker.html</a></li>
<li><a href="#trunkSourceWebCorecryptoSubtleCryptocpp">trunk/Source/WebCore/crypto/SubtleCrypto.cpp</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>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscryptosubtleaescbc192encryptdecryptexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbc192encryptdecrypthtml">trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbc256encryptdecryptexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbc256encryptdecrypthtml">trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcencryptdecryptexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddingexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddinghtml">trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcencryptdecrypthtml">trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcgeneratekeyexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcgeneratekeyhtml">trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcimportjwkhtml">trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcinvalidlengthexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcinvalidlengthhtml">trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcunwrapfailureexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcunwrapfailurehtml">trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcunwraprsaexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcunwraprsahtml">trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcwraprsaexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcwraprsanonextractableexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcwraprsanonextractablehtml">trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcwraprsahtml">trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcwrongkeyclassexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaescbcwrongkeyclasshtml">trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaesexportkeyexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-export-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaesexportkeyhtml">trunk/LayoutTests/crypto/subtle/aes-export-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwkeymanipulationexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwkeymanipulationhtml">trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwwrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaeskwwrapunwrapaeshtml">trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaespostMessageexpectedtxt">trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleaespostMessagehtml">trunk/LayoutTests/crypto/subtle/aes-postMessage.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleargumentconversionexpectedtxt">trunk/LayoutTests/crypto/subtle/argument-conversion-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleargumentconversionhtml">trunk/LayoutTests/crypto/subtle/argument-conversion.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlearraybufferviewoffsetexpectedtxt">trunk/LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlearraybufferviewoffsethtml">trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlecryptokeyalgorithmgcexpectedtxt">trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlecryptokeyalgorithmgchtml">trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlecryptokeyusagesgcexpectedtxt">trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlecryptokeyusagesgchtml">trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmaccheckalgorithmexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-check-algorithm-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmaccheckalgorithmhtml">trunk/LayoutTests/crypto/subtle/hmac-check-algorithm.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacexportkeyexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-export-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacexportkeyhtml">trunk/LayoutTests/crypto/subtle/hmac-export-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacgeneratekeyexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-generate-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacgeneratekeyhtml">trunk/LayoutTests/crypto/subtle/hmac-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacimportjwkhtml">trunk/LayoutTests/crypto/subtle/hmac-import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacpostMessageexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacpostMessagehtml">trunk/LayoutTests/crypto/subtle/hmac-postMessage.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacsignverifyemptykeyexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacsignverifyemptykeyhtml">trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacsignverifyexpectedtxt">trunk/LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlehmacsignverifyhtml">trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleimportjwkexpectedtxt">trunk/LayoutTests/crypto/subtle/import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleimportjwkhtml">trunk/LayoutTests/crypto/subtle/import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlejwkexportusevaluesexpectedtxt">trunk/LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlejwkexportusevalueshtml">trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlejwkimportusevaluesexpectedtxt">trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlejwkimportusevalueshtml">trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html</a></li>
<li>trunk/LayoutTests/crypto/subtle/resources/</li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportgeneratedkeysexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportgeneratedkeyshtml">trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportkeyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-export-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportkeyhtml">trunk/LayoutTests/crypto/subtle/rsa-export-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportprivatekeyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaexportprivatekeyhtml">trunk/LayoutTests/crypto/subtle/rsa-export-private-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbnonexportableexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivateexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivatehtml">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbnonexportablehtml">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbprivateexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbprivatehtml">trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaindexeddbhtml">trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepgeneratenonextractablekeyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepgeneratenonextractablekeyhtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepkeymanipulationexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepkeymanipulationhtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepplaintextlengthexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepplaintextlengthhtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepwrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaoaepwrapunwrapaeshtml">trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersapostMessageexpectedtxt">trunk/LayoutTests/crypto/subtle/rsa-postMessage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersapostMessagehtml">trunk/LayoutTests/crypto/subtle/rsa-postMessage.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5decryptexpectedtxt">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5decrypthtml">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaesexpectedtxt">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaeshtml">trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponentexpectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponenthtml">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeyhtml">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkexpectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwksmallkeyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwksmallkeyhtml">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkhtml">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5signverifyexpectedtxt">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlersassapkcs1v1_5signverifyhtml">trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha1expectedtxt">trunk/LayoutTests/crypto/subtle/sha-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha1html">trunk/LayoutTests/crypto/subtle/sha-1.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha224expectedtxt">trunk/LayoutTests/crypto/subtle/sha-224-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha224html">trunk/LayoutTests/crypto/subtle/sha-224.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha256expectedtxt">trunk/LayoutTests/crypto/subtle/sha-256-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha256html">trunk/LayoutTests/crypto/subtle/sha-256.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha384expectedtxt">trunk/LayoutTests/crypto/subtle/sha-384-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha384html">trunk/LayoutTests/crypto/subtle/sha-384.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha512expectedtxt">trunk/LayoutTests/crypto/subtle/sha-512-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlesha512html">trunk/LayoutTests/crypto/subtle/sha-512.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleunimplementedunwrapcrashexpectedtxt">trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleunimplementedunwrapcrashhtml">trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtleunwrapKeycheckusageexpectedtxt">trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtleunwrapKeycheckusagehtml">trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlewrapKeycheckusageexpectedtxt">trunk/LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlewrapKeycheckusagehtml">trunk/LayoutTests/crypto/subtle/wrapKey-check-usage.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkersaespostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkersaespostMessageworkerhtml">trunk/LayoutTests/crypto/workers/aes-postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkershmacpostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkershmacpostMessageworkerhtml">trunk/LayoutTests/crypto/workers/hmac-postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkershrsapostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkershrsapostMessageworkerhtml">trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkersmultiplepostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkersmultiplepostMessageworkerhtml">trunk/LayoutTests/crypto/workers/multiple-postMessage-worker.html</a></li>
<li><a href="#trunkLayoutTestscryptoworkersresourcesaespostMessageworkerjs">trunk/LayoutTests/crypto/workers/resources/aes-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkersresourceshmacpostMessageworkerjs">trunk/LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkersresourceshrsapostMessageworkerjs">trunk/LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkersresourcesrsapostMessageworkerjs">trunk/LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js</a></li>
<li><a href="#trunkLayoutTestscryptoworkersrsapostMessageworkerexpectedtxt">trunk/LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptoworkersrsapostMessageworkerhtml">trunk/LayoutTests/crypto/workers/rsa-postMessage-worker.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/ChangeLog        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,3 +1,156 @@
</span><ins>+2016-10-06  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        Add a dummy SubtleCrypto interface
+        https://bugs.webkit.org/show_bug.cgi?id=162992
+        &lt;rdar://problem/28643573&gt;
+
+        Reviewed by Brent Fulgham.
+
+        * crypto/resources/common.js:
+        * crypto/subtle/gc-2-expected.txt: Added.
+        * crypto/subtle/gc-2.html: Added.
+        * crypto/subtle/gc-3-expected.txt: Added.
+        * crypto/subtle/gc-3.html: Added.
+        * crypto/subtle/gc-expected.txt: Added.
+        * crypto/subtle/gc.html: Added.
+        * crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt.
+        * crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html.
+        * crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt.
+        * crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html.
+        * crypto/webkitSubtle/aes-cbc-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt.
+        * crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt.
+        * crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html.
+        * crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html.
+        * crypto/webkitSubtle/aes-cbc-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt.
+        * crypto/webkitSubtle/aes-cbc-generate-key.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-generate-key.html.
+        * crypto/webkitSubtle/aes-cbc-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt.
+        * crypto/webkitSubtle/aes-cbc-import-jwk.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-import-jwk.html.
+        * crypto/webkitSubtle/aes-cbc-invalid-length-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt.
+        * crypto/webkitSubtle/aes-cbc-invalid-length.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-invalid-length.html.
+        * crypto/webkitSubtle/aes-cbc-unwrap-failure-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt.
+        * crypto/webkitSubtle/aes-cbc-unwrap-failure.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html.
+        * crypto/webkitSubtle/aes-cbc-unwrap-rsa-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt.
+        * crypto/webkitSubtle/aes-cbc-unwrap-rsa.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html.
+        * crypto/webkitSubtle/aes-cbc-wrap-rsa-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt.
+        * crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt.
+        * crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html.
+        * crypto/webkitSubtle/aes-cbc-wrap-rsa.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html.
+        * crypto/webkitSubtle/aes-cbc-wrong-key-class-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt.
+        * crypto/webkitSubtle/aes-cbc-wrong-key-class.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html.
+        * crypto/webkitSubtle/aes-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-export-key-expected.txt.
+        * crypto/webkitSubtle/aes-export-key.html: Renamed from LayoutTests/crypto/subtle/aes-export-key.html.
+        * crypto/webkitSubtle/aes-kw-key-manipulation-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt.
+        * crypto/webkitSubtle/aes-kw-key-manipulation.html: Renamed from LayoutTests/crypto/subtle/aes-kw-key-manipulation.html.
+        * crypto/webkitSubtle/aes-kw-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt.
+        * crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html.
+        * crypto/webkitSubtle/aes-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-postMessage-expected.txt.
+        * crypto/webkitSubtle/aes-postMessage.html: Renamed from LayoutTests/crypto/subtle/aes-postMessage.html.
+        * crypto/webkitSubtle/argument-conversion-expected.txt: Renamed from LayoutTests/crypto/subtle/argument-conversion-expected.txt.
+        * crypto/webkitSubtle/argument-conversion.html: Renamed from LayoutTests/crypto/subtle/argument-conversion.html.
+        * crypto/webkitSubtle/array-buffer-view-offset-expected.txt: Renamed from LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt.
+        * crypto/webkitSubtle/array-buffer-view-offset.html: Renamed from LayoutTests/crypto/subtle/array-buffer-view-offset.html.
+        * crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt: Renamed from LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt.
+        * crypto/webkitSubtle/crypto-key-algorithm-gc.html: Renamed from LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html.
+        * crypto/webkitSubtle/crypto-key-usages-gc-expected.txt: Renamed from LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt.
+        * crypto/webkitSubtle/crypto-key-usages-gc.html: Renamed from LayoutTests/crypto/subtle/crypto-key-usages-gc.html.
+        * crypto/webkitSubtle/hmac-check-algorithm-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-check-algorithm-expected.txt.
+        * crypto/webkitSubtle/hmac-check-algorithm.html: Renamed from LayoutTests/crypto/subtle/hmac-check-algorithm.html.
+        * crypto/webkitSubtle/hmac-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-export-key-expected.txt.
+        * crypto/webkitSubtle/hmac-export-key.html: Renamed from LayoutTests/crypto/subtle/hmac-export-key.html.
+        * crypto/webkitSubtle/hmac-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-export-key.html.
+        * crypto/webkitSubtle/hmac-generate-key.html: Renamed from LayoutTests/crypto/subtle/hmac-generate-key.html.
+        * crypto/webkitSubtle/hmac-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt.
+        * crypto/webkitSubtle/hmac-import-jwk.html: Renamed from LayoutTests/crypto/subtle/hmac-import-jwk.html.
+        * crypto/webkitSubtle/hmac-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-postMessage-expected.txt.
+        * crypto/webkitSubtle/hmac-postMessage.html: Renamed from LayoutTests/crypto/subtle/hmac-postMessage.html.
+        * crypto/webkitSubtle/hmac-sign-verify-empty-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt.
+        * crypto/webkitSubtle/hmac-sign-verify-empty-key.html: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html.
+        * crypto/webkitSubtle/hmac-sign-verify-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt.
+        * crypto/webkitSubtle/hmac-sign-verify.html: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify.html.
+        * crypto/webkitSubtle/import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/import-jwk-expected.txt.
+        * crypto/webkitSubtle/import-jwk.html: Renamed from LayoutTests/crypto/subtle/import-jwk-expected.html.
+        * crypto/webkitSubtle/jwk-export-use-values-expected.txt: Renamed from LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt.
+        * crypto/webkitSubtle/jwk-export-use-values.html: Renamed from LayoutTests/crypto/subtle/jwk-export-use-values.html.
+        * crypto/webkitSubtle/jwk-import-use-values-expected.txt: Renamed from LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt.
+        * crypto/webkitSubtle/jwk-import-use-values.html: Renamed from LayoutTests/crypto/subtle/jwk-import-use-values.html.
+        * crypto/webkitSubtle/resources/rsa-indexeddb-non-exportable.js: Renamed from LayoutTests/crypto/subtle/resources/rsa-indexeddb-non-exportable.js.
+        * crypto/webkitSubtle/resources/rsa-indexeddb.js: Renamed from LayoutTests/crypto/subtle/resources/rsa-indexeddb.js.
+        * crypto/webkitSubtle/rsa-export-generated-keys-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt.
+        * crypto/webkitSubtle/rsa-export-generated-keys.html: Renamed from LayoutTests/crypto/subtle/rsa-export-generated-keys.html.
+        * crypto/webkitSubtle/rsa-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-key-expected.txt.
+        * crypto/webkitSubtle/rsa-export-key.html: Renamed from LayoutTests/crypto/subtle/rsa-export-key.html.
+        * crypto/webkitSubtle/rsa-export-private-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt.
+        * crypto/webkitSubtle/rsa-export-private-key.html: Renamed from LayoutTests/crypto/subtle/rsa-export-private-key.html.
+        * crypto/webkitSubtle/rsa-indexeddb-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt.
+        * crypto/webkitSubtle/rsa-indexeddb-non-exportable-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt.
+        * crypto/webkitSubtle/rsa-indexeddb-non-exportable-private-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt.
+        * crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html.
+        * crypto/webkitSubtle/rsa-indexeddb-non-exportable.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html.
+        * crypto/webkitSubtle/rsa-indexeddb-private-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt.
+        * crypto/webkitSubtle/rsa-indexeddb-private.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-private.html.
+        * crypto/webkitSubtle/rsa-indexeddb.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb.html.
+        * crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt.
+        * crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html.
+        * crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt.
+        * crypto/webkitSubtle/rsa-oaep-key-manipulation.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html.
+        * crypto/webkitSubtle/rsa-oaep-plaintext-length-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt.
+        * crypto/webkitSubtle/rsa-oaep-plaintext-length.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html.
+        * crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt.
+        * crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html.
+        * crypto/webkitSubtle/rsa-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-postMessage-expected.txt.
+        * crypto/webkitSubtle/rsa-postMessage.html: Renamed from LayoutTests/crypto/subtle/rsa-postMessage.html.
+        * crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt.
+        * crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html.
+        * crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt.
+        * crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html.
+        * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt.
+        * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt.
+        * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html.
+        * crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html.
+        * crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt.
+        * crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt: Added.
+        * crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html.
+        * crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html.
+        * crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt.
+        * crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html.
+        * crypto/webkitSubtle/sha-1-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-1-expected.txt.
+        * crypto/webkitSubtle/sha-1.html: Renamed from LayoutTests/crypto/subtle/sha-1.html.
+        * crypto/webkitSubtle/sha-224-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-224-expected.txt.
+        * crypto/webkitSubtle/sha-224.html: Renamed from LayoutTests/crypto/subtle/sha-224.html.
+        * crypto/webkitSubtle/sha-256-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-256-expected.txt.
+        * crypto/webkitSubtle/sha-256.html: Renamed from LayoutTests/crypto/subtle/sha-256.html.
+        * crypto/webkitSubtle/sha-384-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-384-expected.txt.
+        * crypto/webkitSubtle/sha-384.html: Renamed from LayoutTests/crypto/subtle/sha-384.html.
+        * crypto/webkitSubtle/sha-512-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-512-expected.txt.
+        * crypto/webkitSubtle/sha-512.html: Renamed from LayoutTests/crypto/subtle/sha-512.html.
+        * crypto/webkitSubtle/unimplemented-unwrap-crash-expected.txt: Renamed from LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt.
+        * crypto/webkitSubtle/unimplemented-unwrap-crash.html: Renamed from LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html.
+        * crypto/webkitSubtle/unwrapKey-check-usage-expected.txt: Renamed from LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt.
+        * crypto/webkitSubtle/unwrapKey-check-usage.html: Renamed from LayoutTests/crypto/subtle/unwrapKey-check-usage.html.
+        * crypto/webkitSubtle/wrapKey-check-usage-expected.txt: Renamed from LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt.
+        * crypto/webkitSubtle/wrapKey-check-usage.html: Renamed from LayoutTests/crypto/subtle/wrapKey-check-usage.html.
+        * crypto/workers/subtle/aes-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt.
+        * crypto/workers/subtle/aes-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/aes-postMessage-worker.html.
+        * crypto/workers/subtle/gc-worker-expected.txt: Added.
+        * crypto/workers/subtle/gc-worker.html: Added.
+        * crypto/workers/subtle/hmac-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt.
+        * crypto/workers/subtle/hmac-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/hmac-postMessage-worker.html.
+        * crypto/workers/subtle/hrsa-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt.
+        * crypto/workers/subtle/hrsa-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/hrsa-postMessage-worker.html.
+        * crypto/workers/subtle/multiple-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt.
+        * crypto/workers/subtle/multiple-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/multiple-postMessage-worker.html.
+        * crypto/workers/subtle/resources/aes-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/aes-postMessage-worker.js.
+        * crypto/workers/subtle/resources/gc-worker.js: Added.
+        * crypto/workers/subtle/resources/hmac-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js.
+        * crypto/workers/subtle/resources/hrsa-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js.
+        * crypto/workers/subtle/resources/rsa-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js.
+        * crypto/workers/subtle/rsa-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt.
+        * crypto/workers/subtle/rsa-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/rsa-postMessage-worker.html.
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+        * platform/ios-simulator-wk1/TestExpectations:
+        * platform/win/TestExpectations:
+
</ins><span class="cx"> 2016-10-06  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Mutating styleSheet in shadow tree doesn't update the style
</span></span></pre></div>
<a id="trunkLayoutTestscryptoresourcescommonjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/crypto/resources/common.js (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/resources/common.js        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/resources/common.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -80,6 +80,3 @@
</span><span class="cx">         return new Uint8Array(Array.prototype.map.call(atob(s), function (c) { return c.charCodeAt(0) }));
</span><span class="cx">     }
</span><span class="cx"> };
</span><del>-
-if (!(typeof WorkerGlobalScope !== 'undefined' &amp;&amp; self instanceof WorkerGlobalScope) &amp;&amp; !crypto.subtle)
-    crypto.subtle = crypto.webkitSubtle;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbc192encryptdecryptexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-Test AES-CBC encrypt and decrypt functions with a 256 bit key.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing a raw AES key from string literal...
-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']
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(encryptionResult)) is '4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'
-Decrypting it back...
-PASS new Uint8Array(decryptionResult) is plaintext
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbc192encryptdecrypthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,48 +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 AES-CBC encrypt and decrypt functions with a 256 bit key.&quot;);
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array(&quot;8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b&quot;);
-var iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
-var plaintext = hexStringToUint8Array(&quot;6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710&quot;);
-var extractable = true;
-
-debug(&quot;Importing a raw AES key from string literal...&quot;);
-crypto.subtle.importKey(&quot;raw&quot;, keyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&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']&quot;);
-
-    debug(&quot;Using the key to encrypt plaintext...&quot;);
-    return crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext);
-}).then(function(result) {
-    encryptionResult = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(encryptionResult))&quot;, &quot;'4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'&quot;);
-
-    debug(&quot;Decrypting it back...&quot;);
-    return crypto.subtle.decrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, result);
-}).then(function(result) {
-    decryptionResult = result;
-    shouldBe(&quot;new Uint8Array(decryptionResult)&quot;, &quot;plaintext&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbc256encryptdecryptexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-Test AES-CBC encrypt and decrypt functions with a 256 bit key.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing a raw AES key from string literal...
-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']
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(encryptionResult)) is 'f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644'
-Decrypting it back...
-PASS new Uint8Array(decryptionResult) is plaintext
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbc256encryptdecrypthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,48 +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 AES-CBC encrypt and decrypt functions with a 256 bit key.&quot;);
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array(&quot;603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4&quot;);
-var iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
-var plaintext = hexStringToUint8Array(&quot;6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710&quot;);
-var extractable = true;
-
-debug(&quot;Importing a raw AES key from string literal...&quot;);
-crypto.subtle.importKey(&quot;raw&quot;, keyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&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']&quot;);
-
-    debug(&quot;Using the key to encrypt plaintext...&quot;);
-    return crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext);
-}).then(function(result) {
-    encryptionResult = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(encryptionResult))&quot;, &quot;'f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644'&quot;);
-
-    debug(&quot;Decrypting it back...&quot;);
-    return crypto.subtle.decrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, result);
-}).then(function(result) {
-    decryptionResult = result;
-    shouldBe(&quot;new Uint8Array(decryptionResult)&quot;, &quot;plaintext&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcencryptdecryptexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,24 +0,0 @@
</span><del>-Test AES-CBC encrypt and decrypt functions.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing a raw AES key from string literal...
-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']
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(encryptionResult)) is '7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012'
-Decrypting it back...
-PASS new Uint8Array(decryptionResult) is plaintext
-Testing initialization vector bindings...
-PASS crypto.subtle.encrypt({name: 'AES-CBC', iv: null}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.subtle.encrypt({name: 'AES-CBC'}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.subtle.encrypt({name: 'AES-CBC', iv: 3}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.subtle.encrypt({name: 'AES-CBC', iv: new Uint8Array([0])}, key, plaintext) threw exception Error: AES-CBC initialization data must be 16 bytes.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddingexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-Test AES-CBC encrypt and decrypt functions on a plaintext that is not a multiple of block size in length.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing a raw AES key from string literal...
-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']
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(cyphertext)) is '630199c5f202cc7167bb84c6c72b349d'
-Decrypting it back...
-PASS new Uint8Array(decryptionResult) is plaintext
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddinghtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,47 +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 AES-CBC encrypt and decrypt functions on a plaintext that is not a multiple of block size in length.&quot;);
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array(&quot;2b7e151628aed2a6abf7158809cf4f3c&quot;);
-var iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
-var plaintext = asciiToUint8Array(&quot;test&quot;);
-var extractable = true;
-
-debug(&quot;Importing a raw AES key from string literal...&quot;);
-crypto.subtle.importKey(&quot;raw&quot;, keyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&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']&quot;);
-
-    debug(&quot;Using the key to encrypt plaintext...&quot;);
-    return crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext);
-}).then(function(result) {
-    cyphertext = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(cyphertext))&quot;, &quot;'630199c5f202cc7167bb84c6c72b349d'&quot;);
-
-    debug(&quot;Decrypting it back...&quot;);
-    return crypto.subtle.decrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, result);
-}).then(function(result) {
-    decryptionResult = result;
-    shouldBe(&quot;new Uint8Array(decryptionResult)&quot;, &quot;plaintext&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcencryptdecrypthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,54 +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 AES-CBC encrypt and decrypt functions.&quot;);
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array(&quot;2b7e151628aed2a6abf7158809cf4f3c&quot;);
-var iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
-var plaintext = hexStringToUint8Array(&quot;6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710&quot;);
-var extractable = true;
-
-debug(&quot;Importing a raw AES key from string literal...&quot;);
-crypto.subtle.importKey(&quot;raw&quot;, keyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&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']&quot;);
-
-    debug(&quot;Using the key to encrypt plaintext...&quot;);
-    return crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext);
-}).then(function(result) {
-    encryptionResult = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(encryptionResult))&quot;, &quot;'7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012'&quot;);
-
-    debug(&quot;Decrypting it back...&quot;);
-    return crypto.subtle.decrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, result);
-}).then(function(result) {
-    decryptionResult = result;
-    shouldBe(&quot;new Uint8Array(decryptionResult)&quot;, &quot;plaintext&quot;);
-
-    debug(&quot;Testing initialization vector bindings...&quot;);
-    shouldThrow(&quot;crypto.subtle.encrypt({name: 'AES-CBC', iv: null}, key, plaintext)&quot;);
-    shouldThrow(&quot;crypto.subtle.encrypt({name: 'AES-CBC'}, key, plaintext)&quot;);
-    shouldThrow(&quot;crypto.subtle.encrypt({name: 'AES-CBC', iv: 3}, key, plaintext)&quot;);
-    shouldThrow(&quot;crypto.subtle.encrypt({name: 'AES-CBC', iv: new Uint8Array([0])}, key, plaintext)&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcgeneratekeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-Test generating an AES key using AES-CBC algorithm.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS crypto.subtle.generateKey(&quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]) threw exception TypeError: Type error.
-PASS crypto.subtle.generateKey({name: &quot;aes-cbc&quot;}, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]) threw exception TypeError: Value NaN is outside the range [0, 65535].
-PASS crypto.subtle.generateKey({name: &quot;aes-cbc&quot;, length: undefined}, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]) threw exception TypeError: Value NaN is outside the range [0, 65535].
-PASS crypto.subtle.generateKey({name: &quot;aes-cbc&quot;, length: {}}, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]) threw exception TypeError: Value NaN is outside the range [0, 65535].
-Generating 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']
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcgeneratekeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,39 +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 an AES key using AES-CBC algorithm.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-shouldThrow('crypto.subtle.generateKey(&quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;])');
-shouldThrow('crypto.subtle.generateKey({name: &quot;aes-cbc&quot;}, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;])');
-shouldThrow('crypto.subtle.generateKey({name: &quot;aes-cbc&quot;, length: undefined}, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;])');
-shouldThrow('crypto.subtle.generateKey({name: &quot;aes-cbc&quot;, length: {}}, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;])');
-
-debug(&quot;Generating a key...&quot;);
-crypto.subtle.generateKey({name: &quot;aes-cbc&quot;, length: 128}, extractable, [&quot;encrypt&quot;, &quot;decrypt&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']&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportjwkexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-Test importing a JWK key for AES-CBC.
-
-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 192
-PASS key.usages is [&quot;encrypt&quot;]
-
-Using the key to encrypt plaintext...
-PASS bytesToHexString(new Uint8Array(encryptionResult)) is '4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcimportjwkhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,52 +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 importing a JWK key for AES-CBC.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
-var plaintext = hexStringToUint8Array(&quot;6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710&quot;);
-
-var jwkKey = {
-    &quot;kty&quot;: &quot;oct&quot;,
-    &quot;alg&quot;: &quot;A192CBC&quot;,
-    &quot;use&quot;: &quot;enc&quot;,
-    &quot;ext&quot;: true,
-    &quot;k&quot;: &quot;jnOw99oOZFLIEPMrgJB55WL46tJSLGt7&quot;
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
-
-debug(&quot;Importing a key...\n&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, null, false, [&quot;encrypt&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;192&quot;);
-    shouldBe(&quot;key.usages&quot;, '[&quot;encrypt&quot;]');
-
-    debug(&quot;\nUsing the key to encrypt plaintext...&quot;);
-    return crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext);
-}).then(function(result) {
-    encryptionResult = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(encryptionResult))&quot;, &quot;'4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcinvalidlengthexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,17 +0,0 @@
</span><del>-Test an unsupported AES key length.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing a raw AES key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'AES-CBC'
-PASS key.algorithm.length is 176
-PASS key.usages is ['decrypt', 'encrypt']
-Using the key to encrypt plaintext...
-Failed, as expected. Note that the spec doesn't appear to clearly define which step should fail.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcinvalidlengthhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,41 +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 an unsupported AES key length.&quot;);
-
-jsTestIsAsync = true;
-
-var keyData = hexStringToUint8Array(&quot;8e73b0f7da0e6452c810f32b809079e562f8ead2522c&quot;);
-var iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
-var plaintext = hexStringToUint8Array(&quot;6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710&quot;);
-var extractable = true;
-
-debug(&quot;Importing a raw AES key from string literal...&quot;);
-crypto.subtle.importKey(&quot;raw&quot;, keyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&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;176&quot;);
-    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
-
-    debug(&quot;Using the key to encrypt plaintext...&quot;);
-    return crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, [plaintext]);
-}).then(undefined, function(result) {
-    debug(&quot;Failed, as expected. Note that the spec doesn't appear to clearly define which step should fail.&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcunwrapfailureexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,13 +0,0 @@
</span><del>-Test unwrapping an RSA key with AES-CBC.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing an unwrapping key...
-PASS unwrappingKey.algorithm.name is 'AES-CBC'
-Unwrapping a key...
-PASS Promise rejected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcunwrapfailurehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,38 +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 unwrapping an RSA key with AES-CBC.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var unwrappingKeyOctets = hexStringToUint8Array(&quot;2a00e0e776e94e4dc89bf947cebdebe1&quot;);
-var wrappedKey = hexStringToUint8Array(&quot;b490dedb3abc3fd545e146538e6cc3ca&quot;); // An empty encrypted JSON.
-
-debug(&quot;Importing an unwrapping key...&quot;);
-crypto.subtle.importKey(&quot;raw&quot;, unwrappingKeyOctets, &quot;AES-CBC&quot;, nonExtractable, [&quot;unwrapKey&quot;]).then(function(result) {
-    unwrappingKey = result;
-    shouldBe(&quot;unwrappingKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
-    var unwrapAlgorithm = {name: &quot;AES-CBC&quot;, iv: hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;)};
-    debug(&quot;Unwrapping a key...&quot;);
-    return crypto.subtle.unwrapKey(&quot;jwk&quot;, wrappedKey, unwrappingKey, unwrapAlgorithm, null, extractable, [&quot;sign&quot;, &quot;verify&quot;, &quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrap&quot;, &quot;unwrap&quot;]);
-}).then(undefined, function(result) {
-    testPassed(&quot;Promise rejected&quot;);
-    finishJSTest();
-});
-
-&lt;/script&gt;
-
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcunwraprsaexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,20 +0,0 @@
</span><del>-Test unwrapping an RSA key with AES-CBC.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing an unwrapping key...
-PASS unwrappingKey.algorithm.name is 'AES-CBC'
-Unwrapping a key...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'public'
-PASS unwrappedKey.usages is ['sign','verify']
-PASS unwrappedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS unwrappedKey.algorithm.modulusLength is 2048
-PASS Base64URL.stringify(unwrappedKey.algorithm.publicExponent) is publicKeyJSON.e
-PASS unwrappedKey.algorithm.hash.name is 'SHA-256'
-PASS unwrappedKey.extractable is false
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcunwraprsahtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,56 +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 unwrapping an RSA key with AES-CBC.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var publicKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RS256&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;,
-    ext: false,
-    use: &quot;sig&quot;
-};
-
-var unwrappingKeyOctets = hexStringToUint8Array(&quot;2a00e0e776e94e4dc89bf947cebdebe1&quot;);
-var wrappedKey = hexStringToUint8Array(&quot;3511f6028db04ea97e7cfad3c4cc60837bceff25cb6c88292fbcb4547570afdc32e4003fe4d65f1e7df60dc1fdb3df36c3f58ab228e33aa31005852d46d0c2ad1318435a071bbb5bbb05650ea63d551698b0c040dd95ed0d379b5e2eccb545ae5620acb8051174cd2ad647328ad99dcd462fec40748724eb1e68f209f779faa2c35b4d4d1b6604a74e62a1846249ea6192954a5af10c71ebfea79948142441ed307e9f52e797a51a8007a6f87b57c51f9e7eef54b7e4a1f818ba6ac25ee5935c23b3253d6d9d222262c79ccdb7147d9c07527c22fe7a4ab91af20479edf5930b3c053c0a0b27092cfb53203633d01dcf6e333b5be7c1933c321c953f962b934ebefd9df8cca6c0a25fcd5fb96105435c42d9902406f82bc8daa8ec12fa85d9afa65adbfe3f60828ef64adaf43ad8e3b0af104cbfafd994323732bba08f84d5cac1d157b276233dffecafe47942b83c85ead6d5886c6badf534d4a32d3f545e8032dd5e419d7bff3acde2c37a96fc34fda8747d89500bf9f7ef45873c6b3b2741aaf74ff96a2f950028f38eb62f1be936fe0a994ebfa928021c0c96172d84584e&quot;);
-
-debug(&quot;Importing an unwrapping key...&quot;);
-crypto.subtle.importKey(&quot;raw&quot;, unwrappingKeyOctets, &quot;AES-CBC&quot;, nonExtractable, [&quot;unwrapKey&quot;]).then(function(result) {
-    unwrappingKey = result;
-    shouldBe(&quot;unwrappingKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
-    var unwrapAlgorithm = {name: &quot;AES-CBC&quot;, iv: hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;)};
-    debug(&quot;Unwrapping a key...&quot;);
-    return crypto.subtle.unwrapKey(&quot;jwk&quot;, wrappedKey, unwrappingKey, unwrapAlgorithm, null, extractable, [&quot;sign&quot;, &quot;verify&quot;, &quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrap&quot;, &quot;unwrap&quot;]);
-}).then(function(result) {
-    unwrappedKey = result;
-
-    shouldBe(&quot;unwrappedKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
-    shouldBe(&quot;unwrappedKey.type&quot;, &quot;'public'&quot;);
-    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['sign','verify']&quot;);
-    shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
-    shouldBe(&quot;unwrappedKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
-    shouldBe(&quot;Base64URL.stringify(unwrappedKey.algorithm.publicExponent)&quot;, &quot;publicKeyJSON.e&quot;);
-    shouldBe(&quot;unwrappedKey.algorithm.hash.name&quot;, &quot;'SHA-256'&quot;);
-    shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;false&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwraprsaexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-Test wrapping an RSA key with AES-CBC.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing a key to wrap...
-PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
-Importing a key encryption key...
-PASS wrappingKey.algorithm.name is 'AES-CBC'
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwraprsanonextractableexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test wrapping an RSA key with AES-CBC.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing a key to wrap...
-PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
-Importing a key encryption key...
-PASS wrappingKey.algorithm.name is 'AES-CBC'
-wrapping the key...
-PASS Rejected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwraprsanonextractablehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,52 +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 wrapping an RSA key with AES-CBC.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var publicKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RS256&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;,
-    ext: false,
-    use: &quot;sig&quot;
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
-var wrappingKeyOctets = hexStringToUint8Array(&quot;2a00e0e776e94e4dc89bf947cebdebe1&quot;);
-
-debug(&quot;Importing a key to wrap...&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, null, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
-    key = result;
-    shouldBe(&quot;key.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
-    debug(&quot;Importing a key encryption key...&quot;);
-    return crypto.subtle.importKey(&quot;raw&quot;, wrappingKeyOctets, &quot;AES-CBC&quot;, nonExtractable, [&quot;wrapKey&quot;]);
-}).then(function(result) {
-    wrappingKey = result;
-    shouldBe(&quot;wrappingKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
-    var wrapAlgorithm = {name: &quot;AES-CBC&quot;, iv: hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;)};
-    debug(&quot;wrapping the key...&quot;);
-    return crypto.subtle.wrapKey(&quot;jwk&quot;, key, wrappingKey, wrapAlgorithm);
-}).then(undefined, function() {
-    testPassed(&quot;Rejected&quot;);
-    finishJSTest();
-});
-
-&lt;/script&gt;
-
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwraprsahtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,52 +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 wrapping an RSA key with AES-CBC.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var publicKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RS256&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;,
-    ext: true,
-    use: &quot;sig&quot;
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
-var wrappingKeyOctets = hexStringToUint8Array(&quot;2a00e0e776e94e4dc89bf947cebdebe1&quot;);
-
-debug(&quot;Importing a key to wrap...&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, null, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
-    key = result;
-    shouldBe(&quot;key.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
-    debug(&quot;Importing a key encryption key...&quot;);
-    return crypto.subtle.importKey(&quot;raw&quot;, wrappingKeyOctets, &quot;AES-CBC&quot;, nonExtractable, [&quot;wrapKey&quot;]);
-}).then(function(result) {
-    wrappingKey = result;
-    shouldBe(&quot;wrappingKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
-    var wrapAlgorithm = {name: &quot;AES-CBC&quot;, iv: hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;)};
-    return crypto.subtle.wrapKey(&quot;jwk&quot;, key, wrappingKey, wrapAlgorithm);
-}).then(function(result) {
-    wrappedKey = result;
-    shouldBe(&quot;wrappedKey.toString()&quot;, &quot;'[object ArrayBuffer]'&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwrongkeyclassexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,12 +0,0 @@
</span><del>-Test calling AES-CBC encrypt with a HMAC key.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing a raw HMAC key from string literal...
-Using the key to encrypt plaintext...
-PASS crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaescbcwrongkeyclasshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,33 +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 calling AES-CBC encrypt with a HMAC key.&quot;);
-
-jsTestIsAsync = true;
-
-var iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
-var plaintext = hexStringToUint8Array(&quot;6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710&quot;);
-var hmacKey = asciiToUint8Array('a');
-var extractable = true;
-
-debug(&quot;Importing a raw HMAC key from string literal...&quot;);
-crypto.subtle.importKey(&quot;raw&quot;, hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, [&quot;sign&quot;, &quot;verify&quot;, &quot;encrypt&quot;, &quot;decrypt&quot;]).then(function(result) {
-    key = result;
-    debug(&quot;Using the key to encrypt plaintext...&quot;);
-    shouldThrow('crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext)')
-
-    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="trunkLayoutTestscryptosubtleaesexportkeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-export-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-export-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-export-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,38 +0,0 @@
</span><del>-Test exporting an AES key.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS crypto.subtle.exportKey(&quot;raw&quot;) threw exception TypeError: Not enough arguments.
-PASS crypto.subtle.exportKey(&quot;raw&quot;, null) threw exception TypeError: Type error.
-PASS crypto.subtle.exportKey(&quot;raw&quot;, undefined) threw exception TypeError: Type error.
-PASS crypto.subtle.exportKey(&quot;raw&quot;, {}) threw exception TypeError: Type error.
-PASS crypto.subtle.exportKey(&quot;raw&quot;, 1) threw exception TypeError: Type error.
-
-Importing a JWK key...
-PASS crypto.subtle.exportKey(null, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey({}, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(&quot;&quot;, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(&quot;foobar&quot;, key) threw exception TypeError: Unknown key format.
-
-Exporting the key as raw data...
-PASS bytesToHexString(new Uint8Array(exportedData)) is '8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b'
-Exporting the key as JWK...
-PASS exportedJWK.kty is 'oct'
-PASS exportedJWK.k is 'jnOw99oOZFLIEPMrgJB55WL46tJSLGt7'
-PASS exportedJWK.alg is 'A192CBC'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
-
-Importing a key that's not extractable...
-
-Trying to export as raw...
-PASS Rejected, as expected
-Trying to export as jwk...
-PASS Rejected, as expected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaesexportkeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-export-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-export-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-export-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,86 +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 exporting an AES key.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var jwkKey = {
-    kty: &quot;oct&quot;,
-    k: &quot;jnOw99oOZFLIEPMrgJB55WL46tJSLGt7&quot;
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
-
-shouldThrow('crypto.subtle.exportKey(&quot;raw&quot;)');
-shouldThrow('crypto.subtle.exportKey(&quot;raw&quot;, null)');
-shouldThrow('crypto.subtle.exportKey(&quot;raw&quot;, undefined)');
-shouldThrow('crypto.subtle.exportKey(&quot;raw&quot;, {})');
-shouldThrow('crypto.subtle.exportKey(&quot;raw&quot;, 1)');
-
-debug(&quot;\nImporting a JWK key...&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, &quot;AES-CBC&quot;, extractable, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']).then(function(result) {
-    key = result;
-
-    shouldThrow('crypto.subtle.exportKey(null, key)');
-    shouldThrow('crypto.subtle.exportKey(undefined, key)');
-    shouldThrow('crypto.subtle.exportKey({}, key)');
-    shouldThrow('crypto.subtle.exportKey(&quot;&quot;, key)');
-    shouldThrow('crypto.subtle.exportKey(&quot;foobar&quot;, key)');
-
-    debug(&quot;\nExporting the key as raw data...&quot;);
-    return crypto.subtle.exportKey(&quot;raw&quot;, key);
-}).then(function(result) {
-    exportedData = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(exportedData))&quot;, &quot;'8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b'&quot;);
-
-    debug(&quot;Exporting the key as JWK...&quot;);
-    return crypto.subtle.exportKey(&quot;jwk&quot;, key);
-}).then(function(result) {
-    exportedJWK = JSON.parse(bytesToASCIIString(result));
-    shouldBe(&quot;exportedJWK.kty&quot;, &quot;'oct'&quot;);
-    shouldBe(&quot;exportedJWK.k&quot;, &quot;'jnOw99oOZFLIEPMrgJB55WL46tJSLGt7'&quot;);
-    shouldBe(&quot;exportedJWK.alg&quot;, &quot;'A192CBC'&quot;);
-    shouldBe(&quot;exportedJWK.ext&quot;, &quot;true&quot;);
-    shouldBe(&quot;exportedJWK.use&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;exportedJWK.key_ops&quot;, &quot;['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']&quot;);
-
-    debug(&quot;\nImporting a key that's not extractable...&quot;);
-    return crypto.subtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, &quot;AES-CBC&quot;, nonExtractable, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'])
-}).then(function(result) {
-    key = result;
-
-    debug(&quot;\nTrying to export as raw...&quot;);
-    return crypto.subtle.exportKey(&quot;raw&quot;, key);
-}).then(function(result) {
-    testFailed(&quot;Promise wasn't rejected&quot;);
-    finishJSTest();
-}, function() {
-    testPassed(&quot;Rejected, as expected&quot;);
-
-    debug(&quot;Trying to export as jwk...&quot;);
-    return crypto.subtle.exportKey(&quot;jwk&quot;, key);
-}).then(function(result) {
-    testFailed(&quot;Promise wasn't rejected&quot;);
-    finishJSTest();
-}, function() {
-    testPassed(&quot;Rejected, as expected&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwkeymanipulationexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,25 +0,0 @@
</span><del>-Test generating, importing and exporting keys for AES-KW. Test that they can't be used with another algorithm.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Generating a key...
-PASS key.toString() is '[object CryptoKey]'
-PASS key.type is 'secret'
-PASS key.algorithm.name is 'AES-KW'
-PASS key.algorithm.length is 256
-
-Testing that the key can't be used with AES-CBC...
-PASS crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, hexStringToUint8Array(&quot;00&quot;)) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-
-Exporting the key to raw...
-PASS exportedKey.toString() is '[object ArrayBuffer]'
-Importing it back...
-PASS importedKey.toString() is '[object CryptoKey]'
-PASS importedKey.type is 'secret'
-PASS importedKey.algorithm.name is 'AES-KW'
-PASS importedKey.algorithm.length is 256
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwkeymanipulationhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,51 +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, importing and exporting keys for AES-KW. Test that they can't be used with another algorithm.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-debug(&quot;Generating a key...&quot;);
-crypto.subtle.generateKey({name: &quot;aes-kw&quot;, length: 256}, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
-    key = result;
-    shouldBe(&quot;key.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
-    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
-    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-KW'&quot;);
-    shouldBe(&quot;key.algorithm.length&quot;, &quot;256&quot;);
-
-    debug(&quot;\nTesting that the key can't be used with AES-CBC...&quot;);
-    iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
-    shouldThrow('crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, hexStringToUint8Array(&quot;00&quot;))');
-
-    debug(&quot;\nExporting the key to raw...&quot;);
-    return crypto.subtle.exportKey('raw', key);
-}).then(function(result) {
-    exportedKey = result;
-    shouldBe(&quot;exportedKey.toString()&quot;, &quot;'[object ArrayBuffer]'&quot;);
-    debug(&quot;Importing it back...&quot;);
-    return crypto.subtle.importKey('raw', exportedKey, &quot;aes-kw&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]);
-}).then(function(result) {
-    importedKey = result;
-
-    shouldBe(&quot;importedKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
-    shouldBe(&quot;importedKey.type&quot;, &quot;'secret'&quot;);
-    shouldBe(&quot;importedKey.algorithm.name&quot;, &quot;'AES-KW'&quot;);
-    shouldBe(&quot;importedKey.algorithm.length&quot;, &quot;256&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwwrapunwrapaesexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,22 +0,0 @@
</span><del>-Test wrapping and unwrapping keys with AES-KW.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing key encryption key...
-Importing a key to be wrapped...
-Wrapping it...
-PASS bytesToHexString(wrappedKey) is '1fa68b0a8112b447aef34bd8fb5a7b829d3e862371d2cfe5'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 128
-PASS unwrappedKey.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(keyData)
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaeskwwrapunwrapaeshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,58 +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 wrapping and unwrapping keys with AES-KW.&quot;);
-
-jsTestIsAsync = true;
-
-var kekData = hexStringToUint8Array(&quot;000102030405060708090A0B0C0D0E0F&quot;);
-var keyData = hexStringToUint8Array(&quot;00112233445566778899AABBCCDDEEFF&quot;);
-var extractable = true;
-
-debug(&quot;Importing key encryption key...&quot;);
-crypto.subtle.importKey(&quot;raw&quot;, kekData, &quot;aes-kw&quot;, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
-    kek = result;
-
-    debug(&quot;Importing a key to be wrapped...&quot;);
-    return crypto.subtle.importKey(&quot;raw&quot;, keyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]);
-}).then(function(result) {
-    key = result;
-
-    debug(&quot;Wrapping it...&quot;);
-    return crypto.subtle.wrapKey(&quot;raw&quot;, key, kek, &quot;aes-kw&quot;);
-}).then(function(result) {
-    wrappedKey = result;
-    shouldBe(&quot;bytesToHexString(wrappedKey)&quot;, &quot;'1fa68b0a8112b447aef34bd8fb5a7b829d3e862371d2cfe5'&quot;); // Result from RFC 3394.
-
-    debug(&quot;Unwrapping it...&quot;);
-    return crypto.subtle.unwrapKey(&quot;raw&quot;, wrappedKey, kek, &quot;aes-kw&quot;, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]);
-}).then(function(result) {
-    unwrappedKey = result;
-    shouldBe(&quot;unwrappedKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
-    shouldBe(&quot;unwrappedKey.type&quot;, &quot;'secret'&quot;);
-    shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
-    shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
-    shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;128&quot;);
-    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']&quot;);
-
-    debug(&quot;Exporting it...&quot;);
-    return crypto.subtle.exportKey(&quot;raw&quot;, unwrappedKey);
-}).then(function(result) {
-    unwrappedKeyData = result;
-    shouldBe(&quot;bytesToHexString(unwrappedKeyData)&quot;, &quot;bytesToHexString(keyData)&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaespostMessageexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-Test sending crypto keys via postMessage.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-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 [&quot;decrypt&quot;, &quot;encrypt&quot;]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleaespostMessagehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/aes-postMessage.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/aes-postMessage.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/aes-postMessage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test sending crypto keys via postMessage.&quot;);
-
-jsTestIsAsync = true;
-
-window.addEventListener(&quot;message&quot;, function(evt) {
-    key = evt.data;
-    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&quot;, &quot;encrypt&quot;]');
-
-    finishJSTest();
-}, false);
-
-crypto.subtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;16 bytes of key!&quot;), {name: &quot;aes-cbc&quot;, length: 128}, true, [&quot;encrypt&quot;, &quot;decrypt&quot;]).then(function(key) {
-    postMessage(key, &quot;*&quot;);
-});
-&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="trunkLayoutTestscryptosubtleargumentconversionexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/argument-conversion-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/argument-conversion-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/argument-conversion-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,38 +0,0 @@
</span><del>-Test crypto.subtle argument conversion
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-
-Passing algorithm name as a string object...
-PASS ...succeeded
-
-Passing algorithm name as a string object in a dictionary...
-PASS ...succeeded
-
-Passing algorithm name as an object with toString
-PASS ...succeeded
-
-Passing invalid data to digest()
-PASS crypto.subtle.digest({name: 'sha-1'}) threw exception TypeError: Not enough arguments.
-PASS crypto.subtle.digest({name: 'sha-1'}, null) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.subtle.digest({name: 'sha-1'}, 10) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.subtle.digest({name: 'sha-1'}, [10]) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-PASS crypto.subtle.digest({name: 'sha-1'}, [new Uint8Array([0])]) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
-
-Passing invalid algorithmIdentifiers to digest()
-PASS crypto.subtle.digest({ toString:function() { return 'sha-1' } }, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest({name: ''}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest({name: null}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest({name: undefined}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest({name: 'sha'}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest({name: 1}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest('', data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest(null, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest(undefined, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest(1, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.digest({}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleargumentconversionhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/argument-conversion.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/argument-conversion.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/argument-conversion.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,56 +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 crypto.subtle argument conversion&quot;);
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
-    debug(&quot;\nPassing algorithm name as a string object...&quot;);
-    return crypto.subtle.digest(new String('sha-1'), new Uint8Array([]));
-}).then(function(result) {
-    testPassed(&quot;...succeeded&quot;);
-    debug(&quot;\nPassing algorithm name as a string object in a dictionary...&quot;);
-    return crypto.subtle.digest({name: new String('sha-1')}, new Uint8Array([]));
-}).then(function(result) {
-    testPassed(&quot;...succeeded&quot;);
-    debug(&quot;\nPassing algorithm name as an object with toString&quot;);
-    return crypto.subtle.digest({name: { toString:function() { return 'sha-1' } } }, new Uint8Array([]));
-}).then(function(result) {
-    testPassed(&quot;...succeeded&quot;);
-
-    debug(&quot;\nPassing invalid data to digest()&quot;);
-    shouldThrow(&quot;crypto.subtle.digest({name: 'sha-1'})&quot;);
-    shouldThrow(&quot;crypto.subtle.digest({name: 'sha-1'}, null)&quot;);
-    shouldThrow(&quot;crypto.subtle.digest({name: 'sha-1'}, 10)&quot;);
-    shouldThrow(&quot;crypto.subtle.digest({name: 'sha-1'}, [10])&quot;);
-    shouldThrow(&quot;crypto.subtle.digest({name: 'sha-1'}, [new Uint8Array([0])])&quot;);
-
-    debug(&quot;\nPassing invalid algorithmIdentifiers to digest()&quot;);
-    data = new Uint8Array([0]);
-    shouldThrow(&quot;crypto.subtle.digest({ toString:function() { return 'sha-1' } }, data)&quot;); // Algorithm normalization doesn't attempt to call toString.
-    shouldThrow(&quot;crypto.subtle.digest({name: ''}, data)&quot;);
-    shouldThrow(&quot;crypto.subtle.digest({name: null}, data)&quot;);
-    shouldThrow(&quot;crypto.subtle.digest({name: undefined}, data)&quot;);
-    shouldThrow(&quot;crypto.subtle.digest({name: 'sha'}, data)&quot;);
-    shouldThrow(&quot;crypto.subtle.digest({name: 1}, data)&quot;);
-    shouldThrow(&quot;crypto.subtle.digest('', data)&quot;);
-    shouldThrow(&quot;crypto.subtle.digest(null, data)&quot;);
-    shouldThrow(&quot;crypto.subtle.digest(undefined, data)&quot;);
-    shouldThrow(&quot;crypto.subtle.digest(1, data)&quot;);
-    shouldThrow(&quot;crypto.subtle.digest({}, data)&quot;);
-}).then(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="trunkLayoutTestscryptosubtlearraybufferviewoffsetexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,10 +0,0 @@
</span><del>-Test that an ArrayBufferView with offset is processed correctly.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS bytesToHexString(new Uint8Array(digest)) is '2c7e7c384f7829694282b1e3a6216def8082d055'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlearraybufferviewoffsethtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,30 +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 that an ArrayBufferView with offset is processed correctly.&quot;);
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
-    var originalData = new Uint8Array([0xf, 0xf, 0xf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0xf, 0xf, 0xf]);
-    var slicedData = new Uint8Array(originalData.buffer, 3, 11);
-    return crypto.subtle.digest({name: 'sha-1'}, slicedData);
-}).then(function(result) {
-    digest = result;
-    // Expected result for [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'2c7e7c384f7829694282b1e3a6216def8082d055'&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlecryptokeyalgorithmgcexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,13 +0,0 @@
</span><del>-Test that CryptoKey.algorithm preserves custom properties.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-
-Generating a HMAC key with default length...
-PASS key.algorithm === key.algorithm is true
-PASS key.algorithm.foo is &quot;bar&quot;
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlecryptokeyalgorithmgchtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test that CryptoKey.algorithm preserves custom properties.&quot;);
-jsTestIsAsync = true;
-
-debug(&quot;\nGenerating a HMAC key with default length...&quot;);
-crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, true, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
-    key = result;
-    startTest();
-});
-
-function startTest()
-{
-    shouldBeTrue(&quot;key.algorithm === key.algorithm&quot;);
-    key.algorithm.foo = &quot;bar&quot;;
-    gc();
-    setTimeout(continueTest, 10);
-}
-
-function continueTest()
-{
-    gc();
-    setTimeout(finishTest, 10);
-}
-
-function finishTest()
-{
-    gc();
-    shouldBeEqualToString('key.algorithm.foo', 'bar');
-    finishJSTest();
-}
-
-&lt;/script&gt;
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlecryptokeyusagesgcexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,13 +0,0 @@
</span><del>-Test that CryptoKey.usages preserves custom properties.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-
-Generating a HMAC key with default length...
-PASS key.usages === key.usages is true
-PASS key.usages.foo is &quot;bar&quot;
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlecryptokeyusagesgchtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test that CryptoKey.usages preserves custom properties.&quot;);
-jsTestIsAsync = true;
-
-debug(&quot;\nGenerating a HMAC key with default length...&quot;);
-crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, true, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
-    key = result;
-    startTest();
-});
-
-function startTest()
-{
-    shouldBeTrue(&quot;key.usages === key.usages&quot;);
-    key.usages.foo = &quot;bar&quot;;
-    gc();
-    setTimeout(continueTest, 10);
-}
-
-function continueTest()
-{
-    gc();
-    setTimeout(finishTest, 10);
-}
-
-function finishTest()
-{
-    gc();
-    shouldBeEqualToString('key.usages.foo', 'bar');
-    finishJSTest();
-}
-
-&lt;/script&gt;
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegc2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/gc-2-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/gc-2-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+Test that window.crypto.subtle wrapper preserves custom properties.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS [object Crypto] is defined.
+PASS [object SubtleCrypto] is defined.
+PASS anotherWindowCrypto.subtle.foo is &quot;bar&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegc2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/gc-2.html (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-2.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/gc-2.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test that window.crypto.subtle wrapper preserves custom properties.&quot;);
+jsTestIsAsync = true;
+
+var anotherWindowCrypto;
+
+function startTest()
+{
+    anotherWindowCrypto = frames[0].crypto;
+    shouldBeDefined(anotherWindowCrypto);
+    shouldBeDefined(anotherWindowCrypto.subtle);
+
+    anotherWindowCrypto.subtle.foo = &quot;bar&quot;;
+    document.body.removeChild(document.getElementsByTagName(&quot;iframe&quot;)[0]);
+    gc();
+    setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+    gc();
+    setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+    gc();
+    shouldBe('anotherWindowCrypto.subtle.foo', '&quot;bar&quot;');
+    finishJSTest();
+}
+
+window.onload = startTest;
+
+&lt;/script&gt;
+&lt;iframe src=&quot;about:blank&quot;&gt;&lt;/iframe&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="trunkLayoutTestscryptosubtlegc3expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/gc-3-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-3-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/gc-3-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Test that window.crypto wrapper protects all dependencies, so it can always be used to get crypto.subtle.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS [object Crypto] is defined.
+PASS [object SubtleCrypto] is defined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegc3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/gc-3.html (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-3.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/gc-3.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test that window.crypto wrapper protects all dependencies, so it can always be used to get crypto.subtle.&quot;);
+jsTestIsAsync = true;
+
+var anotherWindowCrypto;
+
+function startTest()
+{
+    anotherWindowCrypto = frames[0].crypto;
+    shouldBeDefined(anotherWindowCrypto);
+    document.body.removeChild(document.getElementsByTagName(&quot;iframe&quot;)[0]);
+    gc();
+    setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+    gc();
+    setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+    gc();
+    shouldBeDefined(anotherWindowCrypto.subtle);
+    finishJSTest();
+}
+
+window.onload = startTest;
+
+&lt;/script&gt;
+&lt;iframe src=&quot;about:blank&quot;&gt;&lt;/iframe&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="trunkLayoutTestscryptosubtlegcexpectedtxtfromrev206882trunkLayoutTestscryptosubtleunimplementedunwrapcrashexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/subtle/gc-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/gc-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Test that window.crypto.subtle wrapper preserves custom properties.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS window.crypto.subtle.foo is &quot;bar&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegchtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/subtle/gc.html (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc.html                                (rev 0)
+++ trunk/LayoutTests/crypto/subtle/gc.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test that window.crypto.subtle wrapper preserves custom properties.&quot;);
+jsTestIsAsync = true;
+
+function startTest()
+{
+    window.crypto.subtle.foo = &quot;bar&quot;;
+    gc();
+    setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+    gc();
+    setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+    gc();
+    shouldBe('window.crypto.subtle.foo', '&quot;bar&quot;');
+    finishJSTest();
+}
+
+window.onload = startTest;
+
+&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="trunkLayoutTestscryptosubtlehmaccheckalgorithmexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-check-algorithm-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-check-algorithm-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-check-algorithm-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test that HMAC operations only work when hash functions match between invocation and key.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing a raw HMAC SHA-1 key from string literal...
-Done
-PASS crypto.subtle.sign({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('foo')) did not throw exception.
-PASS crypto.subtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('foo')) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.verify({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo')) did not throw exception.
-PASS crypto.subtle.verify({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo')) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmaccheckalgorithmhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-check-algorithm.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-check-algorithm.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-check-algorithm.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,36 +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 that HMAC operations only work when hash functions match between invocation and key.&quot;);
-
-jsTestIsAsync = true;
-
-var hmacKey = asciiToUint8Array('a');
-var extractable = true;
-
-debug(&quot;Importing a raw HMAC SHA-1 key from string literal...&quot;);
-crypto.subtle.importKey(&quot;raw&quot;, hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
-    debug(&quot;Done&quot;);
-    key = result;
-
-    shouldNotThrow(&quot;crypto.subtle.sign({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('foo'))&quot;);
-    shouldThrow(&quot;crypto.subtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('foo'))&quot;);
-
-    shouldNotThrow(&quot;crypto.subtle.verify({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo'))&quot;);
-    shouldThrow(&quot;crypto.subtle.verify({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo'))&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacexportkeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-export-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-export-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-export-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,31 +0,0 @@
</span><del>-Test exporting an AES key.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing a JWK key...
-PASS crypto.subtle.exportKey(null, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey({}, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(&quot;&quot;, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(&quot;foobar&quot;, key) threw exception TypeError: Unknown key format.
-Exporting the key as raw data...
-PASS bytesToHexString(new Uint8Array(exportedData)) is '6a18e49feff7f3b7e09ec89b7f6deab2f6a18e49feff7f3b7e09ec89b7f6deab'
-Exporting the key as JWK...
-PASS exportedJWK.kty is 'oct'
-PASS exportedJWK.k is 'ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs'
-PASS exportedJWK.alg is 'HS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['sign', 'verify']
-
-Importing a key that's not extractable...
-
-Trying to export as raw...
-PASS Rejected, as expected
-Trying to export as jwk...
-PASS Rejected, as expected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacexportkeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-export-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-export-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-export-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,80 +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 exporting an AES key.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var jwkKey = {
-    &quot;kty&quot;: &quot;oct&quot;,
-    &quot;k&quot;: &quot;ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs&quot;
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
-
-debug(&quot;Importing a JWK key...&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, { name: &quot;HMAC&quot;, hash: &quot;SHA-256&quot; }, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
-    key = result;
-
-    shouldThrow('crypto.subtle.exportKey(null, key)');
-    shouldThrow('crypto.subtle.exportKey(undefined, key)');
-    shouldThrow('crypto.subtle.exportKey({}, key)');
-    shouldThrow('crypto.subtle.exportKey(&quot;&quot;, key)');
-    shouldThrow('crypto.subtle.exportKey(&quot;foobar&quot;, key)');
-
-    debug(&quot;Exporting the key as raw data...&quot;);
-    return crypto.subtle.exportKey(&quot;raw&quot;, key);
-}).then(function(result) {
-    exportedData = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(exportedData))&quot;, &quot;'6a18e49feff7f3b7e09ec89b7f6deab2f6a18e49feff7f3b7e09ec89b7f6deab'&quot;);
-
-    debug(&quot;Exporting the key as JWK...&quot;);
-    return crypto.subtle.exportKey(&quot;jwk&quot;, key);
-}).then(function(result) {
-    exportedJWK = JSON.parse(bytesToASCIIString(result));
-    shouldBe(&quot;exportedJWK.kty&quot;, &quot;'oct'&quot;);
-    shouldBe(&quot;exportedJWK.k&quot;, &quot;'ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs'&quot;);
-    shouldBe(&quot;exportedJWK.alg&quot;, &quot;'HS256'&quot;);
-    shouldBe(&quot;exportedJWK.ext&quot;, &quot;true&quot;);
-    shouldBe(&quot;exportedJWK.use&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;exportedJWK.key_ops&quot;, &quot;['sign', 'verify']&quot;);
-
-    debug(&quot;\nImporting a key that's not extractable...&quot;);
-    return crypto.subtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, { name: &quot;HMAC&quot;, hash: &quot;SHA-256&quot; }, nonExtractable, [&quot;sign&quot;, &quot;verify&quot;]);
-}).then(function(result) {
-    key = result;
-
-    debug(&quot;\nTrying to export as raw...&quot;);
-    return crypto.subtle.exportKey(&quot;raw&quot;, key);
-}).then(function(result) {
-    testFailed(&quot;Promise wasn't rejected&quot;);
-    finishJSTest();
-}, function() {
-    testPassed(&quot;Rejected, as expected&quot;);
-
-    debug(&quot;Trying to export as jwk...&quot;);
-    return crypto.subtle.exportKey(&quot;jwk&quot;, key);
-}).then(function(result) {
-    testFailed(&quot;Promise wasn't rejected&quot;);
-    finishJSTest();
-}, function() {
-    testPassed(&quot;Rejected, as expected&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacgeneratekeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-generate-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-generate-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-generate-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,29 +0,0 @@
</span><del>-Test generating a HMAC key.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS crypto.subtle.generateKey(&quot;hmac&quot;, extractable, [&quot;sign&quot;, &quot;verify&quot;]) threw exception TypeError: Type error.
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, length: undefined}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.generateKey({name: &quot;hmac&quot;, length: {}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-
-Generating a key with default length...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 64
-PASS key.algorithm.hash.name is 'SHA-1'
-PASS key.usages is [&quot;sign&quot;, &quot;verify&quot;]
-
-Generating a key with custom length...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 5
-PASS key.algorithm.hash.name is 'SHA-1'
-PASS key.usages is [&quot;sign&quot;]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacgeneratekeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-generate-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-generate-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-generate-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,51 +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 HMAC key.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-shouldThrow('crypto.subtle.generateKey(&quot;hmac&quot;, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldThrow('crypto.subtle.generateKey({name: &quot;hmac&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldThrow('crypto.subtle.generateKey({name: &quot;hmac&quot;, length: undefined}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldThrow('crypto.subtle.generateKey({name: &quot;hmac&quot;, length: {}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-
-debug(&quot;\nGenerating a key with default length...&quot;);
-crypto.subtle.generateKey({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;64&quot;);
-    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
-    shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
-
-    debug(&quot;\nGenerating a key with custom length...&quot;);
-    return crypto.subtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: 5}, extractable, [&quot;sign&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;5&quot;);
-    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
-    shouldBe(&quot;key.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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,22 +0,0 @@
</span><del>-Test importing a JWK key for HMAC.
-
-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 32
-PASS key.usages is [&quot;sign&quot;, &quot;verify&quot;]
-
-Using the key to sign message 'foo'...
-PASS bytesToHexString(new Uint8Array(signature)) is 'e03736fe098892b2a2da77812431f7c014d32e2fd69f3bcff883ac923a8fa2da'
-
-Verifying the signature...
-PASS verificationResult is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacimportjwkhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-import-jwk.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-import-jwk.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,55 +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 importing a JWK key for HMAC.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var hmacKey = {
-    &quot;kty&quot;: &quot;oct&quot;,
-    &quot;alg&quot;: &quot;HS256&quot;,
-    &quot;use&quot;: &quot;sig&quot;,
-    &quot;ext&quot;: false,
-    &quot;k&quot;: &quot;ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs&quot;
-};
-
-var hmacKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(hmacKey));
-
-debug(&quot;Importing a key...\n&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, hmacKeyAsArrayBuffer, null, 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;false&quot;);
-    shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
-    shouldBe(&quot;key.algorithm.length&quot;, &quot;32&quot;);
-    shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
-
-    debug(&quot;\nUsing the key to sign message 'foo'...&quot;);
-    return crypto.subtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
-}).then(function(result) {
-    signature = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(signature))&quot;, &quot;'e03736fe098892b2a2da77812431f7c014d32e2fd69f3bcff883ac923a8fa2da'&quot;);
-
-    debug(&quot;\nVerifying the signature...&quot;);
-    return crypto.subtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
-}).then(function(result) {
-    verificationResult = result;
-    shouldBe(&quot;verificationResult&quot;, &quot;true&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacpostMessageexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-Test sending crypto keys via postMessage.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 16
-PASS key.usages is [&quot;sign&quot;, &quot;verify&quot;]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacpostMessagehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-postMessage.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-postMessage.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-postMessage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test sending crypto keys via postMessage.&quot;);
-
-jsTestIsAsync = true;
-
-window.addEventListener(&quot;message&quot;, function(evt) {
-    key = evt.data;
-    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;16&quot;);
-    shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
-
-    finishJSTest();
-}, false);
-
-crypto.subtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;16 bytes of key!&quot;), {name: 'hmac', hash: {name: 'sha-1'}}, true, ['sign', 'verify']).then(function(key) {
-    postMessage(key, &quot;*&quot;);
-});
-&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="trunkLayoutTestscryptosubtlehmacsignverifyemptykeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,20 +0,0 @@
</span><del>-Test HMAC sign and verify functions with an empty key.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing a raw HMAC key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 0
-PASS key.algorithm.hash.name is 'SHA-1'
-PASS key.usages is ['sign', 'verify']
-Using the key to sign 'foo'...
-PASS bytesToHexString(new Uint8Array(signature)) is 'a3cc770fc033e2cb419d42b64e0081a3bd3be30e'
-Verifying the signature...
-PASS verificationResult is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacsignverifyemptykeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,46 +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 HMAC sign and verify functions with an empty key.&quot;);
-
-jsTestIsAsync = true;
-
-var hmacKey = asciiToUint8Array('');
-var extractable = true;
-
-debug(&quot;Importing a raw HMAC key from string literal...&quot;);
-crypto.subtle.importKey(&quot;raw&quot;, hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, 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;0&quot;); // See &lt;https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098&gt;.
-    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
-    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&quot;);
-
-    debug(&quot;Using the key to sign 'foo'...&quot;);
-    return crypto.subtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
-}).then(function(result) {
-    signature = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(signature))&quot;, &quot;'a3cc770fc033e2cb419d42b64e0081a3bd3be30e'&quot;);
-
-    debug(&quot;Verifying the signature...&quot;);
-    return crypto.subtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
-}).then(function(result) {
-    verificationResult = result;
-    shouldBe(&quot;verificationResult&quot;, &quot;true&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacsignverifyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,20 +0,0 @@
</span><del>-Test HMAC sign and verify functions.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing a raw HMAC key from string literal...
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 1
-PASS key.algorithm.hash.name is 'SHA-1'
-PASS key.usages is ['sign', 'verify']
-Using the key to sign 'foo'...
-PASS bytesToHexString(new Uint8Array(signature)) is 'bebbc02e46b0f81183f40c25dce23e5045d65519'
-Verifying the signature...
-PASS verificationResult is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlehmacsignverifyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,46 +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 HMAC sign and verify functions.&quot;);
-
-jsTestIsAsync = true;
-
-var hmacKey = asciiToUint8Array('a');
-var extractable = true;
-
-debug(&quot;Importing a raw HMAC key from string literal...&quot;);
-crypto.subtle.importKey(&quot;raw&quot;, hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, 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;1&quot;); // See &lt;https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098&gt;.
-    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
-    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&quot;);
-
-    debug(&quot;Using the key to sign 'foo'...&quot;);
-    return crypto.subtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
-}).then(function(result) {
-    signature = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(signature))&quot;, &quot;'bebbc02e46b0f81183f40c25dce23e5045d65519'&quot;);
-
-    debug(&quot;Verifying the signature...&quot;);
-    return crypto.subtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
-}).then(function(result) {
-    verificationResult = result;
-    shouldBe(&quot;verificationResult&quot;, &quot;true&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleimportjwkexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/import-jwk-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/import-jwk-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,30 +0,0 @@
</span><del>-Test error handling for JWK import.
-
-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;, asciiToUint8Array(''), null) threw exception TypeError: Invalid JWK serialization.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{'), null) threw exception TypeError: Invalid JWK serialization.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('null'), null) threw exception TypeError: Invalid JWK serialization.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('undefined'), null) threw exception TypeError: Invalid JWK serialization.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{}'), null) threw exception TypeError: Neither key nor function argument has crypto algorithm specified.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{}'), &quot;aes-cbc&quot;) threw exception TypeError: Required JWK &quot;kty&quot; member is missing.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;foobar&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Unsupported JWK key type foobar.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;foobar&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Unsupported JWK algorithm foobar.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), &quot;aes-cbc&quot;) threw exception TypeError: Algorithm specified in key is not compatible with one passed to importKey as argument.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), { name: &quot;hmac&quot;, hash: &quot;sha-1&quot; }) threw exception TypeError: Algorithm specified in key is not compatible with one passed to importKey as argument.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot; }'), null) threw exception TypeError: Secret key data is not present is JWK.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;A128CBC&quot; }'), null) threw exception TypeError: Secret key data is not present is JWK.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;1234&quot; }'), null) threw exception TypeError: Key size is not valid for HS256.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;A128CBC&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;1234&quot; }'), null) threw exception TypeError: Key size is not valid for A128CBC.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;A128CBC&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Key size is not valid for A128CBC.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387f+nsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Cannot decode base64url key data in JWK.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: 1, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Expected a string value for &quot;kty&quot; JSON key.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: 1, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Expected a string value for &quot;alg&quot; JSON key.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: 1, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Expected a string value for &quot;use&quot; JSON key.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: &quot;false&quot;, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Expected a boolean value for &quot;ext&quot; JSON key.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: 1 }'), null) threw exception TypeError: Expected a string value for &quot;k&quot; JSON key.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleimportjwkhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/import-jwk.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/import-jwk.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,51 +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 error handling for JWK import.&quot;);
-
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'\'), null)')
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{\'), null)')
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'null\'), null)')
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'undefined\'), null)')
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{}\'), null)')
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{}\'), &quot;aes-cbc&quot;)')
-
-// Unknown/invalid JWK values.
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;foobar&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;foobar&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
-
-// Algorithm mismatch.
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), &quot;aes-cbc&quot;)')
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), { name: &quot;hmac&quot;, hash: &quot;sha-1&quot; })')
-
-// No key data.
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot; }\'), null)')
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;A128CBC&quot; }\'), null)')
-
-// Key data length is incorrect, not allowed in JWK.
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;1234&quot; }\'), null)')
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;A128CBC&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;1234&quot; }\'), null)')
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;A128CBC&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
-
-// Key data is not valid base64url.
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387f+nsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
-
-// Incorrect data types.
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: 1, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: 1, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: 1, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: &quot;false&quot;, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: 1 }\'), null)')
-&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="trunkLayoutTestscryptosubtlejwkexportusevaluesexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,53 +0,0 @@
</span><del>-Test exporting keys with various usages to JWK.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-encrypt:
-PASS jwk.use is undefined
-PASS jwk.key_ops is [&quot;encrypt&quot;]
-
-decrypt:
-PASS jwk.use is undefined
-PASS jwk.key_ops is [&quot;decrypt&quot;]
-
-encrypt,decrypt:
-PASS jwk.use is undefined
-PASS jwk.key_ops is [&quot;encrypt&quot;,&quot;decrypt&quot;]
-
-wrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is [&quot;wrapKey&quot;]
-
-unwrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is [&quot;unwrapKey&quot;]
-
-wrapKey,unwrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is [&quot;wrapKey&quot;,&quot;unwrapKey&quot;]
-
-encrypt,decrypt,wrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is [&quot;encrypt&quot;,&quot;decrypt&quot;,&quot;wrapKey&quot;]
-
-encrypt,decrypt,wrapKey,unwrapKey:
-PASS jwk.use is undefined
-PASS jwk.key_ops is [&quot;encrypt&quot;,&quot;decrypt&quot;,&quot;wrapKey&quot;,&quot;unwrapKey&quot;]
-
-sign:
-PASS jwk.use is undefined
-PASS jwk.key_ops is [&quot;sign&quot;]
-
-verify:
-PASS jwk.use is undefined
-PASS jwk.key_ops is [&quot;verify&quot;]
-
-sign,verify:
-PASS jwk.use is undefined
-PASS jwk.key_ops is [&quot;sign&quot;,&quot;verify&quot;]
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlejwkexportusevalueshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,64 +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 exporting keys with various usages to JWK.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var aesKeyAsArrayBuffer = Base64URL.parse(&quot;jnOw99oOZFLIEPMrgJB55WL46tJSLGt7&quot;);
-var hmacKeyAsArrayBuffer = Base64URL.parse(&quot;ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs&quot;);
-
-function testWithAESCBC(usages, expectedKeyOps)
-{
-    return crypto.subtle.importKey(&quot;raw&quot;, aesKeyAsArrayBuffer, &quot;AES-CBC&quot;, extractable, usages).then(function(result) {
-        return crypto.subtle.exportKey(&quot;jwk&quot;, result);
-    }).then(function(result) {
-        jwk = JSON.parse(bytesToASCIIString(result));
-        debug(usages + &quot;:&quot;);
-        shouldBe(&quot;jwk.use&quot;, &quot;undefined&quot;);
-        shouldBe(&quot;jwk.key_ops&quot;, JSON.stringify(expectedKeyOps));
-        debug(&quot;&quot;);
-    });
-}
-
-function testWithHMAC(usages, expectedKeyOps)
-{
-    return crypto.subtle.importKey(&quot;raw&quot;, hmacKeyAsArrayBuffer, {name: 'hmac', hash: {name: 'sha-256'}}, extractable, usages).then(function(result) {
-        return crypto.subtle.exportKey(&quot;jwk&quot;, result);
-    }).then(function(result) {
-        jwk = JSON.parse(bytesToASCIIString(result));
-        debug(usages + &quot;:&quot;);
-        shouldBe(&quot;jwk.use&quot;, &quot;undefined&quot;);
-        shouldBe(&quot;jwk.key_ops&quot;, JSON.stringify(expectedKeyOps));
-        debug(&quot;&quot;);
-    });
-}
-
-Promise.all([
-    testWithAESCBC([&quot;encrypt&quot;], [&quot;encrypt&quot;]),
-    testWithAESCBC([&quot;decrypt&quot;], [&quot;decrypt&quot;]),
-    testWithAESCBC([&quot;encrypt&quot;, &quot;decrypt&quot;], [&quot;encrypt&quot;, &quot;decrypt&quot;]),
-    testWithAESCBC([&quot;wrapKey&quot;], [&quot;wrapKey&quot;]),
-    testWithAESCBC([&quot;unwrapKey&quot;], [&quot;unwrapKey&quot;]),
-    testWithAESCBC([&quot;wrapKey&quot;, &quot;unwrapKey&quot;], [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]),
-    testWithAESCBC([&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;], [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;]),
-    testWithAESCBC([&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;], [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]),
-    testWithHMAC([&quot;sign&quot;], [&quot;sign&quot;]),
-    testWithHMAC([&quot;verify&quot;], [&quot;verify&quot;]),
-    testWithHMAC([&quot;sign&quot;, &quot;verify&quot;], [&quot;sign&quot;, &quot;verify&quot;]),
-]).then(function() { 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="trunkLayoutTestscryptosubtlejwkimportusevaluesexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,53 +0,0 @@
</span><del>-Test importing keys with various uses from JWK.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS testWithAESCBC([&quot;encrypt&quot;], {key_ops: [&quot;encrypt&quot;, &quot;encrypt&quot;]}) threw exception TypeError: JWK key_ops contains a duplicate operation.
-
-{&quot;key_ops&quot;:[&quot;encrypt&quot;]}:
-PASS key.usages is [&quot;encrypt&quot;]
-
-{&quot;key_ops&quot;:[&quot;decrypt&quot;]}:
-PASS key.usages is [&quot;decrypt&quot;]
-
-{&quot;key_ops&quot;:[&quot;encrypt&quot;,&quot;decrypt&quot;]}:
-PASS key.usages is [&quot;decrypt&quot;,&quot;encrypt&quot;]
-
-{&quot;key_ops&quot;:[&quot;wrapKey&quot;]}:
-PASS key.usages is [&quot;wrapKey&quot;]
-
-{&quot;key_ops&quot;:[&quot;unwrapKey&quot;]}:
-PASS key.usages is [&quot;unwrapKey&quot;]
-
-{&quot;key_ops&quot;:[&quot;wrapKey&quot;,&quot;unwrapKey&quot;]}:
-PASS key.usages is [&quot;unwrapKey&quot;,&quot;wrapKey&quot;]
-
-{&quot;key_ops&quot;:[&quot;encrypt&quot;,&quot;decrypt&quot;,&quot;wrapKey&quot;]}:
-PASS key.usages is [&quot;decrypt&quot;,&quot;encrypt&quot;,&quot;wrapKey&quot;]
-
-{&quot;use&quot;:&quot;enc&quot;}:
-PASS key.usages is [&quot;decrypt&quot;,&quot;encrypt&quot;,&quot;unwrapKey&quot;,&quot;wrapKey&quot;]
-
-{&quot;key_ops&quot;:[&quot;sign&quot;]}:
-PASS key.usages is [&quot;sign&quot;]
-
-{&quot;key_ops&quot;:[&quot;verify&quot;]}:
-PASS key.usages is [&quot;verify&quot;]
-
-{&quot;use&quot;:&quot;sig&quot;}:
-PASS key.usages is [&quot;sign&quot;,&quot;verify&quot;]
-
-{&quot;key_ops&quot;:[&quot;'encrypt'&quot;]}:
-PASS key.usages is []
-
-{&quot;key_ops&quot;:[&quot;encrypt &quot;]}:
-PASS key.usages is []
-
-{&quot;key_ops&quot;:[&quot;Encrypt&quot;]}:
-PASS key.usages is []
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlejwkimportusevalueshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,95 +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 importing keys with various uses from JWK.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var aesKeyAsJSON = {
-    &quot;alg&quot;: &quot;A192CBC&quot;,
-    &quot;ext&quot;: true,
-    &quot;kty&quot;: &quot;oct&quot;,
-    &quot;k&quot;: &quot;jnOw99oOZFLIEPMrgJB55WL46tJSLGt7&quot;
-};
-
-var hmacKeyAsJSON = {
-    &quot;alg&quot;: &quot;HS256&quot;,
-    &quot;ext&quot;: true,
-    &quot;kty&quot;: &quot;oct&quot;,
-    &quot;k&quot;: &quot;ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs&quot;
-};
-
-function testWithAESCBC(expectedUsages, jwkUsages)
-{
-    if (jwkUsages.key_ops) {
-        aesKeyAsJSON.key_ops = jwkUsages.key_ops;
-        delete aesKeyAsJSON.use;
-    } else {
-        delete aesKeyAsJSON.key_ops;
-        aesKeyAsJSON.use = jwkUsages.use;
-    }
-
-    return crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(aesKeyAsJSON)), &quot;AES-CBC&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
-        key = result;
-        debug(JSON.stringify(jwkUsages) + &quot;:&quot;);
-        shouldBe(&quot;key.usages&quot;, JSON.stringify(expectedUsages));
-        debug(&quot;&quot;);
-    });
-}
-
-function testWithHMAC(expectedUsages, jwkUsages)
-{
-    if (jwkUsages.key_ops) {
-        hmacKeyAsJSON.key_ops = jwkUsages.key_ops;
-        delete hmacKeyAsJSON.use;
-    } else {
-        delete hmacKeyAsJSON.key_ops;
-        hmacKeyAsJSON.use = jwkUsages.use;
-    }
-
-    return crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(hmacKeyAsJSON)), {name: 'hmac', hash: {name: 'sha-256'}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
-        key = result;
-        debug(JSON.stringify(jwkUsages) + &quot;:&quot;);
-        shouldBe(&quot;key.usages&quot;, JSON.stringify(expectedUsages));
-        debug(&quot;&quot;);
-    });
-}
-
-// Duplicates are not allowed. We currently raise an exception, although we should reject the promise instead.
-shouldThrow('testWithAESCBC([&quot;encrypt&quot;], {key_ops: [&quot;encrypt&quot;, &quot;encrypt&quot;]})');
-debug(&quot;&quot;);
-
-Promise.all([
-    testWithAESCBC([&quot;encrypt&quot;], {key_ops: [&quot;encrypt&quot;]}),
-    testWithAESCBC([&quot;decrypt&quot;], {key_ops: [&quot;decrypt&quot;]}),
-    testWithAESCBC([&quot;decrypt&quot;, &quot;encrypt&quot;], {key_ops: [&quot;encrypt&quot;, &quot;decrypt&quot;]}),
-    testWithAESCBC([&quot;wrapKey&quot;], {key_ops: [&quot;wrapKey&quot;]}),
-    testWithAESCBC([&quot;unwrapKey&quot;], {key_ops: [&quot;unwrapKey&quot;]}),
-    testWithAESCBC([&quot;unwrapKey&quot;, &quot;wrapKey&quot;], {key_ops: [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]}),
-    testWithAESCBC([&quot;decrypt&quot;, &quot;encrypt&quot;, &quot;wrapKey&quot;], {key_ops: [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;]}),
-    testWithAESCBC([&quot;decrypt&quot;, &quot;encrypt&quot;, &quot;unwrapKey&quot;, &quot;wrapKey&quot;], {use: &quot;enc&quot;}),
-    testWithHMAC([&quot;sign&quot;], {key_ops: [&quot;sign&quot;]}),
-    testWithHMAC([&quot;verify&quot;], {key_ops: [&quot;verify&quot;]}),
-    testWithHMAC([&quot;sign&quot;, &quot;verify&quot;], {use: &quot;sig&quot;}),
-
-// Unknown key_ops strings are ignored.
-    testWithAESCBC([], {key_ops: [&quot;'encrypt'&quot;]}),
-    testWithAESCBC([], {key_ops: [&quot;encrypt &quot;]}),
-    testWithAESCBC([], {key_ops: [&quot;Encrypt&quot;]}),
-
-]).then(function() { 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="trunkLayoutTestscryptosubtlersaexportgeneratedkeysexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-Test exporting a generated RSA keypair with hash.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-
-Generating RSA-PKCS1-v1.5 keyPair...
-PASS crypto.subtle.exportKey(null, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey({}, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(&quot;&quot;, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(&quot;foobar&quot;, key) threw exception TypeError: Unknown key format.
-PASS key.publicKey.algorithm.hash.name is defined.
-PASS key.privateKey.algorithm.hash.name is defined.
-
-Exporting public key as JWK...
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.alg is 'RS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['sign', 'verify']
-
-Exporting private key as JWK...
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.alg is 'RS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['sign', 'verify']
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaexportgeneratedkeyshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,66 +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 exporting a generated RSA keypair with hash.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var algorithm = {
-    name: &quot;RSASSA-PKCS1-v1_5&quot;,
-    modulusLength: &quot;2048&quot;,
-    publicExponent: new Uint8Array([1, 0, 1]), // 2^16 + 1 (65537)
-    hash: { name: &quot;SHA-256&quot; }
-};
-
-debug(&quot;\nGenerating RSA-PKCS1-v1.5 keyPair...&quot;);
-crypto.subtle.generateKey(algorithm, extractable, ['sign', 'verify'])
-.then(function(result) {
-    key = result;
-
-    shouldThrow('crypto.subtle.exportKey(null, key)');
-    shouldThrow('crypto.subtle.exportKey(undefined, key)');
-    shouldThrow('crypto.subtle.exportKey({}, key)');
-    shouldThrow('crypto.subtle.exportKey(&quot;&quot;, key)');
-    shouldThrow('crypto.subtle.exportKey(&quot;foobar&quot;, key)');
-    shouldBeDefined('key.publicKey.algorithm.hash.name');
-    shouldBeDefined('key.privateKey.algorithm.hash.name');
-
-    debug(&quot;\nExporting public key as JWK...&quot;);
-    return crypto.subtle.exportKey(&quot;jwk&quot;, key.publicKey);
-}).then(function(result) {
-    exportedJWK = JSON.parse(bytesToASCIIString(result));
-
-    shouldBe(&quot;exportedJWK.kty&quot;, &quot;'RSA'&quot;);
-    shouldBe(&quot;exportedJWK.alg&quot;, &quot;'RS256'&quot;);
-    shouldBe(&quot;exportedJWK.ext&quot;, &quot;true&quot;);
-    shouldBe(&quot;exportedJWK.use&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;exportedJWK.key_ops&quot;, &quot;['sign', 'verify']&quot;);
-
-    debug(&quot;\nExporting private key as JWK...&quot;);
-    return crypto.subtle.exportKey(&quot;jwk&quot;, key.privateKey);
-}).then(function(result) {
-    exportedJWK = JSON.parse(bytesToASCIIString(result));
-
-    shouldBe(&quot;exportedJWK.kty&quot;, &quot;'RSA'&quot;);
-    shouldBe(&quot;exportedJWK.alg&quot;, &quot;'RS256'&quot;);
-    shouldBe(&quot;exportedJWK.ext&quot;, &quot;true&quot;);
-    shouldBe(&quot;exportedJWK.use&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;exportedJWK.key_ops&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaexportkeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-export-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,25 +0,0 @@
</span><del>-Test exporting an RSA key.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-
-Importing a JWK key...
-PASS crypto.subtle.exportKey(null, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey({}, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(&quot;&quot;, key) threw exception TypeError: Unknown key format.
-PASS crypto.subtle.exportKey(&quot;foobar&quot;, key) threw exception TypeError: Unknown key format.
-
-Exporting the key as JWK...
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.n is publicKeyJSON.n
-PASS exportedJWK.e is publicKeyJSON.e
-PASS exportedJWK.alg is 'RS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.use is undefined
-PASS exportedJWK.key_ops is ['sign', 'verify']
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaexportkeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-export-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,57 +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 exporting an RSA key.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-var publicKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RS256&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;
-};
-
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
-
-debug(&quot;\nImporting a JWK key...&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, &quot;RSASSA-PKCS1-v1_5&quot;, extractable, ['sign', 'verify']).then(function(result) {
-    key = result;
-
-    shouldThrow('crypto.subtle.exportKey(null, key)');
-    shouldThrow('crypto.subtle.exportKey(undefined, key)');
-    shouldThrow('crypto.subtle.exportKey({}, key)');
-    shouldThrow('crypto.subtle.exportKey(&quot;&quot;, key)');
-    shouldThrow('crypto.subtle.exportKey(&quot;foobar&quot;, key)');
-
-    debug(&quot;\nExporting the key as JWK...&quot;);
-    return crypto.subtle.exportKey(&quot;jwk&quot;, key);
-}).then(function(result) {
-    exportedJWK = JSON.parse(bytesToASCIIString(result));
-
-    shouldBe(&quot;exportedJWK.kty&quot;, &quot;'RSA'&quot;);
-    shouldBe(&quot;exportedJWK.n&quot;, &quot;publicKeyJSON.n&quot;);
-    shouldBe(&quot;exportedJWK.e&quot;, &quot;publicKeyJSON.e&quot;);
-    shouldBe(&quot;exportedJWK.alg&quot;, &quot;'RS256'&quot;);
-    shouldBe(&quot;exportedJWK.ext&quot;, &quot;true&quot;);
-    shouldBe(&quot;exportedJWK.use&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;exportedJWK.key_ops&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaexportprivatekeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,27 +0,0 @@
</span><del>-Test exporting a private RSA key.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-
-Importing a JWK key...
-
-Exporting the key as JWK...
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.n is privateKeyJSON.n
-PASS exportedJWK.e is privateKeyJSON.e
-PASS exportedJWK.d is privateKeyJSON.d
-PASS exportedJWK.p is privateKeyJSON.p
-PASS exportedJWK.q is privateKeyJSON.q
-PASS exportedJWK.dp is privateKeyJSON.dp
-PASS exportedJWK.dq is privateKeyJSON.dq
-PASS exportedJWK.qi is privateKeyJSON.qi
-PASS exportedJWK.oth is privateKeyJSON.oth
-PASS exportedJWK.alg is privateKeyJSON.alg
-PASS exportedJWK.ext is true
-PASS exportedJWK.key_ops is ['sign', 'verify']
-PASS exportedJWK.use is undefined
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaexportprivatekeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-export-private-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-export-private-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-export-private-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,65 +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 exporting a private RSA key.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-var nonExtractable = false;
-
-// Example from JWK specification.
-var privateKeyJSON = {
-    &quot;kty&quot;:&quot;RSA&quot;,
-    &quot;n&quot;:&quot;0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw&quot;,
-    &quot;e&quot;:&quot;AQAB&quot;,
-    &quot;d&quot;:&quot;X4cTteJY_gn4FYPsXB8rdXix5vwsg1FLN5E3EaG6RJoVH-HLLKD9M7dx5oo7GURknchnrRweUkC7hT5fJLM0WbFAKNLWY2vv7B6NqXSzUvxT0_YSfqijwp3RTzlBaCxWp4doFk5N2o8Gy_nHNKroADIkJ46pRUohsXywbReAdYaMwFs9tv8d_cPVY3i07a3t8MN6TNwm0dSawm9v47UiCl3Sk5ZiG7xojPLu4sbg1U2jx4IBTNBznbJSzFHK66jT8bgkuqsk0GjskDJk19Z4qwjwbsnn4j2WBii3RL-Us2lGVkY8fkFzme1z0HbIkfz0Y6mqnOYtqc0X4jfcKoAC8Q&quot;,
-    &quot;p&quot;:&quot;83i-7IvMGXoMXCskv73TKr8637FiO7Z27zv8oj6pbWUQyLPQBQxtPVnwD20R-60eTDmD2ujnMt5PoqMrm8RfmNhVWDtjjMmCMjOpSXicFHj7XOuVIYQyqVWlWEh6dN36GVZYk93N8Bc9vY41xy8B9RzzOGVQzXvNEvn7O0nVbfs&quot;,
-    &quot;q&quot;:&quot;3dfOR9cuYq-0S-mkFLzgItgMEfFzB2q3hWehMuG0oCuqnb3vobLyumqjVZQO1dIrdwgTnCdpYzBcOfW5r370AFXjiWft_NGEiovonizhKpo9VVS78TzFgxkIdrecRezsZ-1kYd_s1qDbxtkDEgfAITAG9LUnADun4vIcb6yelxk&quot;,
-    &quot;dp&quot;:&quot;G4sPXkc6Ya9y8oJW9_ILj4xuppu0lzi_H7VTkS8xj5SdX3coE0oimYwxIi2emTAue0UOa5dpgFGyBJ4c8tQ2VF402XRugKDTP8akYhFo5tAA77Qe_NmtuYZc3C3m3I24G2GvR5sSDxUyAN2zq8Lfn9EUms6rY3Ob8YeiKkTiBj0&quot;,
-    &quot;dq&quot;:&quot;s9lAH9fggBsoFR8Oac2R_E2gw282rT2kGOAhvIllETE1efrA6huUUvMfBcMpn8lqeW6vzznYY5SSQF7pMdC_agI3nG8Ibp1BUb0JUiraRNqUfLhcQb_d9GF4Dh7e74WbRsobRonujTYN1xCaP6TO61jvWrX-L18txXw494Q_cgk&quot;,
-    &quot;qi&quot;:&quot;GyM_p6JrXySiz1toFgKbWV-JdI3jQ4ypu9rbMWx3rQJBfmt0FoYzgUIZEVFEcOqwemRN81zoDAaa-Bk0KWNGDjJHZDdDmFhW3AN7lI-puxk_mHZGJ11rxyR8O55XLSe3SPmRfKwZI6yU24ZxvQKFYItdldUKGzO6Ia6zTKhAVRU&quot;,
-    &quot;alg&quot;:&quot;RS256&quot;,
-    &quot;kid&quot;:&quot;2011-04-29&quot;
-}
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(privateKeyJSON));
-
-debug(&quot;\nImporting a JWK key...&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, &quot;RSASSA-PKCS1-v1_5&quot;, extractable, ['sign', 'verify']).then(function(result) {
-    key = result;
-
-    debug(&quot;\nExporting the key as JWK...&quot;);
-    return crypto.subtle.exportKey(&quot;jwk&quot;, key);
-}).then(function(result) {
-    exportedJWK = JSON.parse(bytesToASCIIString(result));
-
-    shouldBe(&quot;exportedJWK.kty&quot;, &quot;'RSA'&quot;);
-    shouldBe(&quot;exportedJWK.n&quot;, &quot;privateKeyJSON.n&quot;);
-    shouldBe(&quot;exportedJWK.e&quot;, &quot;privateKeyJSON.e&quot;);
-    shouldBe(&quot;exportedJWK.d&quot;, &quot;privateKeyJSON.d&quot;);
-    shouldBe(&quot;exportedJWK.p&quot;, &quot;privateKeyJSON.p&quot;);
-    shouldBe(&quot;exportedJWK.q&quot;, &quot;privateKeyJSON.q&quot;);
-    shouldBe(&quot;exportedJWK.dp&quot;, &quot;privateKeyJSON.dp&quot;);
-    shouldBe(&quot;exportedJWK.dq&quot;, &quot;privateKeyJSON.dq&quot;);
-    shouldBe(&quot;exportedJWK.qi&quot;, &quot;privateKeyJSON.qi&quot;);
-    shouldBe(&quot;exportedJWK.oth&quot;, &quot;privateKeyJSON.oth&quot;);
-    shouldBe(&quot;exportedJWK.alg&quot;, &quot;privateKeyJSON.alg&quot;);
-    shouldBe(&quot;exportedJWK.ext&quot;, &quot;true&quot;);
-    shouldBe(&quot;exportedJWK.key_ops&quot;, &quot;['sign', 'verify']&quot;);
-    shouldBe(&quot;exportedJWK.use&quot;, &quot;undefined&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test storing a private RSA key in IndexedDB, and retrieving it.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS retrievedKey.type is 'private'
-PASS retrievedKey.extractable is true
-PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS retrievedKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
-PASS retrievedKey.usages is [&quot;sign&quot;, &quot;verify&quot;]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbnonexportableexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test storing a private RSA key in IndexedDB, and retrieving it.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS retrievedKey.type is 'private'
-PASS retrievedKey.extractable is false
-PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS retrievedKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
-PASS retrievedKey.usages is [&quot;sign&quot;, &quot;verify&quot;]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivateexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test storing a private RSA key in IndexedDB, and retrieving it.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS retrievedKey.type is 'private'
-PASS retrievedKey.extractable is false
-PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS retrievedKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
-PASS retrievedKey.usages is [&quot;sign&quot;, &quot;verify&quot;]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivatehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;script&gt;
-enablePrivateBrowsing = true;
-&lt;/script&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script src=&quot;resources/rsa-indexeddb-non-exportable.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbnonexportablehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,11 +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;script src=&quot;resources/rsa-indexeddb-non-exportable.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbprivateexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test storing a private RSA key in IndexedDB, and retrieving it.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS retrievedKey.type is 'private'
-PASS retrievedKey.extractable is true
-PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS retrievedKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
-PASS retrievedKey.usages is [&quot;sign&quot;, &quot;verify&quot;]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbprivatehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;script&gt;
-enablePrivateBrowsing = true;
-&lt;/script&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script src=&quot;resources/rsa-indexeddb.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaindexeddbhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,11 +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;script src=&quot;resources/rsa-indexeddb.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepgeneratenonextractablekeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,23 +0,0 @@
</span><del>-Test that even when non-extractability is requested, the public key is still extractable.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Generating a key pair...
-PASS keyPair.toString() is '[object KeyPair]'
-PASS keyPair.publicKey.type is 'public'
-PASS keyPair.publicKey.extractable is true
-PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP'
-PASS keyPair.publicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
-PASS keyPair.publicKey.algorithm.hash is undefined.
-PASS keyPair.privateKey.type is 'private'
-PASS keyPair.privateKey.extractable is false
-PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP'
-PASS keyPair.privateKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
-PASS keyPair.privateKey.algorithm.hash is undefined.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepgeneratenonextractablekeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,47 +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 that even when non-extractability is requested, the public key is still extractable.&quot;);
-
-jsTestIsAsync = true;
-
-var algorithmKeyGen = {
-    name: &quot;RSA-OAEP&quot;,
-    // RsaKeyGenParams
-    modulusLength: 2048,
-    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
-};
-var nonExtractable = false;
-
-debug(&quot;Generating a key pair...&quot;);
-crypto.subtle.generateKey(algorithmKeyGen, nonExtractable, []).then(function(result) {
-    keyPair = result;
-    shouldBe(&quot;keyPair.toString()&quot;, &quot;'[object KeyPair]'&quot;);
-    shouldBe(&quot;keyPair.publicKey.type&quot;, &quot;'public'&quot;);
-    shouldBe(&quot;keyPair.publicKey.extractable&quot;, &quot;true&quot;);
-    shouldBe(&quot;keyPair.publicKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
-    shouldBe(&quot;keyPair.publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
-    shouldBe(&quot;bytesToHexString(keyPair.publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
-    shouldBeUndefined(&quot;keyPair.publicKey.algorithm.hash&quot;);
-    shouldBe(&quot;keyPair.privateKey.type&quot;, &quot;'private'&quot;);
-    shouldBe(&quot;keyPair.privateKey.extractable&quot;, &quot;false&quot;);
-    shouldBe(&quot;keyPair.privateKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
-    shouldBe(&quot;keyPair.privateKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
-    shouldBe(&quot;bytesToHexString(keyPair.privateKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
-    shouldBeUndefined(&quot;keyPair.privateKey.algorithm.hash&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepkeymanipulationexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,46 +0,0 @@
</span><del>-Test generating, importing and exporting RSA keys for RSA-OAEP. Test that they can't be used with another algorithm.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Generating a key pair...
-PASS keyPair.toString() is '[object KeyPair]'
-PASS keyPair.publicKey.type is 'public'
-PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP'
-PASS keyPair.publicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
-PASS keyPair.publicKey.algorithm.hash is undefined.
-PASS keyPair.privateKey.type is 'private'
-PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP'
-PASS keyPair.privateKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
-PASS keyPair.privateKey.algorithm.hash is undefined.
-
-Testing that the keys can't be used with different algorithms...
-PASS crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, keyPair.privateKey, hexStringToUint8Array(&quot;00&quot;)) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, keyPair.publicKey, hexStringToUint8Array(&quot;00&quot;)) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-
-Trying to export keys to raw...
-PASS Promise rejected for exporting public key
-PASS Promise rejected for exporting private key
-
-Exporting public key to JWK...
-PASS jwkPublicKey.alg is 'RSA-OAEP'
-PASS jwkPublicKey.ext is true
-PASS jwkPublicKey.key_ops is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
-PASS jwkPublicKey.use is undefined
-PASS jwkPublicKey.kty is 'RSA'
-PASS bytesToHexString(Base64URL.parse(jwkPublicKey.e)) is '010001'
-
-Importing it back...
-PASS exportedPublicKey.type is 'public'
-PASS exportedPublicKey.algorithm.name is 'RSA-OAEP'
-PASS exportedPublicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(exportedPublicKey.algorithm.publicExponent) is '010001'
-PASS exportedPublicKey.algorithm.hash.name is 'SHA-1'
-PASS exportedPublicKey.extractable is true
-PASS exportedPublicKey.usages is ['decrypt','encrypt','unwrapKey','wrapKey']
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepkeymanipulationhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,82 +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, importing and exporting RSA keys for RSA-OAEP. Test that they can't be used with another algorithm.&quot;);
-
-jsTestIsAsync = true;
-
-var algorithmKeyGen = {
-    name: &quot;RSA-OAEP&quot;,
-    // RsaKeyGenParams
-    modulusLength: 2048,
-    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
-};
-var extractable = true;
-
-debug(&quot;Generating a key pair...&quot;);
-crypto.subtle.generateKey(algorithmKeyGen, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
-    keyPair = result;
-    shouldBe(&quot;keyPair.toString()&quot;, &quot;'[object KeyPair]'&quot;);
-    shouldBe(&quot;keyPair.publicKey.type&quot;, &quot;'public'&quot;);
-    shouldBe(&quot;keyPair.publicKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
-    shouldBe(&quot;keyPair.publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
-    shouldBe(&quot;bytesToHexString(keyPair.publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
-    shouldBeUndefined(&quot;keyPair.publicKey.algorithm.hash&quot;);
-    shouldBe(&quot;keyPair.privateKey.type&quot;, &quot;'private'&quot;);
-    shouldBe(&quot;keyPair.privateKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
-    shouldBe(&quot;keyPair.privateKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
-    shouldBe(&quot;bytesToHexString(keyPair.privateKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
-    shouldBeUndefined(&quot;keyPair.privateKey.algorithm.hash&quot;);
-
-    debug(&quot;\nTesting that the keys can't be used with different algorithms...&quot;);
-    iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
-    shouldThrow('crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, keyPair.privateKey, hexStringToUint8Array(&quot;00&quot;))');
-    shouldThrow('crypto.subtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, keyPair.publicKey, hexStringToUint8Array(&quot;00&quot;))');
-
-    debug(&quot;\nTrying to export keys to raw...&quot;);
-    return crypto.subtle.exportKey('raw', keyPair.publicKey);
-}).then(undefined, function(result) {
-    testPassed(&quot;Promise rejected for exporting public key&quot;);
-    return crypto.subtle.exportKey('raw', keyPair.privateKey);
-}).then(undefined, function(result) {
-    testPassed(&quot;Promise rejected for exporting private key&quot;);
-
-    debug(&quot;\nExporting public key to JWK...&quot;);
-    return crypto.subtle.exportKey(&quot;jwk&quot;, keyPair.publicKey);
-}).then(function(result) {
-    jwkPublicKeyArray = result;
-    jwkPublicKey = JSON.parse(bytesToASCIIString(jwkPublicKeyArray));
-    shouldBe(&quot;jwkPublicKey.alg&quot;, &quot;'RSA-OAEP'&quot;);
-    shouldBe(&quot;jwkPublicKey.ext&quot;, &quot;true&quot;);
-    shouldBe(&quot;jwkPublicKey.key_ops&quot;, &quot;['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']&quot;);
-    shouldBe(&quot;jwkPublicKey.use&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;jwkPublicKey.kty&quot;, &quot;'RSA'&quot;);
-    shouldBe(&quot;bytesToHexString(Base64URL.parse(jwkPublicKey.e))&quot;, &quot;'010001'&quot;);
-
-    debug(&quot;\nImporting it back...&quot;);
-    return crypto.subtle.importKey(&quot;jwk&quot;, jwkPublicKeyArray, null, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]);
-}).then(function(result) {
-    exportedPublicKey = result;
-    shouldBe(&quot;exportedPublicKey.type&quot;, &quot;'public'&quot;);
-    shouldBe(&quot;exportedPublicKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
-    shouldBe(&quot;exportedPublicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
-    shouldBe(&quot;bytesToHexString(exportedPublicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
-    shouldBe(&quot;exportedPublicKey.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
-    shouldBe(&quot;exportedPublicKey.extractable&quot;, &quot;true&quot;);
-    shouldBe(&quot;exportedPublicKey.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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepplaintextlengthexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-Test what happens when trying to encrypt a too large plain text with RSA-OAEP.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing RSA keys...
-Encrypting a 214 byte buffer with RSA-OAEP SHA-1, 2048 bit key...
-PASS Succeeded
-Encrypting a 215 byte buffer...
-PASS Rejected
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepplaintextlengthhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,63 +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 what happens when trying to encrypt a too large plain text with RSA-OAEP.&quot;);
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RSA-OAEP&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;
-};
-
-var privateKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RSA-OAEP&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;,
-    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 encryptAlgorithm = {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;};
-var extractable = true;
-var nonExtractable = false;
-
-debug(&quot;Importing RSA keys...&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]).then(function(result) {
-    publicKey = result;
-    return crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]);
-}).then(function(result) {
-    privateKey = result;
-
-    debug(&quot;Encrypting a 214 byte buffer with RSA-OAEP SHA-1, 2048 bit key...&quot;);
-    return crypto.subtle.encrypt({name: &quot;RSA-OAEP&quot;, hash: &quot;SHA-1&quot;}, publicKey, new Uint8Array(214));
-}).then(function(result) {
-    testPassed(&quot;Succeeded&quot;);
-    debug(&quot;Encrypting a 215 byte buffer...&quot;);
-    return crypto.subtle.encrypt({name: &quot;RSA-OAEP&quot;, hash: &quot;SHA-1&quot;}, publicKey, new Uint8Array(215));
-}).then(function(result) {
-    testFailed(&quot;Succeeded&quot;);
-    finishJSTest();
-}, function(result) {
-    testPassed(&quot;Rejected&quot;);
-    finishJSTest();
-});
-&lt;/script&gt;
-
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepwrapunwrapaesexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,34 +0,0 @@
</span><del>-Test wrapping and unwrapping AES keys with RSA-OAEP.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing RSA keys...
-Importing an AES key...
-Wrapping it...
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 256
-PASS unwrappedKey.usages is ['decrypt', 'encrypt']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
-
-Wrapping the same key as JWK...
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 256
-PASS unwrappedKey.usages is ['decrypt', 'encrypt']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaoaepwrapunwrapaeshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,103 +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 wrapping and unwrapping AES keys with RSA-OAEP.&quot;);
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RSA-OAEP&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;
-};
-
-var privateKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RSA-OAEP&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;,
-    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 wrapAlgorithm = {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;};
-var extractable = true;
-var nonExtractable = false;
-
-debug(&quot;Importing RSA keys...&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
-    publicKey = result;
-    return crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]);
-}).then(function(result) {
-    privateKey = result;
-
-    debug(&quot;Importing an AES key...&quot;);
-    aesKeyData = hexStringToUint8Array(&quot;603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4&quot;);
-    return crypto.subtle.importKey(&quot;raw&quot;, aesKeyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])
-}).then(function(result) {
-    aesKey = result;
-    debug(&quot;Wrapping it...&quot;);
-
-    return crypto.subtle.wrapKey(&quot;raw&quot;, aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
-    wrappedKey = result;
-    shouldBe(&quot;wrappedKey.toString()&quot;, &quot;'[object ArrayBuffer]'&quot;);
-
-    debug(&quot;Unwrapping it...&quot;);
-    return crypto.subtle.unwrapKey(&quot;raw&quot;, wrappedKey, privateKey, wrapAlgorithm, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]);
-}).then(function(result) {
-    unwrappedKey = result;
-    shouldBe(&quot;unwrappedKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
-    shouldBe(&quot;unwrappedKey.type&quot;, &quot;'secret'&quot;);
-    shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
-    shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
-    shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;256&quot;);
-    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
-
-    debug(&quot;Exporting it...&quot;);
-    return crypto.subtle.exportKey(&quot;raw&quot;, unwrappedKey);
-}).then(function(result) {
-    unwrappedKeyData = result;
-    shouldBe(&quot;bytesToHexString(unwrappedKeyData)&quot;, &quot;bytesToHexString(aesKeyData)&quot;);
-
-    debug(&quot;\nWrapping the same key as JWK...&quot;);
-    return crypto.subtle.wrapKey(&quot;jwk&quot;, aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
-    wrappedKey = result;
-    shouldBe(&quot;wrappedKey.toString()&quot;, &quot;'[object ArrayBuffer]'&quot;);
-
-    debug(&quot;Unwrapping it...&quot;);
-    return crypto.subtle.unwrapKey(&quot;jwk&quot;, wrappedKey, privateKey, wrapAlgorithm, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]);
-}).then(function(result) {
-    unwrappedKey = result;
-    shouldBe(&quot;unwrappedKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
-    shouldBe(&quot;unwrappedKey.type&quot;, &quot;'secret'&quot;);
-    shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
-    shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
-    shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;256&quot;);
-    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
-
-    debug(&quot;Exporting it...&quot;);
-    return crypto.subtle.exportKey(&quot;raw&quot;, unwrappedKey);
-}).then(function(result) {
-    unwrappedKeyData = result;
-    shouldBe(&quot;bytesToHexString(unwrappedKeyData)&quot;, &quot;bytesToHexString(aesKeyData)&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersapostMessageexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-postMessage-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-postMessage-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-postMessage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,32 +0,0 @@
</span><del>-Test sending crypto keys via postMessage.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Key received in a message:
-PASS key.type is 'private'
-PASS key.extractable is true
-PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS key.algorithm.modulusLength is 2048
-PASS bytesToHexString(key.algorithm.publicExponent) is '010001'
-PASS key.usages is [&quot;sign&quot;, &quot;verify&quot;]
-
-Exported back to JWK:
-PASS exportedJWK.kty is 'RSA'
-PASS exportedJWK.alg is 'RS256'
-PASS exportedJWK.ext is true
-PASS exportedJWK.key_ops is ['sign','verify']
-PASS exportedJWK.use is undefined
-PASS exportedJWK.n is privateKeyJSON.n
-PASS exportedJWK.e is privateKeyJSON.e
-PASS exportedJWK.d is privateKeyJSON.d
-PASS exportedJWK.p is privateKeyJSON.p
-PASS exportedJWK.q is privateKeyJSON.q
-PASS exportedJWK.dp is privateKeyJSON.dp
-PASS exportedJWK.dq is privateKeyJSON.dq
-PASS exportedJWK.qi is privateKeyJSON.qi
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersapostMessagehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsa-postMessage.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsa-postMessage.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsa-postMessage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,66 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test sending crypto keys via postMessage.&quot;);
-
-jsTestIsAsync = true;
-
-var privateKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RS256&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;,
-    d: &quot;eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ&quot;,
-    p: &quot;4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0&quot;,
-    q: &quot;xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc&quot;,
-    dp: &quot;fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk&quot;,
-    dq: &quot;jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE&quot;,
-    qi: &quot;YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk&quot;
-};
-
-window.addEventListener(&quot;message&quot;, function(evt) {
-    debug(&quot;Key received in a message:&quot;);
-    key = evt.data;
-    shouldBe(&quot;key.type&quot;, &quot;'private'&quot;);
-    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
-    shouldBe(&quot;key.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
-    shouldBe(&quot;key.algorithm.modulusLength&quot;, &quot;2048&quot;);
-    shouldBe(&quot;bytesToHexString(key.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
-    shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
-
-    crypto.subtle.exportKey(&quot;jwk&quot;, key).then(function(result) {
-        exportedJWK = JSON.parse(bytesToASCIIString(result));
-        debug(&quot;\nExported back to JWK:&quot;);
-        shouldBe(&quot;exportedJWK.kty&quot;, &quot;'RSA'&quot;);
-        shouldBe(&quot;exportedJWK.alg&quot;, &quot;'RS256'&quot;);
-        shouldBe(&quot;exportedJWK.ext&quot;, &quot;true&quot;);
-        shouldBe(&quot;exportedJWK.key_ops&quot;, &quot;['sign','verify']&quot;);
-        shouldBe(&quot;exportedJWK.use&quot;, &quot;undefined&quot;);
-        shouldBe(&quot;exportedJWK.n&quot;, &quot;privateKeyJSON.n&quot;);
-        shouldBe(&quot;exportedJWK.e&quot;, &quot;privateKeyJSON.e&quot;);
-        shouldBe(&quot;exportedJWK.d&quot;, &quot;privateKeyJSON.d&quot;);
-        shouldBe(&quot;exportedJWK.p&quot;, &quot;privateKeyJSON.p&quot;);
-        shouldBe(&quot;exportedJWK.q&quot;, &quot;privateKeyJSON.q&quot;);
-        shouldBe(&quot;exportedJWK.dp&quot;, &quot;privateKeyJSON.dp&quot;);
-        shouldBe(&quot;exportedJWK.dq&quot;, &quot;privateKeyJSON.dq&quot;);
-        shouldBe(&quot;exportedJWK.qi&quot;, &quot;privateKeyJSON.qi&quot;);
-        debug(&quot;&quot;);
-
-        finishJSTest();
-    });
-}, false);
-
-crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, true, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
-    postMessage(result, &quot;*&quot;);
-});
-&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="trunkLayoutTestscryptosubtlersaespkcs1v1_5decryptexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,12 +0,0 @@
</span><del>-Test decrypting a known message with RSAES-PKCS1-v1_5.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing an RSA key...
-Decrypting...
-PASS bytesToHexString(new Uint8Array(message)) is '2aacec86f423dd925ec158822a748cbe6c31a0'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5decrypthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,49 +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 decrypting a known message with RSAES-PKCS1-v1_5.&quot;);
-
-jsTestIsAsync = true;
-
-var privateKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RSA1_5&quot;,
-    n: Base64URL.stringify(hexStringToUint8Array(&quot;dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1&quot;)),
-    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;)),
-    d: Base64URL.stringify(hexStringToUint8Array(&quot;21950851cdf25320318b305afa0f371f07ae5a44b314ebd729f5dcb15da7fa3947acdd915daed574bd16df88bf85f61060b387172fae6e01262b3864c2d3c22f94e04a8159422b4ed279c48a4c9d767d4966071a5bbf5d043e16ff46ec1ba0716f00bbc97bff5d5693e214e99c9721f12b3ec6282ae2a485721b96ddcf7403fa037d0c57ab463c448de5cc12265add886d311ea8d8a5903fa56c5f1c9cf2eb11cb657a1a7d3e41352dc3e686898c4ce4305e8b638e1b08a2a86cc9eb9866f3499ac77b6136b81cb276d614cfeb7b6ed3f3bc775e46c00066ebeee2cff7166b57520598947ff6210320b288fb4f2c3f8fe97b279414ebf7203000a19fc0424875&quot;)),
-    p: Base64URL.stringify(hexStringToUint8Array(&quot;f123bfe53de97a569d91adcf556fa625ad30f3fd3d811f9e91e6af44b6e780cb0f327829fb21190ae2806646d728cd9b6531132b1ebfef1272993060f1ce70b124393091ee8593b727367edbba009ec5be17c4acee120c841267d47631a16c36a6d1c99973c1b0b5a835bf39feafe8f6421fd9c2a90bc27976659e67bc83124d&quot;)),
-    q: Base64URL.stringify(hexStringToUint8Array(&quot;ea9839b7e37ea89bbda27e4c93471cb4fd92189a0a96bcb4d75693f18a5c2f742af9e36fde679fbd9eae345fa269527b6965021c4bdf54d685bf08960cc976f68dca21cebf44f268a59dab8d1a25e519f5147e1f45fe287d74cf725bec1326d34212c56cf4fffa202f57b68ee8cca943f3c138c4cde33bdf2c9440df65322445&quot;)),
-    dp: Base64URL.stringify(hexStringToUint8Array(&quot;ca0c9b60b8e4a6066756c65d2088419df6253b7b688a85f4f6e964d85dad52a45262867f1e9618069fccd865e9289e46e39e2022944c5c4487d345cf252d460d977d77edfefedbcbae46a23af7fa470f077da0e50942044cb1a360497cc2760ac0f2ad4a2fcd0e84d7a1d94dfdd2658fd9ce18475c1fa75ee0cebad0cf0ac04d&quot;)),
-    dq: Base64URL.stringify(hexStringToUint8Array(&quot;528171233c4e4a6c63b86764f51338846afddbcb2958344c01c4004a1dd828145a1d02a1507def4f58247a64fc10c0a288c1ae895721d78b8f044db7c00d86da55a9b654292ecd768270be69e4bd5922d4effd1f70955f9627e3e19b749e93b40ef3dd1d61d93915e2b09d930b4b1768bfacc0136f39b0cfdfb4d050011e2e65&quot;)),
-    qi: Base64URL.stringify(hexStringToUint8Array(&quot;df2eb2322cc2daabf4d1465508f41521cda7ceff23ebe61d00d441ee728dda5d16c7bf920cd95f34beb4fe32ee817ef3362e0bcd1d1245f7b07793eaa190dc5a37fdaf4c68e2ca13972d7f5148b796b6fb6d7adda07bd2cd13be98cebed1edc6ca412e395350c59a1d842bc4aa2f3c0b243fde7dfd95356f2439251a1172c45e&quot;))
-};
-
-var extractable = true;
-var nonExtractable = false;
-
-debug(&quot;Importing an RSA key...&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;decrypt&quot;]).then(function(result) {
-    privateKey = result;
-
-    debug(&quot;Decrypting...&quot;);
-    encryptedMessage = hexStringToUint8Array(&quot;6042e745589af03af87520f93c45d8c35985ada1161a37d822e9f9460fc75fcf0179d8491b8f5d1e4de8ceb31e07c4865c5a3efdbbb69a8803b89ee65a430a5809c707569150b580bb686a94c5541c46adcd827960ce244ff688387d1616e85b4d1780c6483606cf924b54f080cf4154e66829bf6e532481048ec41fadc07d755bb34bb28145219cb30d47d0d618709180e90303ff9ef09018bed3da75761da794811f96bc9e8d7c4ba1b5946bda0bd313faec4c993ed2748eed8cce4bdb520ba7db165f9fe56aa8454d6ff33874feeebf29de2df5b7f00aa1d9fb073fc4067b58dc50624e127f711dde2cc2cfdab4919ccf28c83660dfc227b0f500ec1f904f&quot;);
-    return crypto.subtle.decrypt(&quot;RSAES-PKCS1-v1_5&quot;, privateKey, encryptedMessage);
-}).then(function(result) {
-    message = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(message))&quot;, &quot;'2aacec86f423dd925ec158822a748cbe6c31a0'&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaesexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,34 +0,0 @@
</span><del>-Test wrapping and unwrapping an AES key with RSAES-PKCS1-v1_5.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing RSA keys...
-Importing an AES key...
-Wrapping it...
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 256
-PASS unwrappedKey.usages is ['decrypt', 'encrypt']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
-
-Wrapping the same key as JWK...
-PASS wrappedKey.toString() is '[object ArrayBuffer]'
-Unwrapping it...
-PASS unwrappedKey.toString() is '[object CryptoKey]'
-PASS unwrappedKey.type is 'secret'
-PASS unwrappedKey.extractable is true
-PASS unwrappedKey.algorithm.name is 'AES-CBC'
-PASS unwrappedKey.algorithm.length is 256
-PASS unwrappedKey.usages is ['decrypt', 'encrypt']
-Exporting it...
-PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaeshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,103 +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 wrapping and unwrapping an AES key with RSAES-PKCS1-v1_5.&quot;);
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RSA1_5&quot;,
-    n: Base64URL.stringify(hexStringToUint8Array(&quot;dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1&quot;)),
-    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;))
-};
-
-var privateKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RSA1_5&quot;,
-    n: Base64URL.stringify(hexStringToUint8Array(&quot;dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1&quot;)),
-    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;)),
-    d: Base64URL.stringify(hexStringToUint8Array(&quot;21950851cdf25320318b305afa0f371f07ae5a44b314ebd729f5dcb15da7fa3947acdd915daed574bd16df88bf85f61060b387172fae6e01262b3864c2d3c22f94e04a8159422b4ed279c48a4c9d767d4966071a5bbf5d043e16ff46ec1ba0716f00bbc97bff5d5693e214e99c9721f12b3ec6282ae2a485721b96ddcf7403fa037d0c57ab463c448de5cc12265add886d311ea8d8a5903fa56c5f1c9cf2eb11cb657a1a7d3e41352dc3e686898c4ce4305e8b638e1b08a2a86cc9eb9866f3499ac77b6136b81cb276d614cfeb7b6ed3f3bc775e46c00066ebeee2cff7166b57520598947ff6210320b288fb4f2c3f8fe97b279414ebf7203000a19fc0424875&quot;)),
-    p: Base64URL.stringify(hexStringToUint8Array(&quot;f123bfe53de97a569d91adcf556fa625ad30f3fd3d811f9e91e6af44b6e780cb0f327829fb21190ae2806646d728cd9b6531132b1ebfef1272993060f1ce70b124393091ee8593b727367edbba009ec5be17c4acee120c841267d47631a16c36a6d1c99973c1b0b5a835bf39feafe8f6421fd9c2a90bc27976659e67bc83124d&quot;)),
-    q: Base64URL.stringify(hexStringToUint8Array(&quot;ea9839b7e37ea89bbda27e4c93471cb4fd92189a0a96bcb4d75693f18a5c2f742af9e36fde679fbd9eae345fa269527b6965021c4bdf54d685bf08960cc976f68dca21cebf44f268a59dab8d1a25e519f5147e1f45fe287d74cf725bec1326d34212c56cf4fffa202f57b68ee8cca943f3c138c4cde33bdf2c9440df65322445&quot;)),
-    dp: Base64URL.stringify(hexStringToUint8Array(&quot;ca0c9b60b8e4a6066756c65d2088419df6253b7b688a85f4f6e964d85dad52a45262867f1e9618069fccd865e9289e46e39e2022944c5c4487d345cf252d460d977d77edfefedbcbae46a23af7fa470f077da0e50942044cb1a360497cc2760ac0f2ad4a2fcd0e84d7a1d94dfdd2658fd9ce18475c1fa75ee0cebad0cf0ac04d&quot;)),
-    dq: Base64URL.stringify(hexStringToUint8Array(&quot;528171233c4e4a6c63b86764f51338846afddbcb2958344c01c4004a1dd828145a1d02a1507def4f58247a64fc10c0a288c1ae895721d78b8f044db7c00d86da55a9b654292ecd768270be69e4bd5922d4effd1f70955f9627e3e19b749e93b40ef3dd1d61d93915e2b09d930b4b1768bfacc0136f39b0cfdfb4d050011e2e65&quot;)),
-    qi: Base64URL.stringify(hexStringToUint8Array(&quot;df2eb2322cc2daabf4d1465508f41521cda7ceff23ebe61d00d441ee728dda5d16c7bf920cd95f34beb4fe32ee817ef3362e0bcd1d1245f7b07793eaa190dc5a37fdaf4c68e2ca13972d7f5148b796b6fb6d7adda07bd2cd13be98cebed1edc6ca412e395350c59a1d842bc4aa2f3c0b243fde7dfd95356f2439251a1172c45e&quot;))
-};
-var wrapAlgorithm = {name: &quot;RSAES-PKCS1-v1_5&quot;};
-var extractable = true;
-var nonExtractable = false;
-
-debug(&quot;Importing RSA keys...&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
-    publicKey = result;
-    return crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]);
-}).then(function(result) {
-    privateKey = result;
-
-    debug(&quot;Importing an AES key...&quot;);
-    aesKeyData = hexStringToUint8Array(&quot;603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4&quot;);
-    return crypto.subtle.importKey(&quot;raw&quot;, aesKeyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])
-}).then(function(result) {
-    aesKey = result;
-    debug(&quot;Wrapping it...&quot;);
-
-    return crypto.subtle.wrapKey(&quot;raw&quot;, aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
-    wrappedKey = result;
-    shouldBe(&quot;wrappedKey.toString()&quot;, &quot;'[object ArrayBuffer]'&quot;);
-
-    debug(&quot;Unwrapping it...&quot;);
-    return crypto.subtle.unwrapKey(&quot;raw&quot;, wrappedKey, privateKey, wrapAlgorithm, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]);
-}).then(function(result) {
-    unwrappedKey = result;
-    shouldBe(&quot;unwrappedKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
-    shouldBe(&quot;unwrappedKey.type&quot;, &quot;'secret'&quot;);
-    shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
-    shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
-    shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;256&quot;);
-    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
-
-    debug(&quot;Exporting it...&quot;);
-    return crypto.subtle.exportKey(&quot;raw&quot;, unwrappedKey);
-}).then(function(result) {
-    unwrappedKeyData = result;
-    shouldBe(&quot;bytesToHexString(unwrappedKeyData)&quot;, &quot;bytesToHexString(aesKeyData)&quot;);
-
-    debug(&quot;\nWrapping the same key as JWK...&quot;);
-    return crypto.subtle.wrapKey(&quot;jwk&quot;, aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
-    wrappedKey = result;
-    shouldBe(&quot;wrappedKey.toString()&quot;, &quot;'[object ArrayBuffer]'&quot;);
-
-    debug(&quot;Unwrapping it...&quot;);
-    return crypto.subtle.unwrapKey(&quot;jwk&quot;, wrappedKey, privateKey, wrapAlgorithm, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]);
-}).then(function(result) {
-    unwrappedKey = result;
-    shouldBe(&quot;unwrappedKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
-    shouldBe(&quot;unwrappedKey.type&quot;, &quot;'secret'&quot;);
-    shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
-    shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
-    shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;256&quot;);
-    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
-
-    debug(&quot;Exporting it...&quot;);
-    return crypto.subtle.exportKey(&quot;raw&quot;, unwrappedKey);
-}).then(function(result) {
-    unwrappedKeyData = result;
-    shouldBe(&quot;bytesToHexString(unwrappedKeyData)&quot;, &quot;bytesToHexString(aesKeyData)&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,24 +0,0 @@
</span><del>-Test generating an RSA key pair for RSASSA-PKCS1-v1_5.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Generating a key pair...
-PASS keyPair.toString() is '[object KeyPair]'
-PASS keyPair.publicKey.type is 'public'
-PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS keyPair.publicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
-PASS keyPair.publicKey.algorithm.hash is undefined.
-PASS keyPair.privateKey.type is 'private'
-PASS keyPair.privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS keyPair.privateKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
-PASS keyPair.privateKey.algorithm.hash is undefined.
-
-Testing that custom attributes on keys survive garbage collection...
-PASS keyPair.publicKey.foo is 'bar'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponentexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,16 +0,0 @@
</span><del>-Test generating an RSA key pair for RSASSA-PKCS1-v1_5 when exponent has leading zeroes.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Generating a key pair...
-PASS keyPair.toString() is '[object KeyPair]'
-PASS keyPair.publicKey.type is 'public'
-PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
-PASS keyPair.publicKey.algorithm.modulusLength is 2048
-PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
-PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponenthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,40 +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 an RSA key pair for RSASSA-PKCS1-v1_5 when exponent has leading zeroes.&quot;);
-
-jsTestIsAsync = true;
-
-var algorithmKeyGen = {
-    name: &quot;RSASSA-PKCS1-v1_5&quot;,
-    // RsaKeyGenParams
-    modulusLength: 2048,
-    publicExponent: new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01]),  // Equivalent to 65537
-};
-var extractable = true;
-
-debug(&quot;Generating a key pair...&quot;);
-crypto.subtle.generateKey(algorithmKeyGen, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
-    keyPair = result;
-    shouldBe(&quot;keyPair.toString()&quot;, &quot;'[object KeyPair]'&quot;);
-    shouldBe(&quot;keyPair.publicKey.type&quot;, &quot;'public'&quot;);
-    shouldBe(&quot;keyPair.publicKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
-    shouldBe(&quot;keyPair.publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
-    shouldBe(&quot;bytesToHexString(keyPair.publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
-    shouldBe(&quot;bytesToHexString(keyPair.privateKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
-
-    finishJSTest();
-});
-&lt;/script&gt;
-
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,54 +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 an RSA key pair for RSASSA-PKCS1-v1_5.&quot;);
-
-jsTestIsAsync = true;
-
-var algorithmKeyGen = {
-    name: &quot;RSASSA-PKCS1-v1_5&quot;,
-    // RsaKeyGenParams
-    modulusLength: 2048,
-    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
-};
-var extractable = true;
-
-debug(&quot;Generating a key pair...&quot;);
-crypto.subtle.generateKey(algorithmKeyGen, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
-    keyPair = result;
-    shouldBe(&quot;keyPair.toString()&quot;, &quot;'[object KeyPair]'&quot;);
-    shouldBe(&quot;keyPair.publicKey.type&quot;, &quot;'public'&quot;);
-    shouldBe(&quot;keyPair.publicKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
-    shouldBe(&quot;keyPair.publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
-    shouldBe(&quot;bytesToHexString(keyPair.publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
-    shouldBeUndefined(&quot;keyPair.publicKey.algorithm.hash&quot;);
-    shouldBe(&quot;keyPair.privateKey.type&quot;, &quot;'private'&quot;);
-    shouldBe(&quot;keyPair.privateKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
-    shouldBe(&quot;keyPair.privateKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
-    shouldBe(&quot;bytesToHexString(keyPair.privateKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
-    shouldBeUndefined(&quot;keyPair.privateKey.algorithm.hash&quot;);
-
-    debug(&quot;\nTesting that custom attributes on keys survive garbage collection...&quot;);
-    keyPair.publicKey.foo = &quot;bar&quot;;
-    gc();
-    setTimeout(function() {
-        gc();
-        setTimeout(function() {
-            shouldBe(&quot;keyPair.publicKey.foo&quot;, &quot;'bar'&quot;);
-            finishJSTest();
-        }, 0);
-    }, 0);
-});
-&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="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,26 +0,0 @@
</span><del>-Test importing an RSA key for RSASSA-PKCS1-v1_5.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing a public key...
-PASS publicKey.toString() is '[object CryptoKey]'
-PASS publicKey.type is 'public'
-PASS publicKey.usages is ['sign','verify']
-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'
-
-Importing a private key...
-PASS privateKey.toString() is '[object CryptoKey]'
-PASS privateKey.type is 'private'
-PASS privateKey.usages is ['sign','verify']
-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-256'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwksmallkeyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,11 +0,0 @@
</span><del>-A key of size 2048 bits or larger MUST be used with RS256, RS384, RS512 JWK algorithms.
-
-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;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;sign&quot;, &quot;verify&quot;]) threw exception TypeError: Key size is not valid for RS256.
-PASS crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;sign&quot;, &quot;verify&quot;]) threw exception TypeError: Key size is not valid for RS512.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwksmallkeyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,44 +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;A key of size 2048 bits or larger MUST be used with RS256, RS384, RS512 JWK algorithms.&quot;);
-
-var extractable = true;
-
-// openssl genrsa 1024 &gt;1024.pem
-// openssl asn1parse -in 1024.pem
-var publicKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RS256&quot;,
-    n: Base64URL.stringify(hexStringToUint8Array(&quot;B7F103F8412CCD26F5D54FC3157CD8CE1F134F4EABF0A042350BDD7F00FEA2B77EEF19915B10AA2417BB2CB4EC1D57B9661A20072469B9DF9C6E89CB35CCC8543CC40770DCC30D0BBFF1BF9DA1E2549F40476EDADB9312985DAE8C7527C1C12AAFEDF4584989968CDCC9EFEB197438C534D1BFAAC30B1D41F75EADB86CC581B9&quot;)),
-    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;))
-};
-
-var privateKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RS512&quot;,
-    n: Base64URL.stringify(hexStringToUint8Array(&quot;B7F103F8412CCD26F5D54FC3157CD8CE1F134F4EABF0A042350BDD7F00FEA2B77EEF19915B10AA2417BB2CB4EC1D57B9661A20072469B9DF9C6E89CB35CCC8543CC40770DCC30D0BBFF1BF9DA1E2549F40476EDADB9312985DAE8C7527C1C12AAFEDF4584989968CDCC9EFEB197438C534D1BFAAC30B1D41F75EADB86CC581B9&quot;)),
-    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;)),
-    d: Base64URL.stringify(hexStringToUint8Array(&quot;5BA6F4F26B0F36BDB5FA6EBEE6E3096853259CFBB742B3A7A9A4DADDE0920063EC149929CB3557819A6D824E37E43B04BF323F492FC49A8028031017B81BECA8EC2A85ABCF193501D80DC251DB8863B8673D8B6772DB2D2AE08CD1829C3F542141461CACE4E8A1F112AD13FF4A4DD865A89AEA94E984D487E5798EF07643B9CD&quot;)),
-    p: Base64URL.stringify(hexStringToUint8Array(&quot;E06BFE5722A68E5D597DD8DB937483CBA352AB817209275ADAD103772B7A8EF4EA946311A2B51805959818CEB362F257D6998B475FEA9E34F2A30205B5F5A7FF&quot;)),
-    q: Base64URL.stringify(hexStringToUint8Array(&quot;D1D2DBDB1F4DCBFE8D16CDD2CF83C7B5FADFC7891F22FC527BF208F81B92F2543569C3AD22224B82D407DEB65F651D09D2558FEE8BC6E5DA51F6F13206CC1647&quot;)),
-    dp: Base64URL.stringify(hexStringToUint8Array(&quot;73ECB4F3D3AD4F6ABEF877D56C84CA339D88ED98AF0C356D040CE58A60462DA42BAC3CC47654AF34EB4226C656F96C8F9D05B1614C1588657754668E06A0FF87&quot;)),
-    dq: Base64URL.stringify(hexStringToUint8Array(&quot;5B9C5ACDB33F3E5FE7AE1B337DD325B138D5D7C2F0CB4FAB9BDE333850A1BA183631F5737441D102501D178A3CE062EB54E072B54E660B19654C12472B5C9425&quot;)),
-    qi: Base64URL.stringify(hexStringToUint8Array(&quot;D6A920B241178923C59BCBD1A815764619225A90F2C090A9FBD594A61561542D0DF179590413C26C8A72FC6E14EC63A377169970671B3A1EB5E4F4DF1A4CA725&quot;))
-};
-
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
-shouldThrow('crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, 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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,65 +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 importing an RSA key for RSASSA-PKCS1-v1_5.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var publicKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RS256&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;
-};
-
-var privateKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RS256&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;,
-    d: &quot;eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ&quot;,
-    p: &quot;4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0&quot;,
-    q: &quot;xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc&quot;,
-    dp: &quot;fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk&quot;,
-    dq: &quot;jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE&quot;,
-    qi: &quot;YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk&quot;
-};
-
-debug(&quot;Importing a public key...&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;sign&quot;, &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.usages&quot;, &quot;['sign','verify']&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;);
-    debug(&quot;\nImporting a private key...&quot;);
-    return crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;sign&quot;, &quot;verify&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.usages&quot;, &quot;['sign','verify']&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-256'&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5signverifyexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,21 +0,0 @@
</span><del>-Test importing an RSA key for RSASSA-PKCS1-v1_5.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing a public key...
-
-Importing a private key...
-
-Signing some text...
-PASS bytesToHexString(new Uint8Array(signature)) is '0fd9a8aef4cc1876c0b762545336c6d1fb315ae16ae4b5e4bf34d384d8585ea7a01e76ea09ee7f7ee8d1c122e7dd15b7c94a573b2aa07203e8d13bc6fd16156cd8e5f0c15a15dccb62d152127fca09882fb53bc3e60ab586d15b95cf411e3aab4a1c231a7e91aab09ee3d4b13d11e97505ddff77683470da510ee76e8bd530c56a85f901626a5a710f716f113dfe9cf6c473ee16fa248aea3480a1033abe30f4c1243289a661e64d7818b55698280688097135968c6d4b029496d85cab2a67e4696737781f70e4392c7df71bbd6c92465947f029a1de48160aced11b5721b1cd25039fe2c16c2b38de73df3b9a83e3ea755fd0cfe51ca06b61fadf6d84677f95'
-
-Verifying the signature...
-PASS verificationResult is true
-
-Verifying a bad signature...
-PASS verificationResult is false
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlersassapkcs1v1_5signverifyhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,69 +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 importing an RSA key for RSASSA-PKCS1-v1_5.&quot;);
-
-jsTestIsAsync = true;
-
-var extractable = true;
-
-var publicKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RS256&quot;,
-    n: Base64URL.stringify(hexStringToUint8Array(&quot;ADC0940AFECE7351D56A6D432210B3AA49D38566B03A9F102E4F198B2DA9D740728D01426A3A058B2B805A5F91D565D969FE318AD2D1ADA713F5A829CC8CDCF8C6CB4872068164063B6D651A2226CB97ED67E0FC6C702A473DB2D79A730F8738084A2EED74922C3A119D1D101B932C0E10FAB36815F66C0792BB640B1B4C59D062FBBEDAB3CC069A535195D70E4A06432CAF149C24A00353A0B99F7CF5B17273CB4E38421BD315127CF4B3DCB3D20A7C98CFAF1A0E398A55E347FA283CE7B39273259B1B2132DC18B0EB8AAE9F78EE525356B09DF39E090E76D7985B2B71E50AF85CA36CE91F8CCB2ABBD8A529D369890D98A2CA2825C4C2FF8B7FBF09E79C0B&quot;)),
-    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;)),
-};
-
-var privateKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RS256&quot;,
-    n: Base64URL.stringify(hexStringToUint8Array(&quot;ADC0940AFECE7351D56A6D432210B3AA49D38566B03A9F102E4F198B2DA9D740728D01426A3A058B2B805A5F91D565D969FE318AD2D1ADA713F5A829CC8CDCF8C6CB4872068164063B6D651A2226CB97ED67E0FC6C702A473DB2D79A730F8738084A2EED74922C3A119D1D101B932C0E10FAB36815F66C0792BB640B1B4C59D062FBBEDAB3CC069A535195D70E4A06432CAF149C24A00353A0B99F7CF5B17273CB4E38421BD315127CF4B3DCB3D20A7C98CFAF1A0E398A55E347FA283CE7B39273259B1B2132DC18B0EB8AAE9F78EE525356B09DF39E090E76D7985B2B71E50AF85CA36CE91F8CCB2ABBD8A529D369890D98A2CA2825C4C2FF8B7FBF09E79C0B&quot;)),
-    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;)),
-    d: Base64URL.stringify(hexStringToUint8Array(&quot;78D2D2DFB682CFB45748D3C3FC3B4B049EA3E53F1C4B17734410A33DA23A59C1AA269D7A96ADD44F0BA80CB02A940F681989B6DFC76C216A6EB9C3FF950B5B59EFBB4A9C6823AFEF99819FED85541EFD7E0C5F6A88E992ACC99DC4C9D53B361763C45A4FAB613E39FF27971F2D5DB123F2F0B2B32D9A9752C8D9605F4CD3521C2DB9A86000A3040A16231F61278C7747C3AB18DBEC00A5D71023B50B134A28E51CDB419A66BA170DF618817342F7861174AA8E7499B974DBFEB9FC643B0E95645C1C4D81104BCE53DA6E6CF31B6A0085F79F2E0626482D68A5A0A45C4EAF45640D58D2F8E5164D64560CDEEA0982138CA867A870CD01A63742847ACF3A516F49&quot;)),
-    p: Base64URL.stringify(hexStringToUint8Array(&quot;E26893B808CA31E1F9B89E4A077F7B414C216E46048126DC0369A27E64A4BC4DB4D7C81BE79AA40472B5795AF27F5FE6E372CD95CE8EFDA93A81FCDD64866F4B93421A33E5D2AD3DA65529BBCA85392B2907003AEEA187EFA9459592E7FDDE328254BBC1F2EBBB8FF962CF2A2CBB3E0EA54BBE2C29A2C3A7CB25AAC0CE405E9D&quot;)),
-    q: Base64URL.stringify(hexStringToUint8Array(&quot;C4762BCE48AFB669F3FEC19C867586734ABEA433A42A2729B51A6FDA93052085F19C55F968C7845C866356E8D7B70532D5494520DD866494AFCB9289EFD9AEFD7C8D9C51CCCDE747F80DDE7B7BBC875514AD917EBD4BB5FDEE14FF1EBB34DD5D79DCD448ACA737BA459773A4B9284C056195F9CC3338F75C5407D5B9997150C7&quot;)),
-    dp: Base64URL.stringify(hexStringToUint8Array(&quot;7C1CC3CD80D40660501A8A7B1E7D1DBDFFD3DBB57A46AA5CB56A34EF809065C15B3F66AD155B4A4A3DEF8964F7C62776547CDC8220C775FA4CDE71159443B5C302289C6092BDD8C610E66288554E8EB640395C40F20B8E8F2C85BEA6D791ED3A5703C8215BDF29E494DB3BA16CFFFFD6DB7A17F7F1A30E0A6F6C689C64F41869&quot;)),
-    dq: Base64URL.stringify(hexStringToUint8Array(&quot;8E61360E220F761C0380B5C042921A06A43CD5B3B75DF553FCB4542C0C30C3094FB90575E3C1F4E33961F5327A6361991D8A2457553478E0692717E46FB74B62DA49A6E8818D17F8C88504A06964908FD09499C5485AFE62319175F347A96064C6548C64BEFBD11F662004E7746907EF3E71FABF4AC016450B81421B6860FF31&quot;)),
-    qi: Base64URL.stringify(hexStringToUint8Array(&quot;6025FFA4BC1B3010354E1547D167309A7CADA8D72B3021304E6EC1C80D9E53A9D66D0AD42EF7FB9BDFE4CDF2D4723B27A405650501B924C5CCCB44AAE29B706F2C2C6B9F86F0A00E38E4762F7BF8842F84CACF5FB6014CFF78B4A38D1E7901F86F785A3DB9EDAC878C83C23394EB9560A7FDFB642E283A1679175DECDB1DC539&quot;))
-};
-
-var data = asciiToUint8Array(&quot;Hello, world!&quot;);
-
-debug(&quot;Importing a public key...&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
-    publicKey = result;
-    debug(&quot;\nImporting a private key...&quot;);
-    return crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;sign&quot;, &quot;verify&quot;]);
-}).then(function(result) {
-    privateKey = result;
-    debug(&quot;\nSigning some text...&quot;);
-    return crypto.subtle.sign({ name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;SHA-256&quot; }, privateKey, data);
-}).then(function(result) {
-    signature = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(signature))&quot;, &quot;'0fd9a8aef4cc1876c0b762545336c6d1fb315ae16ae4b5e4bf34d384d8585ea7a01e76ea09ee7f7ee8d1c122e7dd15b7c94a573b2aa07203e8d13bc6fd16156cd8e5f0c15a15dccb62d152127fca09882fb53bc3e60ab586d15b95cf411e3aab4a1c231a7e91aab09ee3d4b13d11e97505ddff77683470da510ee76e8bd530c56a85f901626a5a710f716f113dfe9cf6c473ee16fa248aea3480a1033abe30f4c1243289a661e64d7818b55698280688097135968c6d4b029496d85cab2a67e4696737781f70e4392c7df71bbd6c92465947f029a1de48160aced11b5721b1cd25039fe2c16c2b38de73df3b9a83e3ea755fd0cfe51ca06b61fadf6d84677f95'&quot;);
-
-    debug(&quot;\nVerifying the signature...&quot;);
-    return crypto.subtle.verify({ name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;SHA-256&quot; }, publicKey, signature, data);
-}).then(function(result) {
-    verificationResult = result;
-    shouldBe(&quot;verificationResult&quot;, &quot;true&quot;);
-    debug(&quot;\nVerifying a bad signature...&quot;);
-    return crypto.subtle.verify({ name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;SHA-256&quot; }, publicKey, new Uint8Array(256), data);
-}).then(function(result) {
-    verificationResult = result;
-    shouldBe(&quot;verificationResult&quot;, &quot;false&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha1expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-1-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-1-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-1-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,16 +0,0 @@
</span><del>-Test crypto.subtle.digest.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-SHA1 of []
-PASS bytesToHexString(new Uint8Array(digest)) is 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
-SHA1 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is '5ba93c9db0cff93f52b521d7420e43f6eda2784f'
-SHA1 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '2c7e7c384f7829694282b1e3a6216def8082d055'
-PASS crypto.subtle.generateKey('sha-1') threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha1html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-1.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-1.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-1.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,44 +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 crypto.subtle.digest.&quot;);
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
-    debug(&quot;SHA1 of []&quot;);
-    return crypto.subtle.digest('sha-1', new Uint8Array([]));
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'da39a3ee5e6b4b0d3255bfef95601890afd80709'&quot;);
-
-    debug(&quot;SHA1 of [0x0]&quot;)
-    return crypto.subtle.digest({name: 'sha-1'}, new Uint8Array([0]));
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'5ba93c9db0cff93f52b521d7420e43f6eda2784f'&quot;);
-
-    debug(&quot;SHA1 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]&quot;);
-    var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
-    return crypto.subtle.digest({name: 'sha-1'}, data);
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'2c7e7c384f7829694282b1e3a6216def8082d055'&quot;);
-
-    // All SHA-1 can do is digest.
-    shouldThrow(&quot;crypto.subtle.generateKey('sha-1')&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha224expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-224-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-224-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-224-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test crypto.subtle.digest.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-SHA224 of []
-PASS bytesToHexString(new Uint8Array(digest)) is 'd14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f'
-SHA224 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is 'fff9292b4201617bdc4d3053fce02734166a683d7d858a7f5f59b073'
-SHA224 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '767d0cdc11079ba8dca276df5c4b85507de67dce47eda4cd9196d312'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha224html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-224.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-224.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-224.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,41 +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 crypto.subtle.digest.&quot;);
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
-    debug(&quot;SHA224 of []&quot;);
-    return crypto.subtle.digest('sha-224', new Uint8Array([]));
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f'&quot;);
-
-    debug(&quot;SHA224 of [0x0]&quot;)
-    return crypto.subtle.digest({name: 'sha-224'}, new Uint8Array([0]));
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'fff9292b4201617bdc4d3053fce02734166a683d7d858a7f5f59b073'&quot;);
-
-    debug(&quot;SHA224 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]&quot;);
-    var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
-    return crypto.subtle.digest({name: 'sha-224'}, data);
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'767d0cdc11079ba8dca276df5c4b85507de67dce47eda4cd9196d312'&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha256expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-256-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-256-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-256-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test crypto.subtle.digest.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-SHA256 of []
-PASS bytesToHexString(new Uint8Array(digest)) is 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
-SHA256 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is '6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d'
-SHA256 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '78a6273103d17c39a0b6126e226cec70e33337f4bc6a38067401b54a33e78ead'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha256html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-256.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-256.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-256.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,41 +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 crypto.subtle.digest.&quot;);
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
-    debug(&quot;SHA256 of []&quot;);
-    return crypto.subtle.digest('sha-256', new Uint8Array([]));
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'&quot;);
-
-    debug(&quot;SHA256 of [0x0]&quot;)
-    return crypto.subtle.digest({name: 'sha-256'}, new Uint8Array([0]));
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d'&quot;);
-
-    debug(&quot;SHA256 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]&quot;);
-    var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
-    return crypto.subtle.digest({name: 'sha-256'}, data);
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'78a6273103d17c39a0b6126e226cec70e33337f4bc6a38067401b54a33e78ead'&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha384expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-384-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-384-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-384-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test crypto.subtle.digest.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-SHA384 of []
-PASS bytesToHexString(new Uint8Array(digest)) is '38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b'
-SHA384 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is 'bec021b4f368e3069134e012c2b4307083d3a9bdd206e24e5f0d86e13d6636655933ec2b413465966817a9c208a11717'
-SHA384 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '89bfcf569ae4af718510da78c67414109f5739bb5c40d51c9c8c50e2b2cee86f2f80c8b9d68f7c01201a0714572fe602'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha384html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-384.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-384.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-384.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,41 +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 crypto.subtle.digest.&quot;);
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
-    debug(&quot;SHA384 of []&quot;);
-    return crypto.subtle.digest('sha-384', new Uint8Array([]));
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b'&quot;);
-
-    debug(&quot;SHA384 of [0x0]&quot;)
-    return crypto.subtle.digest({name: 'sha-384'}, new Uint8Array([0]));
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'bec021b4f368e3069134e012c2b4307083d3a9bdd206e24e5f0d86e13d6636655933ec2b413465966817a9c208a11717'&quot;);
-
-    debug(&quot;SHA384 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]&quot;);
-    var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
-    return crypto.subtle.digest({name: 'sha-384'}, data);
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'89bfcf569ae4af718510da78c67414109f5739bb5c40d51c9c8c50e2b2cee86f2f80c8b9d68f7c01201a0714572fe602'&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha512expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-512-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-512-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-512-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test crypto.subtle.digest.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-SHA512 of []
-PASS bytesToHexString(new Uint8Array(digest)) is 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'
-SHA512 of [0x0]
-PASS bytesToHexString(new Uint8Array(digest)) is 'b8244d028981d693af7b456af8efa4cad63d282e19ff14942c246e50d9351d22704a802a71c3580b6370de4ceb293c324a8423342557d4e5c38438f0e36910ee'
-SHA512 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-PASS bytesToHexString(new Uint8Array(digest)) is '8ffaee0cccc162851faf051ae38667eefd423c0164c50055f8ade00afc3705e3cdeb9900004b0e426ca66ab63aa3b99b075273f44fd37c22a3555c6fd1f37ccb'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlesha512html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/sha-512.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/sha-512.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/sha-512.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,41 +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 crypto.subtle.digest.&quot;);
-
-jsTestIsAsync = true;
-
-Promise.resolve(null).then(function() {
-    debug(&quot;SHA512 of []&quot;);
-    return crypto.subtle.digest('sha-512', new Uint8Array([]));
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'&quot;);
-
-    debug(&quot;SHA512 of [0x0]&quot;)
-    return crypto.subtle.digest({name: 'sha-512'}, new Uint8Array([0]));
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'b8244d028981d693af7b456af8efa4cad63d282e19ff14942c246e50d9351d22704a802a71c3580b6370de4ceb293c324a8423342557d4e5c38438f0e36910ee'&quot;);
-
-    debug(&quot;SHA512 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]&quot;);
-    var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
-    return crypto.subtle.digest({name: 'sha-512'}, data);
-}).then(function(result) {
-    digest = result;
-    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'8ffaee0cccc162851faf051ae38667eefd423c0164c50055f8ade00afc3705e3cdeb9900004b0e426ca66ab63aa3b99b075273f44fd37c22a3555c6fd1f37ccb'&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleunimplementedunwrapcrashexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,9 +0,0 @@
</span><del>-Make sure that unwrap does not cause a crash.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleunimplementedunwrapcrashhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,26 +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/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;Make sure that unwrap does not cause a crash.&quot;);
-
-jsTestIsAsync = true;
-
-crypto.subtle.generateKey({name: &quot;AES-KW&quot;, length: 256}, false, [&quot;wrapKey&quot;]).then(function(wrappingKey) {
-    return crypto.subtle.generateKey({name: &quot;HMAC&quot;, hash: {name: &quot;SHA-256&quot;}}, true, [&quot;sign&quot;, &quot;verify&quot;]).then(function(aesKey) {
-        return crypto.subtle.wrapKey(&quot;raw&quot;, aesKey, wrappingKey, {name: &quot;AES-KW&quot;});
-    });
-}).then(finishJSTest, finishJSTest); // OK if the browser does not crash.
-&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="trunkLayoutTestscryptosubtleunwrapKeycheckusageexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-CONSOLE MESSAGE: line 1: Key usages do not include 'unwrapKey'
-Verify that usage is respected in unwrapKey operation.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing RSA keys...
-Importing an AES key...
-Wrapping it...
-Unwrapping it...
-PASS crypto.subtle.unwrapKey(&quot;raw&quot;, wrappedKey, privateKey, wrapAlgorithm, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtleunwrapKeycheckusagehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage.html        2016-10-06 21:32:02 UTC (rev 206883)
</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;Verify that usage is respected in unwrapKey operation.&quot;);
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RSA-OAEP&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;
-};
-
-var privateKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RSA-OAEP&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;,
-    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 wrapAlgorithm = {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;};
-var extractable = true;
-var nonExtractable = false;
-
-debug(&quot;Importing RSA keys...&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;wrapKey&quot;]).then(function(result) {
-    publicKey = result;
-    return crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;]);
-}).then(function(result) {
-    privateKey = result;
-
-    debug(&quot;Importing an AES key...&quot;);
-    aesKeyData = hexStringToUint8Array(&quot;603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4&quot;);
-    return crypto.subtle.importKey(&quot;raw&quot;, aesKeyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])
-}).then(function(result) {
-    aesKey = result;
-
-    debug(&quot;Wrapping it...&quot;);
-    return crypto.subtle.wrapKey(&quot;raw&quot;, aesKey, publicKey, wrapAlgorithm);
-}).then(function(result) {
-    wrappedKey = result;
-
-    debug(&quot;Unwrapping it...&quot;);
-    // privateKey lacks unwrapKey usage.
-    shouldThrow('crypto.subtle.unwrapKey(&quot;raw&quot;, wrappedKey, privateKey, wrapAlgorithm, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&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;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlewrapKeycheckusageexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-CONSOLE MESSAGE: line 1: Key usages do not include 'wrapKey'
-Verify that usage is respected in wrapKey operation.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Importing an RSA key...
-Importing an AES key...
-Wrapping it...
-PASS crypto.subtle.wrapKey(&quot;raw&quot;, aesKey, publicKey, wrapAlgorithm) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlewrapKeycheckusagehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/wrapKey-check-usage.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/wrapKey-check-usage.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/subtle/wrapKey-check-usage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,46 +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;Verify that usage is respected in wrapKey operation.&quot;);
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RSA-OAEP&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;
-};
-
-var wrapAlgorithm = {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;};
-var extractable = true;
-var nonExtractable = false;
-
-debug(&quot;Importing an RSA key...&quot;);
-crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;unwrapKey&quot;]).then(function(result) {
-    publicKey = result;
-
-    debug(&quot;Importing an AES key...&quot;);
-    aesKeyData = hexStringToUint8Array(&quot;603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4&quot;);
-    return crypto.subtle.importKey(&quot;raw&quot;, aesKeyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])
-}).then(function(result) {
-    aesKey = result;
-
-    debug(&quot;Wrapping it...&quot;);
-    // publicKey lacks wrapKey usage.
-    shouldThrow('crypto.subtle.wrapKey(&quot;raw&quot;, aesKey, publicKey, wrapAlgorithm)');
-    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="trunkLayoutTestscryptowebkitSubtleaescbc192encryptdecryptexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbc192encryptdecryptexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test AES-CBC encrypt and decrypt functions with a 256 bit key.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a raw AES key from string literal...
+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']
+Using the key to encrypt plaintext...
+PASS bytesToHexString(new Uint8Array(encryptionResult)) is '4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'
+Decrypting it back...
+PASS new Uint8Array(decryptionResult) is plaintext
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbc192encryptdecrypthtmlfromrev206882trunkLayoutTestscryptosubtleaescbc192encryptdecrypthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,48 @@
</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 AES-CBC encrypt and decrypt functions with a 256 bit key.&quot;);
+
+jsTestIsAsync = true;
+
+var keyData = hexStringToUint8Array(&quot;8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b&quot;);
+var iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
+var plaintext = hexStringToUint8Array(&quot;6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710&quot;);
+var extractable = true;
+
+debug(&quot;Importing a raw AES key from string literal...&quot;);
+crypto.webkitSubtle.importKey(&quot;raw&quot;, keyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&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']&quot;);
+
+    debug(&quot;Using the key to encrypt plaintext...&quot;);
+    return crypto.webkitSubtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext);
+}).then(function(result) {
+    encryptionResult = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(encryptionResult))&quot;, &quot;'4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'&quot;);
+
+    debug(&quot;Decrypting it back...&quot;);
+    return crypto.webkitSubtle.decrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, result);
+}).then(function(result) {
+    decryptionResult = result;
+    shouldBe(&quot;new Uint8Array(decryptionResult)&quot;, &quot;plaintext&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="trunkLayoutTestscryptowebkitSubtleaescbc256encryptdecryptexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbc256encryptdecryptexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test AES-CBC encrypt and decrypt functions with a 256 bit key.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a raw AES key from string literal...
+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']
+Using the key to encrypt plaintext...
+PASS bytesToHexString(new Uint8Array(encryptionResult)) is 'f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644'
+Decrypting it back...
+PASS new Uint8Array(decryptionResult) is plaintext
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbc256encryptdecrypthtmlfromrev206882trunkLayoutTestscryptosubtleaescbc256encryptdecrypthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,48 @@
</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 AES-CBC encrypt and decrypt functions with a 256 bit key.&quot;);
+
+jsTestIsAsync = true;
+
+var keyData = hexStringToUint8Array(&quot;603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4&quot;);
+var iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
+var plaintext = hexStringToUint8Array(&quot;6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710&quot;);
+var extractable = true;
+
+debug(&quot;Importing a raw AES key from string literal...&quot;);
+crypto.webkitSubtle.importKey(&quot;raw&quot;, keyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&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']&quot;);
+
+    debug(&quot;Using the key to encrypt plaintext...&quot;);
+    return crypto.webkitSubtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext);
+}).then(function(result) {
+    encryptionResult = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(encryptionResult))&quot;, &quot;'f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644'&quot;);
+
+    debug(&quot;Decrypting it back...&quot;);
+    return crypto.webkitSubtle.decrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, result);
+}).then(function(result) {
+    decryptionResult = result;
+    shouldBe(&quot;new Uint8Array(decryptionResult)&quot;, &quot;plaintext&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="trunkLayoutTestscryptowebkitSubtleaescbcencryptdecryptexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcencryptdecryptexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+Test AES-CBC encrypt and decrypt functions.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a raw AES key from string literal...
+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']
+Using the key to encrypt plaintext...
+PASS bytesToHexString(new Uint8Array(encryptionResult)) is '7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012'
+Decrypting it back...
+PASS new Uint8Array(decryptionResult) is plaintext
+Testing initialization vector bindings...
+PASS crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: null}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
+PASS crypto.webkitSubtle.encrypt({name: 'AES-CBC'}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
+PASS crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: 3}, key, plaintext) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
+PASS crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: new Uint8Array([0])}, key, plaintext) threw exception Error: AES-CBC initialization data must be 16 bytes.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcencryptdecryptwithpaddingexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddingexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test AES-CBC encrypt and decrypt functions on a plaintext that is not a multiple of block size in length.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a raw AES key from string literal...
+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']
+Using the key to encrypt plaintext...
+PASS bytesToHexString(new Uint8Array(cyphertext)) is '630199c5f202cc7167bb84c6c72b349d'
+Decrypting it back...
+PASS new Uint8Array(decryptionResult) is plaintext
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcencryptdecryptwithpaddinghtmlfromrev206882trunkLayoutTestscryptosubtleaescbcencryptdecryptwithpaddinghtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 AES-CBC encrypt and decrypt functions on a plaintext that is not a multiple of block size in length.&quot;);
+
+jsTestIsAsync = true;
+
+var keyData = hexStringToUint8Array(&quot;2b7e151628aed2a6abf7158809cf4f3c&quot;);
+var iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
+var plaintext = asciiToUint8Array(&quot;test&quot;);
+var extractable = true;
+
+debug(&quot;Importing a raw AES key from string literal...&quot;);
+crypto.webkitSubtle.importKey(&quot;raw&quot;, keyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&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']&quot;);
+
+    debug(&quot;Using the key to encrypt plaintext...&quot;);
+    return crypto.webkitSubtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext);
+}).then(function(result) {
+    cyphertext = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(cyphertext))&quot;, &quot;'630199c5f202cc7167bb84c6c72b349d'&quot;);
+
+    debug(&quot;Decrypting it back...&quot;);
+    return crypto.webkitSubtle.decrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, result);
+}).then(function(result) {
+    decryptionResult = result;
+    shouldBe(&quot;new Uint8Array(decryptionResult)&quot;, &quot;plaintext&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="trunkLayoutTestscryptowebkitSubtleaescbcencryptdecrypthtmlfromrev206882trunkLayoutTestscryptosubtleaescbcencryptdecrypthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,54 @@
</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 AES-CBC encrypt and decrypt functions.&quot;);
+
+jsTestIsAsync = true;
+
+var keyData = hexStringToUint8Array(&quot;2b7e151628aed2a6abf7158809cf4f3c&quot;);
+var iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
+var plaintext = hexStringToUint8Array(&quot;6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710&quot;);
+var extractable = true;
+
+debug(&quot;Importing a raw AES key from string literal...&quot;);
+crypto.webkitSubtle.importKey(&quot;raw&quot;, keyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&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']&quot;);
+
+    debug(&quot;Using the key to encrypt plaintext...&quot;);
+    return crypto.webkitSubtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext);
+}).then(function(result) {
+    encryptionResult = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(encryptionResult))&quot;, &quot;'7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012'&quot;);
+
+    debug(&quot;Decrypting it back...&quot;);
+    return crypto.webkitSubtle.decrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, result);
+}).then(function(result) {
+    decryptionResult = result;
+    shouldBe(&quot;new Uint8Array(decryptionResult)&quot;, &quot;plaintext&quot;);
+
+    debug(&quot;Testing initialization vector bindings...&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: null}, key, plaintext)&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.encrypt({name: 'AES-CBC'}, key, plaintext)&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: 3}, key, plaintext)&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.encrypt({name: 'AES-CBC', iv: new Uint8Array([0])}, key, plaintext)&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="trunkLayoutTestscryptowebkitSubtleaescbcgeneratekeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test generating an AES key using AES-CBC algorithm.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS crypto.webkitSubtle.generateKey(&quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]) threw exception TypeError: Type error.
+PASS crypto.webkitSubtle.generateKey({name: &quot;aes-cbc&quot;}, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]) threw exception TypeError: Value NaN is outside the range [0, 65535].
+PASS crypto.webkitSubtle.generateKey({name: &quot;aes-cbc&quot;, length: undefined}, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]) threw exception TypeError: Value NaN is outside the range [0, 65535].
+PASS crypto.webkitSubtle.generateKey({name: &quot;aes-cbc&quot;, length: {}}, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]) threw exception TypeError: Value NaN is outside the range [0, 65535].
+Generating 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']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcgeneratekeyhtmlfromrev206882trunkLayoutTestscryptosubtleaescbcgeneratekeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-generate-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-generate-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 generating an AES key using AES-CBC algorithm.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+shouldThrow('crypto.webkitSubtle.generateKey(&quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;])');
+shouldThrow('crypto.webkitSubtle.generateKey({name: &quot;aes-cbc&quot;}, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;])');
+shouldThrow('crypto.webkitSubtle.generateKey({name: &quot;aes-cbc&quot;, length: undefined}, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;])');
+shouldThrow('crypto.webkitSubtle.generateKey({name: &quot;aes-cbc&quot;, length: {}}, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;])');
+
+debug(&quot;Generating a key...&quot;);
+crypto.webkitSubtle.generateKey({name: &quot;aes-cbc&quot;, length: 128}, extractable, [&quot;encrypt&quot;, &quot;decrypt&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']&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="trunkLayoutTestscryptowebkitSubtleaescbcimportjwkexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcimportjwkexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test importing a JWK key for AES-CBC.
+
+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 192
+PASS key.usages is [&quot;encrypt&quot;]
+
+Using the key to encrypt plaintext...
+PASS bytesToHexString(new Uint8Array(encryptionResult)) is '4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcimportjwkhtmlfromrev206882trunkLayoutTestscryptosubtleaescbcimportjwkhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-import-jwk.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,52 @@
</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 key for AES-CBC.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+var iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
+var plaintext = hexStringToUint8Array(&quot;6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710&quot;);
+
+var jwkKey = {
+    &quot;kty&quot;: &quot;oct&quot;,
+    &quot;alg&quot;: &quot;A192CBC&quot;,
+    &quot;use&quot;: &quot;enc&quot;,
+    &quot;ext&quot;: true,
+    &quot;k&quot;: &quot;jnOw99oOZFLIEPMrgJB55WL46tJSLGt7&quot;
+};
+
+var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
+
+debug(&quot;Importing a key...\n&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, null, false, [&quot;encrypt&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;192&quot;);
+    shouldBe(&quot;key.usages&quot;, '[&quot;encrypt&quot;]');
+
+    debug(&quot;\nUsing the key to encrypt plaintext...&quot;);
+    return crypto.webkitSubtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext);
+}).then(function(result) {
+    encryptionResult = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(encryptionResult))&quot;, &quot;'4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd612ccd79224b350935d45dd6a98f8176'&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="trunkLayoutTestscryptowebkitSubtleaescbcinvalidlengthexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcinvalidlengthexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+Test an unsupported AES key length.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a raw AES key from string literal...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'AES-CBC'
+PASS key.algorithm.length is 176
+PASS key.usages is ['decrypt', 'encrypt']
+Using the key to encrypt plaintext...
+Failed, as expected. Note that the spec doesn't appear to clearly define which step should fail.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcinvalidlengthhtmlfromrev206882trunkLayoutTestscryptosubtleaescbcinvalidlengthhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-invalid-length.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-invalid-length.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 an unsupported AES key length.&quot;);
+
+jsTestIsAsync = true;
+
+var keyData = hexStringToUint8Array(&quot;8e73b0f7da0e6452c810f32b809079e562f8ead2522c&quot;);
+var iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
+var plaintext = hexStringToUint8Array(&quot;6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710&quot;);
+var extractable = true;
+
+debug(&quot;Importing a raw AES key from string literal...&quot;);
+crypto.webkitSubtle.importKey(&quot;raw&quot;, keyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&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;176&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
+
+    debug(&quot;Using the key to encrypt plaintext...&quot;);
+    return crypto.webkitSubtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, [plaintext]);
+}).then(undefined, function(result) {
+    debug(&quot;Failed, as expected. Note that the spec doesn't appear to clearly define which step should fail.&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="trunkLayoutTestscryptowebkitSubtleaescbcunwrapfailureexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcunwrapfailureexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test unwrapping an RSA key with AES-CBC.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing an unwrapping key...
+PASS unwrappingKey.algorithm.name is 'AES-CBC'
+Unwrapping a key...
+PASS Promise rejected
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcunwrapfailurehtmlfromrev206882trunkLayoutTestscryptosubtleaescbcunwrapfailurehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-failure.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,38 @@
</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 unwrapping an RSA key with AES-CBC.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var unwrappingKeyOctets = hexStringToUint8Array(&quot;2a00e0e776e94e4dc89bf947cebdebe1&quot;);
+var wrappedKey = hexStringToUint8Array(&quot;b490dedb3abc3fd545e146538e6cc3ca&quot;); // An empty encrypted JSON.
+
+debug(&quot;Importing an unwrapping key...&quot;);
+crypto.webkitSubtle.importKey(&quot;raw&quot;, unwrappingKeyOctets, &quot;AES-CBC&quot;, nonExtractable, [&quot;unwrapKey&quot;]).then(function(result) {
+    unwrappingKey = result;
+    shouldBe(&quot;unwrappingKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    var unwrapAlgorithm = {name: &quot;AES-CBC&quot;, iv: hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;)};
+    debug(&quot;Unwrapping a key...&quot;);
+    return crypto.webkitSubtle.unwrapKey(&quot;jwk&quot;, wrappedKey, unwrappingKey, unwrapAlgorithm, null, extractable, [&quot;sign&quot;, &quot;verify&quot;, &quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrap&quot;, &quot;unwrap&quot;]);
+}).then(undefined, function(result) {
+    testPassed(&quot;Promise rejected&quot;);
+    finishJSTest();
+});
+
+&lt;/script&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcunwraprsaexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcunwraprsaexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Test unwrapping an RSA key with AES-CBC.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing an unwrapping key...
+PASS unwrappingKey.algorithm.name is 'AES-CBC'
+Unwrapping a key...
+PASS unwrappedKey.toString() is '[object CryptoKey]'
+PASS unwrappedKey.type is 'public'
+PASS unwrappedKey.usages is ['sign','verify']
+PASS unwrappedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS unwrappedKey.algorithm.modulusLength is 2048
+PASS Base64URL.stringify(unwrappedKey.algorithm.publicExponent) is publicKeyJSON.e
+PASS unwrappedKey.algorithm.hash.name is 'SHA-256'
+PASS unwrappedKey.extractable is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcunwraprsahtmlfromrev206882trunkLayoutTestscryptosubtleaescbcunwraprsahtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-unwrap-rsa.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,56 @@
</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 unwrapping an RSA key with AES-CBC.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;,
+    ext: false,
+    use: &quot;sig&quot;
+};
+
+var unwrappingKeyOctets = hexStringToUint8Array(&quot;2a00e0e776e94e4dc89bf947cebdebe1&quot;);
+var wrappedKey = hexStringToUint8Array(&quot;3511f6028db04ea97e7cfad3c4cc60837bceff25cb6c88292fbcb4547570afdc32e4003fe4d65f1e7df60dc1fdb3df36c3f58ab228e33aa31005852d46d0c2ad1318435a071bbb5bbb05650ea63d551698b0c040dd95ed0d379b5e2eccb545ae5620acb8051174cd2ad647328ad99dcd462fec40748724eb1e68f209f779faa2c35b4d4d1b6604a74e62a1846249ea6192954a5af10c71ebfea79948142441ed307e9f52e797a51a8007a6f87b57c51f9e7eef54b7e4a1f818ba6ac25ee5935c23b3253d6d9d222262c79ccdb7147d9c07527c22fe7a4ab91af20479edf5930b3c053c0a0b27092cfb53203633d01dcf6e333b5be7c1933c321c953f962b934ebefd9df8cca6c0a25fcd5fb96105435c42d9902406f82bc8daa8ec12fa85d9afa65adbfe3f60828ef64adaf43ad8e3b0af104cbfafd994323732bba08f84d5cac1d157b276233dffecafe47942b83c85ead6d5886c6badf534d4a32d3f545e8032dd5e419d7bff3acde2c37a96fc34fda8747d89500bf9f7ef45873c6b3b2741aaf74ff96a2f950028f38eb62f1be936fe0a994ebfa928021c0c96172d84584e&quot;);
+
+debug(&quot;Importing an unwrapping key...&quot;);
+crypto.webkitSubtle.importKey(&quot;raw&quot;, unwrappingKeyOctets, &quot;AES-CBC&quot;, nonExtractable, [&quot;unwrapKey&quot;]).then(function(result) {
+    unwrappingKey = result;
+    shouldBe(&quot;unwrappingKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    var unwrapAlgorithm = {name: &quot;AES-CBC&quot;, iv: hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;)};
+    debug(&quot;Unwrapping a key...&quot;);
+    return crypto.webkitSubtle.unwrapKey(&quot;jwk&quot;, wrappedKey, unwrappingKey, unwrapAlgorithm, null, extractable, [&quot;sign&quot;, &quot;verify&quot;, &quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrap&quot;, &quot;unwrap&quot;]);
+}).then(function(result) {
+    unwrappedKey = result;
+
+    shouldBe(&quot;unwrappedKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;unwrappedKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['sign','verify']&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;Base64URL.stringify(unwrappedKey.algorithm.publicExponent)&quot;, &quot;publicKeyJSON.e&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.hash.name&quot;, &quot;'SHA-256'&quot;);
+    shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;false&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="trunkLayoutTestscryptowebkitSubtleaescbcwraprsaexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcwraprsaexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Test wrapping an RSA key with AES-CBC.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key to wrap...
+PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
+Importing a key encryption key...
+PASS wrappingKey.algorithm.name is 'AES-CBC'
+PASS wrappedKey.toString() is '[object ArrayBuffer]'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcwraprsanonextractableexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcwraprsanonextractableexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test wrapping an RSA key with AES-CBC.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a key to wrap...
+PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
+Importing a key encryption key...
+PASS wrappingKey.algorithm.name is 'AES-CBC'
+wrapping the key...
+PASS Rejected
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcwraprsanonextractablehtmlfromrev206882trunkLayoutTestscryptosubtleaescbcwraprsanonextractablehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,52 @@
</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 wrapping an RSA key with AES-CBC.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;,
+    ext: false,
+    use: &quot;sig&quot;
+};
+
+var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
+var wrappingKeyOctets = hexStringToUint8Array(&quot;2a00e0e776e94e4dc89bf947cebdebe1&quot;);
+
+debug(&quot;Importing a key to wrap...&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, null, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+    debug(&quot;Importing a key encryption key...&quot;);
+    return crypto.webkitSubtle.importKey(&quot;raw&quot;, wrappingKeyOctets, &quot;AES-CBC&quot;, nonExtractable, [&quot;wrapKey&quot;]);
+}).then(function(result) {
+    wrappingKey = result;
+    shouldBe(&quot;wrappingKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    var wrapAlgorithm = {name: &quot;AES-CBC&quot;, iv: hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;)};
+    debug(&quot;wrapping the key...&quot;);
+    return crypto.webkitSubtle.wrapKey(&quot;jwk&quot;, key, wrappingKey, wrapAlgorithm);
+}).then(undefined, function() {
+    testPassed(&quot;Rejected&quot;);
+    finishJSTest();
+});
+
+&lt;/script&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcwraprsahtmlfromrev206882trunkLayoutTestscryptosubtleaescbcwraprsahtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrap-rsa.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,52 @@
</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 wrapping an RSA key with AES-CBC.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;,
+    ext: true,
+    use: &quot;sig&quot;
+};
+
+var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
+var wrappingKeyOctets = hexStringToUint8Array(&quot;2a00e0e776e94e4dc89bf947cebdebe1&quot;);
+
+debug(&quot;Importing a key to wrap...&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, null, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+    debug(&quot;Importing a key encryption key...&quot;);
+    return crypto.webkitSubtle.importKey(&quot;raw&quot;, wrappingKeyOctets, &quot;AES-CBC&quot;, nonExtractable, [&quot;wrapKey&quot;]);
+}).then(function(result) {
+    wrappingKey = result;
+    shouldBe(&quot;wrappingKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    var wrapAlgorithm = {name: &quot;AES-CBC&quot;, iv: hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;)};
+    return crypto.webkitSubtle.wrapKey(&quot;jwk&quot;, key, wrappingKey, wrapAlgorithm);
+}).then(function(result) {
+    wrappedKey = result;
+    shouldBe(&quot;wrappedKey.toString()&quot;, &quot;'[object ArrayBuffer]'&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="trunkLayoutTestscryptowebkitSubtleaescbcwrongkeyclassexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaescbcwrongkeyclassexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+Test calling AES-CBC encrypt with a HMAC key.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a raw HMAC key from string literal...
+Using the key to encrypt plaintext...
+PASS crypto.webkitSubtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaescbcwrongkeyclasshtmlfromrev206882trunkLayoutTestscryptosubtleaescbcwrongkeyclasshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-cbc-wrong-key-class.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,33 @@
</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 calling AES-CBC encrypt with a HMAC key.&quot;);
+
+jsTestIsAsync = true;
+
+var iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
+var plaintext = hexStringToUint8Array(&quot;6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710&quot;);
+var hmacKey = asciiToUint8Array('a');
+var extractable = true;
+
+debug(&quot;Importing a raw HMAC key from string literal...&quot;);
+crypto.webkitSubtle.importKey(&quot;raw&quot;, hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, [&quot;sign&quot;, &quot;verify&quot;, &quot;encrypt&quot;, &quot;decrypt&quot;]).then(function(result) {
+    key = result;
+    debug(&quot;Using the key to encrypt plaintext...&quot;);
+    shouldThrow('crypto.webkitSubtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, plaintext)')
+
+    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="trunkLayoutTestscryptowebkitSubtleaesexportkeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/aes-export-key-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-export-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-export-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+Test exporting an AES key.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS crypto.webkitSubtle.exportKey(&quot;raw&quot;) threw exception TypeError: Not enough arguments.
+PASS crypto.webkitSubtle.exportKey(&quot;raw&quot;, null) threw exception TypeError: Type error.
+PASS crypto.webkitSubtle.exportKey(&quot;raw&quot;, undefined) threw exception TypeError: Type error.
+PASS crypto.webkitSubtle.exportKey(&quot;raw&quot;, {}) threw exception TypeError: Type error.
+PASS crypto.webkitSubtle.exportKey(&quot;raw&quot;, 1) threw exception TypeError: Type error.
+
+Importing a JWK key...
+PASS crypto.webkitSubtle.exportKey(null, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey({}, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(&quot;&quot;, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(&quot;foobar&quot;, key) threw exception TypeError: Unknown key format.
+
+Exporting the key as raw data...
+PASS bytesToHexString(new Uint8Array(exportedData)) is '8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b'
+Exporting the key as JWK...
+PASS exportedJWK.kty is 'oct'
+PASS exportedJWK.k is 'jnOw99oOZFLIEPMrgJB55WL46tJSLGt7'
+PASS exportedJWK.alg is 'A192CBC'
+PASS exportedJWK.ext is true
+PASS exportedJWK.use is undefined
+PASS exportedJWK.key_ops is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
+
+Importing a key that's not extractable...
+
+Trying to export as raw...
+PASS Rejected, as expected
+Trying to export as jwk...
+PASS Rejected, as expected
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaesexportkeyhtmlfromrev206882trunkLayoutTestscryptosubtleaesexportkeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-export-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-export-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-export-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-export-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,86 @@
</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 exporting an AES key.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var jwkKey = {
+    kty: &quot;oct&quot;,
+    k: &quot;jnOw99oOZFLIEPMrgJB55WL46tJSLGt7&quot;
+};
+
+var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
+
+shouldThrow('crypto.webkitSubtle.exportKey(&quot;raw&quot;)');
+shouldThrow('crypto.webkitSubtle.exportKey(&quot;raw&quot;, null)');
+shouldThrow('crypto.webkitSubtle.exportKey(&quot;raw&quot;, undefined)');
+shouldThrow('crypto.webkitSubtle.exportKey(&quot;raw&quot;, {})');
+shouldThrow('crypto.webkitSubtle.exportKey(&quot;raw&quot;, 1)');
+
+debug(&quot;\nImporting a JWK key...&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, &quot;AES-CBC&quot;, extractable, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']).then(function(result) {
+    key = result;
+
+    shouldThrow('crypto.webkitSubtle.exportKey(null, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey(undefined, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey({}, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey(&quot;&quot;, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey(&quot;foobar&quot;, key)');
+
+    debug(&quot;\nExporting the key as raw data...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;raw&quot;, key);
+}).then(function(result) {
+    exportedData = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(exportedData))&quot;, &quot;'8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b'&quot;);
+
+    debug(&quot;Exporting the key as JWK...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;jwk&quot;, key);
+}).then(function(result) {
+    exportedJWK = JSON.parse(bytesToASCIIString(result));
+    shouldBe(&quot;exportedJWK.kty&quot;, &quot;'oct'&quot;);
+    shouldBe(&quot;exportedJWK.k&quot;, &quot;'jnOw99oOZFLIEPMrgJB55WL46tJSLGt7'&quot;);
+    shouldBe(&quot;exportedJWK.alg&quot;, &quot;'A192CBC'&quot;);
+    shouldBe(&quot;exportedJWK.ext&quot;, &quot;true&quot;);
+    shouldBe(&quot;exportedJWK.use&quot;, &quot;undefined&quot;);
+    shouldBe(&quot;exportedJWK.key_ops&quot;, &quot;['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']&quot;);
+
+    debug(&quot;\nImporting a key that's not extractable...&quot;);
+    return crypto.webkitSubtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, &quot;AES-CBC&quot;, nonExtractable, ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'])
+}).then(function(result) {
+    key = result;
+
+    debug(&quot;\nTrying to export as raw...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;raw&quot;, key);
+}).then(function(result) {
+    testFailed(&quot;Promise wasn't rejected&quot;);
+    finishJSTest();
+}, function() {
+    testPassed(&quot;Rejected, as expected&quot;);
+
+    debug(&quot;Trying to export as jwk...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;jwk&quot;, key);
+}).then(function(result) {
+    testFailed(&quot;Promise wasn't rejected&quot;);
+    finishJSTest();
+}, function() {
+    testPassed(&quot;Rejected, as expected&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="trunkLayoutTestscryptowebkitSubtleaeskwkeymanipulationexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaeskwkeymanipulationexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+Test generating, importing and exporting keys for AES-KW. Test that they can't be used with another algorithm.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Generating a key...
+PASS key.toString() is '[object CryptoKey]'
+PASS key.type is 'secret'
+PASS key.algorithm.name is 'AES-KW'
+PASS key.algorithm.length is 256
+
+Testing that the key can't be used with AES-CBC...
+PASS crypto.webkitSubtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, hexStringToUint8Array(&quot;00&quot;)) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+
+Exporting the key to raw...
+PASS exportedKey.toString() is '[object ArrayBuffer]'
+Importing it back...
+PASS importedKey.toString() is '[object CryptoKey]'
+PASS importedKey.type is 'secret'
+PASS importedKey.algorithm.name is 'AES-KW'
+PASS importedKey.algorithm.length is 256
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaeskwkeymanipulationhtmlfromrev206882trunkLayoutTestscryptosubtleaeskwkeymanipulationhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-kw-key-manipulation.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-kw-key-manipulation.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,51 @@
</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, importing and exporting keys for AES-KW. Test that they can't be used with another algorithm.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+debug(&quot;Generating a key...&quot;);
+crypto.webkitSubtle.generateKey({name: &quot;aes-kw&quot;, length: 256}, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    key = result;
+    shouldBe(&quot;key.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;key.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'AES-KW'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;256&quot;);
+
+    debug(&quot;\nTesting that the key can't be used with AES-CBC...&quot;);
+    iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
+    shouldThrow('crypto.webkitSubtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, key, hexStringToUint8Array(&quot;00&quot;))');
+
+    debug(&quot;\nExporting the key to raw...&quot;);
+    return crypto.webkitSubtle.exportKey('raw', key);
+}).then(function(result) {
+    exportedKey = result;
+    shouldBe(&quot;exportedKey.toString()&quot;, &quot;'[object ArrayBuffer]'&quot;);
+    debug(&quot;Importing it back...&quot;);
+    return crypto.webkitSubtle.importKey('raw', exportedKey, &quot;aes-kw&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]);
+}).then(function(result) {
+    importedKey = result;
+
+    shouldBe(&quot;importedKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;importedKey.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;importedKey.algorithm.name&quot;, &quot;'AES-KW'&quot;);
+    shouldBe(&quot;importedKey.algorithm.length&quot;, &quot;256&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="trunkLayoutTestscryptowebkitSubtleaeskwwrapunwrapaesexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaeskwwrapunwrapaesexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+Test wrapping and unwrapping keys with AES-KW.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing key encryption key...
+Importing a key to be wrapped...
+Wrapping it...
+PASS bytesToHexString(wrappedKey) is '1fa68b0a8112b447aef34bd8fb5a7b829d3e862371d2cfe5'
+Unwrapping it...
+PASS unwrappedKey.toString() is '[object CryptoKey]'
+PASS unwrappedKey.type is 'secret'
+PASS unwrappedKey.extractable is true
+PASS unwrappedKey.algorithm.name is 'AES-CBC'
+PASS unwrappedKey.algorithm.length is 128
+PASS unwrappedKey.usages is ['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']
+Exporting it...
+PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(keyData)
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaeskwwrapunwrapaeshtmlfromrev206882trunkLayoutTestscryptosubtleaeskwwrapunwrapaeshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,58 @@
</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 wrapping and unwrapping keys with AES-KW.&quot;);
+
+jsTestIsAsync = true;
+
+var kekData = hexStringToUint8Array(&quot;000102030405060708090A0B0C0D0E0F&quot;);
+var keyData = hexStringToUint8Array(&quot;00112233445566778899AABBCCDDEEFF&quot;);
+var extractable = true;
+
+debug(&quot;Importing key encryption key...&quot;);
+crypto.webkitSubtle.importKey(&quot;raw&quot;, kekData, &quot;aes-kw&quot;, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    kek = result;
+
+    debug(&quot;Importing a key to be wrapped...&quot;);
+    return crypto.webkitSubtle.importKey(&quot;raw&quot;, keyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]);
+}).then(function(result) {
+    key = result;
+
+    debug(&quot;Wrapping it...&quot;);
+    return crypto.webkitSubtle.wrapKey(&quot;raw&quot;, key, kek, &quot;aes-kw&quot;);
+}).then(function(result) {
+    wrappedKey = result;
+    shouldBe(&quot;bytesToHexString(wrappedKey)&quot;, &quot;'1fa68b0a8112b447aef34bd8fb5a7b829d3e862371d2cfe5'&quot;); // Result from RFC 3394.
+
+    debug(&quot;Unwrapping it...&quot;);
+    return crypto.webkitSubtle.unwrapKey(&quot;raw&quot;, wrappedKey, kek, &quot;aes-kw&quot;, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]);
+}).then(function(result) {
+    unwrappedKey = result;
+    shouldBe(&quot;unwrappedKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;unwrappedKey.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;128&quot;);
+    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt', 'unwrapKey', 'wrapKey']&quot;);
+
+    debug(&quot;Exporting it...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;raw&quot;, unwrappedKey);
+}).then(function(result) {
+    unwrappedKeyData = result;
+    shouldBe(&quot;bytesToHexString(unwrappedKeyData)&quot;, &quot;bytesToHexString(keyData)&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="trunkLayoutTestscryptowebkitSubtleaespostMessageexpectedtxtfromrev206882trunkLayoutTestscryptosubtleaespostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-postMessage-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Test sending crypto keys via postMessage.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+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 [&quot;decrypt&quot;, &quot;encrypt&quot;]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleaespostMessagehtmlfromrev206882trunkLayoutTestscryptosubtleaespostMessagehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage.html (from rev 206882, trunk/LayoutTests/crypto/subtle/aes-postMessage.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/aes-postMessage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test sending crypto keys via postMessage.&quot;);
+
+jsTestIsAsync = true;
+
+window.addEventListener(&quot;message&quot;, function(evt) {
+    key = evt.data;
+    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&quot;, &quot;encrypt&quot;]');
+
+    finishJSTest();
+}, false);
+
+crypto.webkitSubtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;16 bytes of key!&quot;), {name: &quot;aes-cbc&quot;, length: 128}, true, [&quot;encrypt&quot;, &quot;decrypt&quot;]).then(function(key) {
+    postMessage(key, &quot;*&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="trunkLayoutTestscryptowebkitSubtleargumentconversionexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/argument-conversion-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/argument-conversion-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/argument-conversion-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+Test crypto.webkitSubtle argument conversion
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Passing algorithm name as a string object...
+PASS ...succeeded
+
+Passing algorithm name as a string object in a dictionary...
+PASS ...succeeded
+
+Passing algorithm name as an object with toString
+PASS ...succeeded
+
+Passing invalid data to digest()
+PASS crypto.webkitSubtle.digest({name: 'sha-1'}) threw exception TypeError: Not enough arguments.
+PASS crypto.webkitSubtle.digest({name: 'sha-1'}, null) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
+PASS crypto.webkitSubtle.digest({name: 'sha-1'}, 10) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
+PASS crypto.webkitSubtle.digest({name: 'sha-1'}, [10]) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
+PASS crypto.webkitSubtle.digest({name: 'sha-1'}, [new Uint8Array([0])]) threw exception TypeError: Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData.
+
+Passing invalid algorithmIdentifiers to digest()
+PASS crypto.webkitSubtle.digest({ toString:function() { return 'sha-1' } }, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest({name: ''}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest({name: null}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest({name: undefined}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest({name: 'sha'}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest({name: 1}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest('', data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest(null, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest(undefined, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest(1, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.digest({}, data) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleargumentconversionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/argument-conversion.html (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/argument-conversion.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/argument-conversion.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,56 @@
</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 crypto.webkitSubtle argument conversion&quot;);
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+    debug(&quot;\nPassing algorithm name as a string object...&quot;);
+    return crypto.webkitSubtle.digest(new String('sha-1'), new Uint8Array([]));
+}).then(function(result) {
+    testPassed(&quot;...succeeded&quot;);
+    debug(&quot;\nPassing algorithm name as a string object in a dictionary...&quot;);
+    return crypto.webkitSubtle.digest({name: new String('sha-1')}, new Uint8Array([]));
+}).then(function(result) {
+    testPassed(&quot;...succeeded&quot;);
+    debug(&quot;\nPassing algorithm name as an object with toString&quot;);
+    return crypto.webkitSubtle.digest({name: { toString:function() { return 'sha-1' } } }, new Uint8Array([]));
+}).then(function(result) {
+    testPassed(&quot;...succeeded&quot;);
+
+    debug(&quot;\nPassing invalid data to digest()&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.digest({name: 'sha-1'})&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.digest({name: 'sha-1'}, null)&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.digest({name: 'sha-1'}, 10)&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.digest({name: 'sha-1'}, [10])&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.digest({name: 'sha-1'}, [new Uint8Array([0])])&quot;);
+
+    debug(&quot;\nPassing invalid algorithmIdentifiers to digest()&quot;);
+    data = new Uint8Array([0]);
+    shouldThrow(&quot;crypto.webkitSubtle.digest({ toString:function() { return 'sha-1' } }, data)&quot;); // Algorithm normalization doesn't attempt to call toString.
+    shouldThrow(&quot;crypto.webkitSubtle.digest({name: ''}, data)&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.digest({name: null}, data)&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.digest({name: undefined}, data)&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.digest({name: 'sha'}, data)&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.digest({name: 1}, data)&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.digest('', data)&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.digest(null, data)&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.digest(undefined, data)&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.digest(1, data)&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.digest({}, data)&quot;);
+}).then(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="trunkLayoutTestscryptowebkitSubtlearraybufferviewoffsetexpectedtxtfromrev206882trunkLayoutTestscryptosubtlearraybufferviewoffsetexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Test that an ArrayBufferView with offset is processed correctly.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS bytesToHexString(new Uint8Array(digest)) is '2c7e7c384f7829694282b1e3a6216def8082d055'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlearraybufferviewoffsethtmlfromrev206882trunkLayoutTestscryptosubtlearraybufferviewoffsethtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset.html (from rev 206882, trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/array-buffer-view-offset.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,30 @@
</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 that an ArrayBufferView with offset is processed correctly.&quot;);
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+    var originalData = new Uint8Array([0xf, 0xf, 0xf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0xf, 0xf, 0xf]);
+    var slicedData = new Uint8Array(originalData.buffer, 3, 11);
+    return crypto.webkitSubtle.digest({name: 'sha-1'}, slicedData);
+}).then(function(result) {
+    digest = result;
+    // Expected result for [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'2c7e7c384f7829694282b1e3a6216def8082d055'&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="trunkLayoutTestscryptowebkitSubtlecryptokeyalgorithmgcexpectedtxtfromrev206882trunkLayoutTestscryptosubtlecryptokeyalgorithmgcexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test that CryptoKey.algorithm preserves custom properties.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Generating a HMAC key with default length...
+PASS key.algorithm === key.algorithm is true
+PASS key.algorithm.foo is &quot;bar&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlecryptokeyalgorithmgchtmlfromrev206882trunkLayoutTestscryptosubtlecryptokeyalgorithmgchtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html (from rev 206882, trunk/LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test that CryptoKey.algorithm preserves custom properties.&quot;);
+jsTestIsAsync = true;
+
+debug(&quot;\nGenerating a HMAC key with default length...&quot;);
+crypto.webkitSubtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, true, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+    startTest();
+});
+
+function startTest()
+{
+    shouldBeTrue(&quot;key.algorithm === key.algorithm&quot;);
+    key.algorithm.foo = &quot;bar&quot;;
+    gc();
+    setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+    gc();
+    setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+    gc();
+    shouldBeEqualToString('key.algorithm.foo', 'bar');
+    finishJSTest();
+}
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlecryptokeyusagesgcexpectedtxtfromrev206882trunkLayoutTestscryptosubtlecryptokeyusagesgcexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test that CryptoKey.usages preserves custom properties.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Generating a HMAC key with default length...
+PASS key.usages === key.usages is true
+PASS key.usages.foo is &quot;bar&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlecryptokeyusagesgchtmlfromrev206882trunkLayoutTestscryptosubtlecryptokeyusagesgchtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html (from rev 206882, trunk/LayoutTests/crypto/subtle/crypto-key-usages-gc.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test that CryptoKey.usages preserves custom properties.&quot;);
+jsTestIsAsync = true;
+
+debug(&quot;\nGenerating a HMAC key with default length...&quot;);
+crypto.webkitSubtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;}, true, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+    startTest();
+});
+
+function startTest()
+{
+    shouldBeTrue(&quot;key.usages === key.usages&quot;);
+    key.usages.foo = &quot;bar&quot;;
+    gc();
+    setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+    gc();
+    setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+    gc();
+    shouldBeEqualToString('key.usages.foo', 'bar');
+    finishJSTest();
+}
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmaccheckalgorithmexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test that HMAC operations only work when hash functions match between invocation and key.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a raw HMAC SHA-1 key from string literal...
+Done
+PASS crypto.webkitSubtle.sign({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('foo')) did not throw exception.
+PASS crypto.webkitSubtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('foo')) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.verify({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo')) did not throw exception.
+PASS crypto.webkitSubtle.verify({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo')) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmaccheckalgorithmhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm.html (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-check-algorithm.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 that HMAC operations only work when hash functions match between invocation and key.&quot;);
+
+jsTestIsAsync = true;
+
+var hmacKey = asciiToUint8Array('a');
+var extractable = true;
+
+debug(&quot;Importing a raw HMAC SHA-1 key from string literal...&quot;);
+crypto.webkitSubtle.importKey(&quot;raw&quot;, hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    debug(&quot;Done&quot;);
+    key = result;
+
+    shouldNotThrow(&quot;crypto.webkitSubtle.sign({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('foo'))&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('foo'))&quot;);
+
+    shouldNotThrow(&quot;crypto.webkitSubtle.verify({name: 'hmac', hash: {name: 'sha-1'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo'))&quot;);
+    shouldThrow(&quot;crypto.webkitSubtle.verify({name: 'hmac', hash: {name: 'sha-256'}}, key, asciiToUint8Array('fake signature'), asciiToUint8Array('foo'))&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="trunkLayoutTestscryptowebkitSubtlehmacexportkeyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlehmacexportkeyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-export-key-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+Test exporting an AES key.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a JWK key...
+PASS crypto.webkitSubtle.exportKey(null, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey({}, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(&quot;&quot;, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(&quot;foobar&quot;, key) threw exception TypeError: Unknown key format.
+Exporting the key as raw data...
+PASS bytesToHexString(new Uint8Array(exportedData)) is '6a18e49feff7f3b7e09ec89b7f6deab2f6a18e49feff7f3b7e09ec89b7f6deab'
+Exporting the key as JWK...
+PASS exportedJWK.kty is 'oct'
+PASS exportedJWK.k is 'ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs'
+PASS exportedJWK.alg is 'HS256'
+PASS exportedJWK.ext is true
+PASS exportedJWK.use is undefined
+PASS exportedJWK.key_ops is ['sign', 'verify']
+
+Importing a key that's not extractable...
+
+Trying to export as raw...
+PASS Rejected, as expected
+Trying to export as jwk...
+PASS Rejected, as expected
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacexportkeyhtmlfromrev206882trunkLayoutTestscryptosubtlehmacexportkeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-export-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-export-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,80 @@
</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 exporting an AES key.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var jwkKey = {
+    &quot;kty&quot;: &quot;oct&quot;,
+    &quot;k&quot;: &quot;ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs&quot;
+};
+
+var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
+
+debug(&quot;Importing a JWK key...&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, { name: &quot;HMAC&quot;, hash: &quot;SHA-256&quot; }, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    key = result;
+
+    shouldThrow('crypto.webkitSubtle.exportKey(null, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey(undefined, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey({}, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey(&quot;&quot;, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey(&quot;foobar&quot;, key)');
+
+    debug(&quot;Exporting the key as raw data...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;raw&quot;, key);
+}).then(function(result) {
+    exportedData = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(exportedData))&quot;, &quot;'6a18e49feff7f3b7e09ec89b7f6deab2f6a18e49feff7f3b7e09ec89b7f6deab'&quot;);
+
+    debug(&quot;Exporting the key as JWK...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;jwk&quot;, key);
+}).then(function(result) {
+    exportedJWK = JSON.parse(bytesToASCIIString(result));
+    shouldBe(&quot;exportedJWK.kty&quot;, &quot;'oct'&quot;);
+    shouldBe(&quot;exportedJWK.k&quot;, &quot;'ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs'&quot;);
+    shouldBe(&quot;exportedJWK.alg&quot;, &quot;'HS256'&quot;);
+    shouldBe(&quot;exportedJWK.ext&quot;, &quot;true&quot;);
+    shouldBe(&quot;exportedJWK.use&quot;, &quot;undefined&quot;);
+    shouldBe(&quot;exportedJWK.key_ops&quot;, &quot;['sign', 'verify']&quot;);
+
+    debug(&quot;\nImporting a key that's not extractable...&quot;);
+    return crypto.webkitSubtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, { name: &quot;HMAC&quot;, hash: &quot;SHA-256&quot; }, nonExtractable, [&quot;sign&quot;, &quot;verify&quot;]);
+}).then(function(result) {
+    key = result;
+
+    debug(&quot;\nTrying to export as raw...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;raw&quot;, key);
+}).then(function(result) {
+    testFailed(&quot;Promise wasn't rejected&quot;);
+    finishJSTest();
+}, function() {
+    testPassed(&quot;Rejected, as expected&quot;);
+
+    debug(&quot;Trying to export as jwk...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;jwk&quot;, key);
+}).then(function(result) {
+    testFailed(&quot;Promise wasn't rejected&quot;);
+    finishJSTest();
+}, function() {
+    testPassed(&quot;Rejected, as expected&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="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+Test generating a HMAC key.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS crypto.webkitSubtle.generateKey(&quot;hmac&quot;, extractable, [&quot;sign&quot;, &quot;verify&quot;]) threw exception TypeError: Type error.
+PASS crypto.webkitSubtle.generateKey({name: &quot;hmac&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.generateKey({name: &quot;hmac&quot;, length: undefined}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.generateKey({name: &quot;hmac&quot;, length: {}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+
+Generating a key with default length...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 64
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is [&quot;sign&quot;, &quot;verify&quot;]
+
+Generating a key with custom length...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 5
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is [&quot;sign&quot;]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacgeneratekeyhtmlfromrev206882trunkLayoutTestscryptosubtlehmacgeneratekeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-generate-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-generate-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,51 @@
</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 HMAC key.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+shouldThrow('crypto.webkitSubtle.generateKey(&quot;hmac&quot;, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldThrow('crypto.webkitSubtle.generateKey({name: &quot;hmac&quot;}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldThrow('crypto.webkitSubtle.generateKey({name: &quot;hmac&quot;, length: undefined}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldThrow('crypto.webkitSubtle.generateKey({name: &quot;hmac&quot;, length: {}}, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+
+debug(&quot;\nGenerating a key with default length...&quot;);
+crypto.webkitSubtle.generateKey({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;64&quot;);
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
+
+    debug(&quot;\nGenerating a key with custom length...&quot;);
+    return crypto.webkitSubtle.generateKey({name: &quot;hmac&quot;, hash: &quot;sha-1&quot;, length: 5}, extractable, [&quot;sign&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;5&quot;);
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;key.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></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacimportjwkexpectedtxtfromrev206882trunkLayoutTestscryptosubtlehmacimportjwkexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+Test importing a JWK key for HMAC.
+
+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 32
+PASS key.usages is [&quot;sign&quot;, &quot;verify&quot;]
+
+Using the key to sign message 'foo'...
+PASS bytesToHexString(new Uint8Array(signature)) is 'e03736fe098892b2a2da77812431f7c014d32e2fd69f3bcff883ac923a8fa2da'
+
+Verifying the signature...
+PASS verificationResult is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacimportjwkhtmlfromrev206882trunkLayoutTestscryptosubtlehmacimportjwkhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk.html (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-import-jwk.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,55 @@
</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 key for HMAC.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+var hmacKey = {
+    &quot;kty&quot;: &quot;oct&quot;,
+    &quot;alg&quot;: &quot;HS256&quot;,
+    &quot;use&quot;: &quot;sig&quot;,
+    &quot;ext&quot;: false,
+    &quot;k&quot;: &quot;ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs&quot;
+};
+
+var hmacKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(hmacKey));
+
+debug(&quot;Importing a key...\n&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, hmacKeyAsArrayBuffer, null, 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;false&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'HMAC'&quot;);
+    shouldBe(&quot;key.algorithm.length&quot;, &quot;32&quot;);
+    shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
+
+    debug(&quot;\nUsing the key to sign message 'foo'...&quot;);
+    return crypto.webkitSubtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
+}).then(function(result) {
+    signature = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(signature))&quot;, &quot;'e03736fe098892b2a2da77812431f7c014d32e2fd69f3bcff883ac923a8fa2da'&quot;);
+
+    debug(&quot;\nVerifying the signature...&quot;);
+    return crypto.webkitSubtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
+}).then(function(result) {
+    verificationResult = result;
+    shouldBe(&quot;verificationResult&quot;, &quot;true&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="trunkLayoutTestscryptowebkitSubtlehmacpostMessageexpectedtxtfromrev206882trunkLayoutTestscryptosubtlehmacpostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-postMessage-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Test sending crypto keys via postMessage.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 16
+PASS key.usages is [&quot;sign&quot;, &quot;verify&quot;]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacpostMessagehtmlfromrev206882trunkLayoutTestscryptosubtlehmacpostMessagehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage.html (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-postMessage.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-postMessage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test sending crypto keys via postMessage.&quot;);
+
+jsTestIsAsync = true;
+
+window.addEventListener(&quot;message&quot;, function(evt) {
+    key = evt.data;
+    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;16&quot;);
+    shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
+
+    finishJSTest();
+}, false);
+
+crypto.webkitSubtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;16 bytes of key!&quot;), {name: 'hmac', hash: {name: 'sha-1'}}, true, ['sign', 'verify']).then(function(key) {
+    postMessage(key, &quot;*&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="trunkLayoutTestscryptowebkitSubtlehmacsignverifyemptykeyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlehmacsignverifyemptykeyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Test HMAC sign and verify functions with an empty key.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a raw HMAC key from string literal...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 0
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is ['sign', 'verify']
+Using the key to sign 'foo'...
+PASS bytesToHexString(new Uint8Array(signature)) is 'a3cc770fc033e2cb419d42b64e0081a3bd3be30e'
+Verifying the signature...
+PASS verificationResult is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacsignverifyemptykeyhtmlfromrev206882trunkLayoutTestscryptosubtlehmacsignverifyemptykeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-empty-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 HMAC sign and verify functions with an empty key.&quot;);
+
+jsTestIsAsync = true;
+
+var hmacKey = asciiToUint8Array('');
+var extractable = true;
+
+debug(&quot;Importing a raw HMAC key from string literal...&quot;);
+crypto.webkitSubtle.importKey(&quot;raw&quot;, hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, 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;0&quot;); // See &lt;https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098&gt;.
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&quot;);
+
+    debug(&quot;Using the key to sign 'foo'...&quot;);
+    return crypto.webkitSubtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
+}).then(function(result) {
+    signature = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(signature))&quot;, &quot;'a3cc770fc033e2cb419d42b64e0081a3bd3be30e'&quot;);
+
+    debug(&quot;Verifying the signature...&quot;);
+    return crypto.webkitSubtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
+}).then(function(result) {
+    verificationResult = result;
+    shouldBe(&quot;verificationResult&quot;, &quot;true&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="trunkLayoutTestscryptowebkitSubtlehmacsignverifyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlehmacsignverifyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Test HMAC sign and verify functions.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a raw HMAC key from string literal...
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 1
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is ['sign', 'verify']
+Using the key to sign 'foo'...
+PASS bytesToHexString(new Uint8Array(signature)) is 'bebbc02e46b0f81183f40c25dce23e5045d65519'
+Verifying the signature...
+PASS verificationResult is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlehmacsignverifyhtmlfromrev206882trunkLayoutTestscryptosubtlehmacsignverifyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify.html (from rev 206882, trunk/LayoutTests/crypto/subtle/hmac-sign-verify.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/hmac-sign-verify.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 HMAC sign and verify functions.&quot;);
+
+jsTestIsAsync = true;
+
+var hmacKey = asciiToUint8Array('a');
+var extractable = true;
+
+debug(&quot;Importing a raw HMAC key from string literal...&quot;);
+crypto.webkitSubtle.importKey(&quot;raw&quot;, hmacKey, {name: 'hmac', hash: {name: 'sha-1'}}, 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;1&quot;); // See &lt;https://www.w3.org/Bugs/Public/show_bug.cgi?id=23098&gt;.
+    shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;key.usages&quot;, &quot;['sign', 'verify']&quot;);
+
+    debug(&quot;Using the key to sign 'foo'...&quot;);
+    return crypto.webkitSubtle.sign(key.algorithm, key, asciiToUint8Array('foo'));
+}).then(function(result) {
+    signature = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(signature))&quot;, &quot;'bebbc02e46b0f81183f40c25dce23e5045d65519'&quot;);
+
+    debug(&quot;Verifying the signature...&quot;);
+    return crypto.webkitSubtle.verify(key.algorithm, key, result, asciiToUint8Array('foo'));
+}).then(function(result) {
+    verificationResult = result;
+    shouldBe(&quot;verificationResult&quot;, &quot;true&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="trunkLayoutTestscryptowebkitSubtleimportjwkexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/import-jwk-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/import-jwk-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+Test error handling for JWK import.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(''), null) threw exception TypeError: Invalid JWK serialization.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{'), null) threw exception TypeError: Invalid JWK serialization.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('null'), null) threw exception TypeError: Invalid JWK serialization.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('undefined'), null) threw exception TypeError: Invalid JWK serialization.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{}'), null) threw exception TypeError: Neither key nor function argument has crypto algorithm specified.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{}'), &quot;aes-cbc&quot;) threw exception TypeError: Required JWK &quot;kty&quot; member is missing.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;foobar&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Unsupported JWK key type foobar.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;foobar&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Unsupported JWK algorithm foobar.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), &quot;aes-cbc&quot;) threw exception TypeError: Algorithm specified in key is not compatible with one passed to importKey as argument.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), { name: &quot;hmac&quot;, hash: &quot;sha-1&quot; }) threw exception TypeError: Algorithm specified in key is not compatible with one passed to importKey as argument.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot; }'), null) threw exception TypeError: Secret key data is not present is JWK.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;A128CBC&quot; }'), null) threw exception TypeError: Secret key data is not present is JWK.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;1234&quot; }'), null) threw exception TypeError: Key size is not valid for HS256.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;A128CBC&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;1234&quot; }'), null) threw exception TypeError: Key size is not valid for A128CBC.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;A128CBC&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Key size is not valid for A128CBC.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387f+nsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Cannot decode base64url key data in JWK.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: 1, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Expected a string value for &quot;kty&quot; JSON key.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: 1, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Expected a string value for &quot;alg&quot; JSON key.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: 1, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Expected a string value for &quot;use&quot; JSON key.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: &quot;false&quot;, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }'), null) threw exception TypeError: Expected a boolean value for &quot;ext&quot; JSON key.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array('{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: 1 }'), null) threw exception TypeError: Expected a string value for &quot;k&quot; JSON key.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleimportjwkhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/import-jwk.html (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/import-jwk.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,51 @@
</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 error handling for JWK import.&quot;);
+
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'null\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'undefined\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{}\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{}\'), &quot;aes-cbc&quot;)')
+
+// Unknown/invalid JWK values.
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;foobar&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;foobar&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
+
+// Algorithm mismatch.
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), &quot;aes-cbc&quot;)')
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), { name: &quot;hmac&quot;, hash: &quot;sha-1&quot; })')
+
+// No key data.
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot; }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;A128CBC&quot; }\'), null)')
+
+// Key data length is incorrect, not allowed in JWK.
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;1234&quot; }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;A128CBC&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;1234&quot; }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;A128CBC&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
+
+// Key data is not valid base64url.
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387f+nsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
+
+// Incorrect data types.
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: 1, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: 1, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: 1, &quot;ext&quot;: false, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: &quot;false&quot;, &quot;k&quot;: &quot;ahjkn23387fgnsibf23qsvahjkn37387fgnsibf23qs&quot; }\'), null)')
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(\'{ &quot;kty&quot;: &quot;oct&quot;, &quot;alg&quot;: &quot;HS256&quot;, &quot;use&quot;: &quot;sig&quot;, &quot;ext&quot;: false, &quot;k&quot;: 1 }\'), null)')
+&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="trunkLayoutTestscryptowebkitSubtlejwkexportusevaluesexpectedtxtfromrev206882trunkLayoutTestscryptosubtlejwkexportusevaluesexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+Test exporting keys with various usages to JWK.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+encrypt:
+PASS jwk.use is undefined
+PASS jwk.key_ops is [&quot;encrypt&quot;]
+
+decrypt:
+PASS jwk.use is undefined
+PASS jwk.key_ops is [&quot;decrypt&quot;]
+
+encrypt,decrypt:
+PASS jwk.use is undefined
+PASS jwk.key_ops is [&quot;encrypt&quot;,&quot;decrypt&quot;]
+
+wrapKey:
+PASS jwk.use is undefined
+PASS jwk.key_ops is [&quot;wrapKey&quot;]
+
+unwrapKey:
+PASS jwk.use is undefined
+PASS jwk.key_ops is [&quot;unwrapKey&quot;]
+
+wrapKey,unwrapKey:
+PASS jwk.use is undefined
+PASS jwk.key_ops is [&quot;wrapKey&quot;,&quot;unwrapKey&quot;]
+
+encrypt,decrypt,wrapKey:
+PASS jwk.use is undefined
+PASS jwk.key_ops is [&quot;encrypt&quot;,&quot;decrypt&quot;,&quot;wrapKey&quot;]
+
+encrypt,decrypt,wrapKey,unwrapKey:
+PASS jwk.use is undefined
+PASS jwk.key_ops is [&quot;encrypt&quot;,&quot;decrypt&quot;,&quot;wrapKey&quot;,&quot;unwrapKey&quot;]
+
+sign:
+PASS jwk.use is undefined
+PASS jwk.key_ops is [&quot;sign&quot;]
+
+verify:
+PASS jwk.use is undefined
+PASS jwk.key_ops is [&quot;verify&quot;]
+
+sign,verify:
+PASS jwk.use is undefined
+PASS jwk.key_ops is [&quot;sign&quot;,&quot;verify&quot;]
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlejwkexportusevalueshtmlfromrev206882trunkLayoutTestscryptosubtlejwkexportusevalueshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values.html (from rev 206882, trunk/LayoutTests/crypto/subtle/jwk-export-use-values.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/jwk-export-use-values.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,64 @@
</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 exporting keys with various usages to JWK.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+var aesKeyAsArrayBuffer = Base64URL.parse(&quot;jnOw99oOZFLIEPMrgJB55WL46tJSLGt7&quot;);
+var hmacKeyAsArrayBuffer = Base64URL.parse(&quot;ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs&quot;);
+
+function testWithAESCBC(usages, expectedKeyOps)
+{
+    return crypto.webkitSubtle.importKey(&quot;raw&quot;, aesKeyAsArrayBuffer, &quot;AES-CBC&quot;, extractable, usages).then(function(result) {
+        return crypto.webkitSubtle.exportKey(&quot;jwk&quot;, result);
+    }).then(function(result) {
+        jwk = JSON.parse(bytesToASCIIString(result));
+        debug(usages + &quot;:&quot;);
+        shouldBe(&quot;jwk.use&quot;, &quot;undefined&quot;);
+        shouldBe(&quot;jwk.key_ops&quot;, JSON.stringify(expectedKeyOps));
+        debug(&quot;&quot;);
+    });
+}
+
+function testWithHMAC(usages, expectedKeyOps)
+{
+    return crypto.webkitSubtle.importKey(&quot;raw&quot;, hmacKeyAsArrayBuffer, {name: 'hmac', hash: {name: 'sha-256'}}, extractable, usages).then(function(result) {
+        return crypto.webkitSubtle.exportKey(&quot;jwk&quot;, result);
+    }).then(function(result) {
+        jwk = JSON.parse(bytesToASCIIString(result));
+        debug(usages + &quot;:&quot;);
+        shouldBe(&quot;jwk.use&quot;, &quot;undefined&quot;);
+        shouldBe(&quot;jwk.key_ops&quot;, JSON.stringify(expectedKeyOps));
+        debug(&quot;&quot;);
+    });
+}
+
+Promise.all([
+    testWithAESCBC([&quot;encrypt&quot;], [&quot;encrypt&quot;]),
+    testWithAESCBC([&quot;decrypt&quot;], [&quot;decrypt&quot;]),
+    testWithAESCBC([&quot;encrypt&quot;, &quot;decrypt&quot;], [&quot;encrypt&quot;, &quot;decrypt&quot;]),
+    testWithAESCBC([&quot;wrapKey&quot;], [&quot;wrapKey&quot;]),
+    testWithAESCBC([&quot;unwrapKey&quot;], [&quot;unwrapKey&quot;]),
+    testWithAESCBC([&quot;wrapKey&quot;, &quot;unwrapKey&quot;], [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]),
+    testWithAESCBC([&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;], [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;]),
+    testWithAESCBC([&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;], [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]),
+    testWithHMAC([&quot;sign&quot;], [&quot;sign&quot;]),
+    testWithHMAC([&quot;verify&quot;], [&quot;verify&quot;]),
+    testWithHMAC([&quot;sign&quot;, &quot;verify&quot;], [&quot;sign&quot;, &quot;verify&quot;]),
+]).then(function() { 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="trunkLayoutTestscryptowebkitSubtlejwkimportusevaluesexpectedtxtfromrev206882trunkLayoutTestscryptosubtlejwkimportusevaluesexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+Test importing keys with various uses from JWK.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS testWithAESCBC([&quot;encrypt&quot;], {key_ops: [&quot;encrypt&quot;, &quot;encrypt&quot;]}) threw exception TypeError: JWK key_ops contains a duplicate operation.
+
+{&quot;key_ops&quot;:[&quot;encrypt&quot;]}:
+PASS key.usages is [&quot;encrypt&quot;]
+
+{&quot;key_ops&quot;:[&quot;decrypt&quot;]}:
+PASS key.usages is [&quot;decrypt&quot;]
+
+{&quot;key_ops&quot;:[&quot;encrypt&quot;,&quot;decrypt&quot;]}:
+PASS key.usages is [&quot;decrypt&quot;,&quot;encrypt&quot;]
+
+{&quot;key_ops&quot;:[&quot;wrapKey&quot;]}:
+PASS key.usages is [&quot;wrapKey&quot;]
+
+{&quot;key_ops&quot;:[&quot;unwrapKey&quot;]}:
+PASS key.usages is [&quot;unwrapKey&quot;]
+
+{&quot;key_ops&quot;:[&quot;wrapKey&quot;,&quot;unwrapKey&quot;]}:
+PASS key.usages is [&quot;unwrapKey&quot;,&quot;wrapKey&quot;]
+
+{&quot;key_ops&quot;:[&quot;encrypt&quot;,&quot;decrypt&quot;,&quot;wrapKey&quot;]}:
+PASS key.usages is [&quot;decrypt&quot;,&quot;encrypt&quot;,&quot;wrapKey&quot;]
+
+{&quot;use&quot;:&quot;enc&quot;}:
+PASS key.usages is [&quot;decrypt&quot;,&quot;encrypt&quot;,&quot;unwrapKey&quot;,&quot;wrapKey&quot;]
+
+{&quot;key_ops&quot;:[&quot;sign&quot;]}:
+PASS key.usages is [&quot;sign&quot;]
+
+{&quot;key_ops&quot;:[&quot;verify&quot;]}:
+PASS key.usages is [&quot;verify&quot;]
+
+{&quot;use&quot;:&quot;sig&quot;}:
+PASS key.usages is [&quot;sign&quot;,&quot;verify&quot;]
+
+{&quot;key_ops&quot;:[&quot;'encrypt'&quot;]}:
+PASS key.usages is []
+
+{&quot;key_ops&quot;:[&quot;encrypt &quot;]}:
+PASS key.usages is []
+
+{&quot;key_ops&quot;:[&quot;Encrypt&quot;]}:
+PASS key.usages is []
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlejwkimportusevalueshtmlfromrev206882trunkLayoutTestscryptosubtlejwkimportusevalueshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values.html (from rev 206882, trunk/LayoutTests/crypto/subtle/jwk-import-use-values.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/jwk-import-use-values.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,95 @@
</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 keys with various uses from JWK.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+var aesKeyAsJSON = {
+    &quot;alg&quot;: &quot;A192CBC&quot;,
+    &quot;ext&quot;: true,
+    &quot;kty&quot;: &quot;oct&quot;,
+    &quot;k&quot;: &quot;jnOw99oOZFLIEPMrgJB55WL46tJSLGt7&quot;
+};
+
+var hmacKeyAsJSON = {
+    &quot;alg&quot;: &quot;HS256&quot;,
+    &quot;ext&quot;: true,
+    &quot;kty&quot;: &quot;oct&quot;,
+    &quot;k&quot;: &quot;ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs&quot;
+};
+
+function testWithAESCBC(expectedUsages, jwkUsages)
+{
+    if (jwkUsages.key_ops) {
+        aesKeyAsJSON.key_ops = jwkUsages.key_ops;
+        delete aesKeyAsJSON.use;
+    } else {
+        delete aesKeyAsJSON.key_ops;
+        aesKeyAsJSON.use = jwkUsages.use;
+    }
+
+    return crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(aesKeyAsJSON)), &quot;AES-CBC&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+        key = result;
+        debug(JSON.stringify(jwkUsages) + &quot;:&quot;);
+        shouldBe(&quot;key.usages&quot;, JSON.stringify(expectedUsages));
+        debug(&quot;&quot;);
+    });
+}
+
+function testWithHMAC(expectedUsages, jwkUsages)
+{
+    if (jwkUsages.key_ops) {
+        hmacKeyAsJSON.key_ops = jwkUsages.key_ops;
+        delete hmacKeyAsJSON.use;
+    } else {
+        delete hmacKeyAsJSON.key_ops;
+        hmacKeyAsJSON.use = jwkUsages.use;
+    }
+
+    return crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(hmacKeyAsJSON)), {name: 'hmac', hash: {name: 'sha-256'}}, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+        key = result;
+        debug(JSON.stringify(jwkUsages) + &quot;:&quot;);
+        shouldBe(&quot;key.usages&quot;, JSON.stringify(expectedUsages));
+        debug(&quot;&quot;);
+    });
+}
+
+// Duplicates are not allowed. We currently raise an exception, although we should reject the promise instead.
+shouldThrow('testWithAESCBC([&quot;encrypt&quot;], {key_ops: [&quot;encrypt&quot;, &quot;encrypt&quot;]})');
+debug(&quot;&quot;);
+
+Promise.all([
+    testWithAESCBC([&quot;encrypt&quot;], {key_ops: [&quot;encrypt&quot;]}),
+    testWithAESCBC([&quot;decrypt&quot;], {key_ops: [&quot;decrypt&quot;]}),
+    testWithAESCBC([&quot;decrypt&quot;, &quot;encrypt&quot;], {key_ops: [&quot;encrypt&quot;, &quot;decrypt&quot;]}),
+    testWithAESCBC([&quot;wrapKey&quot;], {key_ops: [&quot;wrapKey&quot;]}),
+    testWithAESCBC([&quot;unwrapKey&quot;], {key_ops: [&quot;unwrapKey&quot;]}),
+    testWithAESCBC([&quot;unwrapKey&quot;, &quot;wrapKey&quot;], {key_ops: [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]}),
+    testWithAESCBC([&quot;decrypt&quot;, &quot;encrypt&quot;, &quot;wrapKey&quot;], {key_ops: [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;]}),
+    testWithAESCBC([&quot;decrypt&quot;, &quot;encrypt&quot;, &quot;unwrapKey&quot;, &quot;wrapKey&quot;], {use: &quot;enc&quot;}),
+    testWithHMAC([&quot;sign&quot;], {key_ops: [&quot;sign&quot;]}),
+    testWithHMAC([&quot;verify&quot;], {key_ops: [&quot;verify&quot;]}),
+    testWithHMAC([&quot;sign&quot;, &quot;verify&quot;], {use: &quot;sig&quot;}),
+
+// Unknown key_ops strings are ignored.
+    testWithAESCBC([], {key_ops: [&quot;'encrypt'&quot;]}),
+    testWithAESCBC([], {key_ops: [&quot;encrypt &quot;]}),
+    testWithAESCBC([], {key_ops: [&quot;Encrypt&quot;]}),
+
+]).then(function() { 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="trunkLayoutTestscryptowebkitSubtleresourcesrsaindexeddbnonexportablejsfromrev206882trunkLayoutTestscryptosubtleresourcesrsaindexeddbnonexportablejs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb-non-exportable.js (from rev 206882, trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb-non-exportable.js) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb-non-exportable.js                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb-non-exportable.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+description(&quot;Test storing a private RSA key in IndexedDB, and retrieving it.&quot;);
+
+jsTestIsAsync = true;
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;,
+    d: &quot;eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ&quot;,
+    p: &quot;4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0&quot;,
+    q: &quot;xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc&quot;,
+    dp: &quot;fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk&quot;,
+    dq: &quot;jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE&quot;,
+    qi: &quot;YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk&quot;
+};
+
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, false, [&quot;sign&quot;, &quot;verify&quot;]).then(function(key) {
+    var openRequest = indexedDB.open(&quot;crypto_webkitSubtle&quot;);
+    openRequest.onupgradeneeded = function(event) {
+        var objectStore = event.target.result.createObjectStore(&quot;rsa-indexeddb&quot;);
+    }
+    openRequest.onerror = function(event) {
+        testFailed(&quot;Could not open database: &quot; + event.target.error.name);
+        finishJSTest();
+    }
+    openRequest.onsuccess = function(event) {
+        db = event.target.result;
+        storeKey();
+    }
+
+    function storeKey() {
+        var objectStore = db.transaction(&quot;rsa-indexeddb&quot;, &quot;readwrite&quot;).objectStore(&quot;rsa-indexeddb&quot;);
+        var req = objectStore.put(key, &quot;mykey&quot;);
+        req.onerror = function(event) {
+            testFailed(&quot;Could not put a key into database: &quot; + event.target.error.name);
+            finishJSTest();
+        }
+        req.onsuccess = function(event) { readKey(); }
+    }
+
+    function readKey() {
+        var objectStore = db.transaction(&quot;rsa-indexeddb&quot;).objectStore(&quot;rsa-indexeddb&quot;);
+        var req = objectStore.get(&quot;mykey&quot;);
+        req.onerror = function(event) {
+            testFailed(&quot;Could not get a key from database: &quot; + event.target.error.name);
+            finishJSTest();
+        }
+        req.onsuccess = function(event) {
+            window.retrievedKey = event.target.result;
+            shouldBe(&quot;retrievedKey.type&quot;, &quot;'private'&quot;);
+            shouldBe(&quot;retrievedKey.extractable&quot;, &quot;false&quot;);
+            shouldBe(&quot;retrievedKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+            shouldBe(&quot;retrievedKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+            shouldBe(&quot;bytesToHexString(retrievedKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+            shouldBe(&quot;retrievedKey.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
+
+            finishJSTest();
+        }
+    }
+});
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleresourcesrsaindexeddbjsfromrev206882trunkLayoutTestscryptosubtleresourcesrsaindexeddbjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb.js (from rev 206882, trunk/LayoutTests/crypto/subtle/resources/rsa-indexeddb.js) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb.js                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/resources/rsa-indexeddb.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+description(&quot;Test storing a private RSA key in IndexedDB, and retrieving it.&quot;);
+
+jsTestIsAsync = true;
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;,
+    d: &quot;eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ&quot;,
+    p: &quot;4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0&quot;,
+    q: &quot;xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc&quot;,
+    dp: &quot;fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk&quot;,
+    dq: &quot;jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE&quot;,
+    qi: &quot;YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk&quot;
+};
+
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, true, [&quot;sign&quot;, &quot;verify&quot;]).then(function(key) {
+    var openRequest = indexedDB.open(&quot;crypto_webkitSubtle&quot;);
+    openRequest.onupgradeneeded = function(event) {
+        var objectStore = event.target.result.createObjectStore(&quot;rsa-indexeddb&quot;);
+    }
+    openRequest.onerror = function(event) {
+        testFailed(&quot;Could not open database: &quot; + event.target.error.name);
+        finishJSTest();
+    }
+    openRequest.onsuccess = function(event) {
+        db = event.target.result;
+        storeKey();
+    }
+
+    function storeKey() {
+        var objectStore = db.transaction(&quot;rsa-indexeddb&quot;, &quot;readwrite&quot;).objectStore(&quot;rsa-indexeddb&quot;);
+        var req = objectStore.put(key, &quot;mykey&quot;);
+        req.onerror = function(event) {
+            testFailed(&quot;Could not put a key into database: &quot; + event.target.error.name);
+            finishJSTest();
+        }
+        req.onsuccess = function(event) { readKey(); }
+    }
+
+    function readKey() {
+        var objectStore = db.transaction(&quot;rsa-indexeddb&quot;).objectStore(&quot;rsa-indexeddb&quot;);
+        var req = objectStore.get(&quot;mykey&quot;);
+        req.onerror = function(event) {
+            testFailed(&quot;Could not get a key from database: &quot; + event.target.error.name);
+            finishJSTest();
+        }
+        req.onsuccess = function(event) {
+            window.retrievedKey = event.target.result;
+            shouldBe(&quot;retrievedKey.type&quot;, &quot;'private'&quot;);
+            shouldBe(&quot;retrievedKey.extractable&quot;, &quot;true&quot;);
+            shouldBe(&quot;retrievedKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+            shouldBe(&quot;retrievedKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+            shouldBe(&quot;bytesToHexString(retrievedKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+            shouldBe(&quot;retrievedKey.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
+
+            finishJSTest();
+        }
+    }
+});
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaexportgeneratedkeysexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaexportgeneratedkeysexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+Test exporting a generated RSA keypair with hash.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Generating RSA-PKCS1-v1.5 keyPair...
+PASS crypto.webkitSubtle.exportKey(null, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey({}, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(&quot;&quot;, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(&quot;foobar&quot;, key) threw exception TypeError: Unknown key format.
+PASS key.publicKey.algorithm.hash.name is defined.
+PASS key.privateKey.algorithm.hash.name is defined.
+
+Exporting public key as JWK...
+PASS exportedJWK.kty is 'RSA'
+PASS exportedJWK.alg is 'RS256'
+PASS exportedJWK.ext is true
+PASS exportedJWK.use is undefined
+PASS exportedJWK.key_ops is ['sign', 'verify']
+
+Exporting private key as JWK...
+PASS exportedJWK.kty is 'RSA'
+PASS exportedJWK.alg is 'RS256'
+PASS exportedJWK.ext is true
+PASS exportedJWK.use is undefined
+PASS exportedJWK.key_ops is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaexportgeneratedkeyshtmlfromrev206882trunkLayoutTestscryptosubtlersaexportgeneratedkeyshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-export-generated-keys.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-export-generated-keys.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,66 @@
</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 exporting a generated RSA keypair with hash.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+var algorithm = {
+    name: &quot;RSASSA-PKCS1-v1_5&quot;,
+    modulusLength: &quot;2048&quot;,
+    publicExponent: new Uint8Array([1, 0, 1]), // 2^16 + 1 (65537)
+    hash: { name: &quot;SHA-256&quot; }
+};
+
+debug(&quot;\nGenerating RSA-PKCS1-v1.5 keyPair...&quot;);
+crypto.webkitSubtle.generateKey(algorithm, extractable, ['sign', 'verify'])
+.then(function(result) {
+    key = result;
+
+    shouldThrow('crypto.webkitSubtle.exportKey(null, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey(undefined, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey({}, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey(&quot;&quot;, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey(&quot;foobar&quot;, key)');
+    shouldBeDefined('key.publicKey.algorithm.hash.name');
+    shouldBeDefined('key.privateKey.algorithm.hash.name');
+
+    debug(&quot;\nExporting public key as JWK...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;jwk&quot;, key.publicKey);
+}).then(function(result) {
+    exportedJWK = JSON.parse(bytesToASCIIString(result));
+
+    shouldBe(&quot;exportedJWK.kty&quot;, &quot;'RSA'&quot;);
+    shouldBe(&quot;exportedJWK.alg&quot;, &quot;'RS256'&quot;);
+    shouldBe(&quot;exportedJWK.ext&quot;, &quot;true&quot;);
+    shouldBe(&quot;exportedJWK.use&quot;, &quot;undefined&quot;);
+    shouldBe(&quot;exportedJWK.key_ops&quot;, &quot;['sign', 'verify']&quot;);
+
+    debug(&quot;\nExporting private key as JWK...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;jwk&quot;, key.privateKey);
+}).then(function(result) {
+    exportedJWK = JSON.parse(bytesToASCIIString(result));
+
+    shouldBe(&quot;exportedJWK.kty&quot;, &quot;'RSA'&quot;);
+    shouldBe(&quot;exportedJWK.alg&quot;, &quot;'RS256'&quot;);
+    shouldBe(&quot;exportedJWK.ext&quot;, &quot;true&quot;);
+    shouldBe(&quot;exportedJWK.use&quot;, &quot;undefined&quot;);
+    shouldBe(&quot;exportedJWK.key_ops&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="trunkLayoutTestscryptowebkitSubtlersaexportkeyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaexportkeyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-export-key-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+Test exporting an RSA key.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Importing a JWK key...
+PASS crypto.webkitSubtle.exportKey(null, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey({}, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(&quot;&quot;, key) threw exception TypeError: Unknown key format.
+PASS crypto.webkitSubtle.exportKey(&quot;foobar&quot;, key) threw exception TypeError: Unknown key format.
+
+Exporting the key as JWK...
+PASS exportedJWK.kty is 'RSA'
+PASS exportedJWK.n is publicKeyJSON.n
+PASS exportedJWK.e is publicKeyJSON.e
+PASS exportedJWK.alg is 'RS256'
+PASS exportedJWK.ext is true
+PASS exportedJWK.use is undefined
+PASS exportedJWK.key_ops is ['sign', 'verify']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaexportkeyhtmlfromrev206882trunkLayoutTestscryptosubtlersaexportkeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-export-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-export-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,57 @@
</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 exporting an RSA key.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+
+var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(publicKeyJSON));
+
+debug(&quot;\nImporting a JWK key...&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, &quot;RSASSA-PKCS1-v1_5&quot;, extractable, ['sign', 'verify']).then(function(result) {
+    key = result;
+
+    shouldThrow('crypto.webkitSubtle.exportKey(null, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey(undefined, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey({}, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey(&quot;&quot;, key)');
+    shouldThrow('crypto.webkitSubtle.exportKey(&quot;foobar&quot;, key)');
+
+    debug(&quot;\nExporting the key as JWK...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;jwk&quot;, key);
+}).then(function(result) {
+    exportedJWK = JSON.parse(bytesToASCIIString(result));
+
+    shouldBe(&quot;exportedJWK.kty&quot;, &quot;'RSA'&quot;);
+    shouldBe(&quot;exportedJWK.n&quot;, &quot;publicKeyJSON.n&quot;);
+    shouldBe(&quot;exportedJWK.e&quot;, &quot;publicKeyJSON.e&quot;);
+    shouldBe(&quot;exportedJWK.alg&quot;, &quot;'RS256'&quot;);
+    shouldBe(&quot;exportedJWK.ext&quot;, &quot;true&quot;);
+    shouldBe(&quot;exportedJWK.use&quot;, &quot;undefined&quot;);
+    shouldBe(&quot;exportedJWK.key_ops&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="trunkLayoutTestscryptowebkitSubtlersaexportprivatekeyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaexportprivatekeyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+Test exporting a private RSA key.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Importing a JWK key...
+
+Exporting the key as JWK...
+PASS exportedJWK.kty is 'RSA'
+PASS exportedJWK.n is privateKeyJSON.n
+PASS exportedJWK.e is privateKeyJSON.e
+PASS exportedJWK.d is privateKeyJSON.d
+PASS exportedJWK.p is privateKeyJSON.p
+PASS exportedJWK.q is privateKeyJSON.q
+PASS exportedJWK.dp is privateKeyJSON.dp
+PASS exportedJWK.dq is privateKeyJSON.dq
+PASS exportedJWK.qi is privateKeyJSON.qi
+PASS exportedJWK.oth is privateKeyJSON.oth
+PASS exportedJWK.alg is privateKeyJSON.alg
+PASS exportedJWK.ext is true
+PASS exportedJWK.key_ops is ['sign', 'verify']
+PASS exportedJWK.use is undefined
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaexportprivatekeyhtmlfromrev206882trunkLayoutTestscryptosubtlersaexportprivatekeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-export-private-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-export-private-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,65 @@
</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 exporting a private RSA key.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+// Example from JWK specification.
+var privateKeyJSON = {
+    &quot;kty&quot;:&quot;RSA&quot;,
+    &quot;n&quot;:&quot;0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw&quot;,
+    &quot;e&quot;:&quot;AQAB&quot;,
+    &quot;d&quot;:&quot;X4cTteJY_gn4FYPsXB8rdXix5vwsg1FLN5E3EaG6RJoVH-HLLKD9M7dx5oo7GURknchnrRweUkC7hT5fJLM0WbFAKNLWY2vv7B6NqXSzUvxT0_YSfqijwp3RTzlBaCxWp4doFk5N2o8Gy_nHNKroADIkJ46pRUohsXywbReAdYaMwFs9tv8d_cPVY3i07a3t8MN6TNwm0dSawm9v47UiCl3Sk5ZiG7xojPLu4sbg1U2jx4IBTNBznbJSzFHK66jT8bgkuqsk0GjskDJk19Z4qwjwbsnn4j2WBii3RL-Us2lGVkY8fkFzme1z0HbIkfz0Y6mqnOYtqc0X4jfcKoAC8Q&quot;,
+    &quot;p&quot;:&quot;83i-7IvMGXoMXCskv73TKr8637FiO7Z27zv8oj6pbWUQyLPQBQxtPVnwD20R-60eTDmD2ujnMt5PoqMrm8RfmNhVWDtjjMmCMjOpSXicFHj7XOuVIYQyqVWlWEh6dN36GVZYk93N8Bc9vY41xy8B9RzzOGVQzXvNEvn7O0nVbfs&quot;,
+    &quot;q&quot;:&quot;3dfOR9cuYq-0S-mkFLzgItgMEfFzB2q3hWehMuG0oCuqnb3vobLyumqjVZQO1dIrdwgTnCdpYzBcOfW5r370AFXjiWft_NGEiovonizhKpo9VVS78TzFgxkIdrecRezsZ-1kYd_s1qDbxtkDEgfAITAG9LUnADun4vIcb6yelxk&quot;,
+    &quot;dp&quot;:&quot;G4sPXkc6Ya9y8oJW9_ILj4xuppu0lzi_H7VTkS8xj5SdX3coE0oimYwxIi2emTAue0UOa5dpgFGyBJ4c8tQ2VF402XRugKDTP8akYhFo5tAA77Qe_NmtuYZc3C3m3I24G2GvR5sSDxUyAN2zq8Lfn9EUms6rY3Ob8YeiKkTiBj0&quot;,
+    &quot;dq&quot;:&quot;s9lAH9fggBsoFR8Oac2R_E2gw282rT2kGOAhvIllETE1efrA6huUUvMfBcMpn8lqeW6vzznYY5SSQF7pMdC_agI3nG8Ibp1BUb0JUiraRNqUfLhcQb_d9GF4Dh7e74WbRsobRonujTYN1xCaP6TO61jvWrX-L18txXw494Q_cgk&quot;,
+    &quot;qi&quot;:&quot;GyM_p6JrXySiz1toFgKbWV-JdI3jQ4ypu9rbMWx3rQJBfmt0FoYzgUIZEVFEcOqwemRN81zoDAaa-Bk0KWNGDjJHZDdDmFhW3AN7lI-puxk_mHZGJ11rxyR8O55XLSe3SPmRfKwZI6yU24ZxvQKFYItdldUKGzO6Ia6zTKhAVRU&quot;,
+    &quot;alg&quot;:&quot;RS256&quot;,
+    &quot;kid&quot;:&quot;2011-04-29&quot;
+}
+var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(privateKeyJSON));
+
+debug(&quot;\nImporting a JWK key...&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, jwkKeyAsArrayBuffer, &quot;RSASSA-PKCS1-v1_5&quot;, extractable, ['sign', 'verify']).then(function(result) {
+    key = result;
+
+    debug(&quot;\nExporting the key as JWK...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;jwk&quot;, key);
+}).then(function(result) {
+    exportedJWK = JSON.parse(bytesToASCIIString(result));
+
+    shouldBe(&quot;exportedJWK.kty&quot;, &quot;'RSA'&quot;);
+    shouldBe(&quot;exportedJWK.n&quot;, &quot;privateKeyJSON.n&quot;);
+    shouldBe(&quot;exportedJWK.e&quot;, &quot;privateKeyJSON.e&quot;);
+    shouldBe(&quot;exportedJWK.d&quot;, &quot;privateKeyJSON.d&quot;);
+    shouldBe(&quot;exportedJWK.p&quot;, &quot;privateKeyJSON.p&quot;);
+    shouldBe(&quot;exportedJWK.q&quot;, &quot;privateKeyJSON.q&quot;);
+    shouldBe(&quot;exportedJWK.dp&quot;, &quot;privateKeyJSON.dp&quot;);
+    shouldBe(&quot;exportedJWK.dq&quot;, &quot;privateKeyJSON.dq&quot;);
+    shouldBe(&quot;exportedJWK.qi&quot;, &quot;privateKeyJSON.qi&quot;);
+    shouldBe(&quot;exportedJWK.oth&quot;, &quot;privateKeyJSON.oth&quot;);
+    shouldBe(&quot;exportedJWK.alg&quot;, &quot;privateKeyJSON.alg&quot;);
+    shouldBe(&quot;exportedJWK.ext&quot;, &quot;true&quot;);
+    shouldBe(&quot;exportedJWK.key_ops&quot;, &quot;['sign', 'verify']&quot;);
+    shouldBe(&quot;exportedJWK.use&quot;, &quot;undefined&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="trunkLayoutTestscryptowebkitSubtlersaindexeddbexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaindexeddbexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test storing a private RSA key in IndexedDB, and retrieving it.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS retrievedKey.type is 'private'
+PASS retrievedKey.extractable is true
+PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS retrievedKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
+PASS retrievedKey.usages is [&quot;sign&quot;, &quot;verify&quot;]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportableexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaindexeddbnonexportableexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test storing a private RSA key in IndexedDB, and retrieving it.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS retrievedKey.type is 'private'
+PASS retrievedKey.extractable is false
+PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS retrievedKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
+PASS retrievedKey.usages is [&quot;sign&quot;, &quot;verify&quot;]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportableprivateexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivateexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test storing a private RSA key in IndexedDB, and retrieving it.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS retrievedKey.type is 'private'
+PASS retrievedKey.extractable is false
+PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS retrievedKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
+PASS retrievedKey.usages is [&quot;sign&quot;, &quot;verify&quot;]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportableprivatehtmlfromrev206882trunkLayoutTestscryptosubtlersaindexeddbnonexportableprivatehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+enablePrivateBrowsing = true;
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/rsa-indexeddb-non-exportable.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbnonexportablehtmlfromrev206882trunkLayoutTestscryptosubtlersaindexeddbnonexportablehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-non-exportable.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/rsa-indexeddb-non-exportable.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbprivateexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaindexeddbprivateexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test storing a private RSA key in IndexedDB, and retrieving it.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS retrievedKey.type is 'private'
+PASS retrievedKey.extractable is true
+PASS retrievedKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS retrievedKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(retrievedKey.algorithm.publicExponent) is '010001'
+PASS retrievedKey.usages is [&quot;sign&quot;, &quot;verify&quot;]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbprivatehtmlfromrev206882trunkLayoutTestscryptosubtlersaindexeddbprivatehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb-private.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+enablePrivateBrowsing = true;
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/rsa-indexeddb.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaindexeddbhtmlfromrev206882trunkLayoutTestscryptosubtlersaindexeddbhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-indexeddb.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-indexeddb.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/rsa-indexeddb.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaoaepgeneratenonextractablekeyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaoaepgeneratenonextractablekeyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+Test that even when non-extractability is requested, the public key is still extractable.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Generating a key pair...
+PASS keyPair.toString() is '[object CryptoKeyPair]'
+PASS keyPair.publicKey.type is 'public'
+PASS keyPair.publicKey.extractable is true
+PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP'
+PASS keyPair.publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
+PASS keyPair.publicKey.algorithm.hash is undefined.
+PASS keyPair.privateKey.type is 'private'
+PASS keyPair.privateKey.extractable is false
+PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP'
+PASS keyPair.privateKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
+PASS keyPair.privateKey.algorithm.hash is undefined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaoaepgeneratenonextractablekeyhtmlfromrev206882trunkLayoutTestscryptosubtlersaoaepgeneratenonextractablekeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 that even when non-extractability is requested, the public key is still extractable.&quot;);
+
+jsTestIsAsync = true;
+
+var algorithmKeyGen = {
+    name: &quot;RSA-OAEP&quot;,
+    // RsaKeyGenParams
+    modulusLength: 2048,
+    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
+};
+var nonExtractable = false;
+
+debug(&quot;Generating a key pair...&quot;);
+crypto.webkitSubtle.generateKey(algorithmKeyGen, nonExtractable, []).then(function(result) {
+    keyPair = result;
+    shouldBe(&quot;keyPair.toString()&quot;, &quot;'[object CryptoKeyPair]'&quot;);
+    shouldBe(&quot;keyPair.publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;keyPair.publicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;keyPair.publicKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
+    shouldBe(&quot;keyPair.publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(keyPair.publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBeUndefined(&quot;keyPair.publicKey.algorithm.hash&quot;);
+    shouldBe(&quot;keyPair.privateKey.type&quot;, &quot;'private'&quot;);
+    shouldBe(&quot;keyPair.privateKey.extractable&quot;, &quot;false&quot;);
+    shouldBe(&quot;keyPair.privateKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
+    shouldBe(&quot;keyPair.privateKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(keyPair.privateKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBeUndefined(&quot;keyPair.privateKey.algorithm.hash&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="trunkLayoutTestscryptowebkitSubtlersaoaepkeymanipulationexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaoaepkeymanipulationexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+Test generating, importing and exporting RSA keys for RSA-OAEP. Test that they can't be used with another algorithm.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Generating a key pair...
+PASS keyPair.toString() is '[object CryptoKeyPair]'
+PASS keyPair.publicKey.type is 'public'
+PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP'
+PASS keyPair.publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
+PASS keyPair.publicKey.algorithm.hash is undefined.
+PASS keyPair.privateKey.type is 'private'
+PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP'
+PASS keyPair.privateKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
+PASS keyPair.privateKey.algorithm.hash is undefined.
+
+Testing that the keys can't be used with different algorithms...
+PASS crypto.webkitSubtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, keyPair.privateKey, hexStringToUint8Array(&quot;00&quot;)) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS crypto.webkitSubtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, keyPair.publicKey, hexStringToUint8Array(&quot;00&quot;)) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+
+Trying to export keys to raw...
+PASS Promise rejected for exporting public key
+PASS Promise rejected for exporting private key
+
+Exporting public key to JWK...
+PASS jwkPublicKey.alg is 'RSA-OAEP'
+PASS jwkPublicKey.ext is true
+PASS jwkPublicKey.key_ops is ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']
+PASS jwkPublicKey.use is undefined
+PASS jwkPublicKey.kty is 'RSA'
+PASS bytesToHexString(Base64URL.parse(jwkPublicKey.e)) is '010001'
+
+Importing it back...
+PASS exportedPublicKey.type is 'public'
+PASS exportedPublicKey.algorithm.name is 'RSA-OAEP'
+PASS exportedPublicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(exportedPublicKey.algorithm.publicExponent) is '010001'
+PASS exportedPublicKey.algorithm.hash.name is 'SHA-1'
+PASS exportedPublicKey.extractable is true
+PASS exportedPublicKey.usages is ['decrypt','encrypt','unwrapKey','wrapKey']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaoaepkeymanipulationhtmlfromrev206882trunkLayoutTestscryptosubtlersaoaepkeymanipulationhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-key-manipulation.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 generating, importing and exporting RSA keys for RSA-OAEP. Test that they can't be used with another algorithm.&quot;);
+
+jsTestIsAsync = true;
+
+var algorithmKeyGen = {
+    name: &quot;RSA-OAEP&quot;,
+    // RsaKeyGenParams
+    modulusLength: 2048,
+    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
+};
+var extractable = true;
+
+debug(&quot;Generating a key pair...&quot;);
+crypto.webkitSubtle.generateKey(algorithmKeyGen, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    keyPair = result;
+    shouldBe(&quot;keyPair.toString()&quot;, &quot;'[object CryptoKeyPair]'&quot;);
+    shouldBe(&quot;keyPair.publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;keyPair.publicKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
+    shouldBe(&quot;keyPair.publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(keyPair.publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBeUndefined(&quot;keyPair.publicKey.algorithm.hash&quot;);
+    shouldBe(&quot;keyPair.privateKey.type&quot;, &quot;'private'&quot;);
+    shouldBe(&quot;keyPair.privateKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
+    shouldBe(&quot;keyPair.privateKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(keyPair.privateKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBeUndefined(&quot;keyPair.privateKey.algorithm.hash&quot;);
+
+    debug(&quot;\nTesting that the keys can't be used with different algorithms...&quot;);
+    iv = hexStringToUint8Array(&quot;000102030405060708090a0b0c0d0e0f&quot;);
+    shouldThrow('crypto.webkitSubtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, keyPair.privateKey, hexStringToUint8Array(&quot;00&quot;))');
+    shouldThrow('crypto.webkitSubtle.encrypt({name: &quot;aes-cbc&quot;, iv: iv}, keyPair.publicKey, hexStringToUint8Array(&quot;00&quot;))');
+
+    debug(&quot;\nTrying to export keys to raw...&quot;);
+    return crypto.webkitSubtle.exportKey('raw', keyPair.publicKey);
+}).then(undefined, function(result) {
+    testPassed(&quot;Promise rejected for exporting public key&quot;);
+    return crypto.webkitSubtle.exportKey('raw', keyPair.privateKey);
+}).then(undefined, function(result) {
+    testPassed(&quot;Promise rejected for exporting private key&quot;);
+
+    debug(&quot;\nExporting public key to JWK...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;jwk&quot;, keyPair.publicKey);
+}).then(function(result) {
+    jwkPublicKeyArray = result;
+    jwkPublicKey = JSON.parse(bytesToASCIIString(jwkPublicKeyArray));
+    shouldBe(&quot;jwkPublicKey.alg&quot;, &quot;'RSA-OAEP'&quot;);
+    shouldBe(&quot;jwkPublicKey.ext&quot;, &quot;true&quot;);
+    shouldBe(&quot;jwkPublicKey.key_ops&quot;, &quot;['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']&quot;);
+    shouldBe(&quot;jwkPublicKey.use&quot;, &quot;undefined&quot;);
+    shouldBe(&quot;jwkPublicKey.kty&quot;, &quot;'RSA'&quot;);
+    shouldBe(&quot;bytesToHexString(Base64URL.parse(jwkPublicKey.e))&quot;, &quot;'010001'&quot;);
+
+    debug(&quot;\nImporting it back...&quot;);
+    return crypto.webkitSubtle.importKey(&quot;jwk&quot;, jwkPublicKeyArray, null, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;]);
+}).then(function(result) {
+    exportedPublicKey = result;
+    shouldBe(&quot;exportedPublicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;exportedPublicKey.algorithm.name&quot;, &quot;'RSA-OAEP'&quot;);
+    shouldBe(&quot;exportedPublicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(exportedPublicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;exportedPublicKey.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+    shouldBe(&quot;exportedPublicKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;exportedPublicKey.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="trunkLayoutTestscryptowebkitSubtlersaoaepplaintextlengthexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaoaepplaintextlengthexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Test what happens when trying to encrypt a too large plain text with RSA-OAEP.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing RSA keys...
+Encrypting a 214 byte buffer with RSA-OAEP SHA-1, 2048 bit key...
+PASS Succeeded
+Encrypting a 215 byte buffer...
+PASS Rejected
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaoaepplaintextlengthhtmlfromrev206882trunkLayoutTestscryptosubtlersaoaepplaintextlengthhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-plaintext-length.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script&gt;
+description(&quot;Test what happens when trying to encrypt a too large plain text with RSA-OAEP.&quot;);
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;,
+    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 encryptAlgorithm = {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;};
+var extractable = true;
+var nonExtractable = false;
+
+debug(&quot;Importing RSA keys...&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]).then(function(result) {
+    publicKey = result;
+    return crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]);
+}).then(function(result) {
+    privateKey = result;
+
+    debug(&quot;Encrypting a 214 byte buffer with RSA-OAEP SHA-1, 2048 bit key...&quot;);
+    return crypto.webkitSubtle.encrypt({name: &quot;RSA-OAEP&quot;, hash: &quot;SHA-1&quot;}, publicKey, new Uint8Array(214));
+}).then(function(result) {
+    testPassed(&quot;Succeeded&quot;);
+    debug(&quot;Encrypting a 215 byte buffer...&quot;);
+    return crypto.webkitSubtle.encrypt({name: &quot;RSA-OAEP&quot;, hash: &quot;SHA-1&quot;}, publicKey, new Uint8Array(215));
+}).then(function(result) {
+    testFailed(&quot;Succeeded&quot;);
+    finishJSTest();
+}, function(result) {
+    testPassed(&quot;Rejected&quot;);
+    finishJSTest();
+});
+&lt;/script&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaoaepwrapunwrapaesexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaoaepwrapunwrapaesexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+Test wrapping and unwrapping AES keys with RSA-OAEP.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing RSA keys...
+Importing an AES key...
+Wrapping it...
+PASS wrappedKey.toString() is '[object ArrayBuffer]'
+Unwrapping it...
+PASS unwrappedKey.toString() is '[object CryptoKey]'
+PASS unwrappedKey.type is 'secret'
+PASS unwrappedKey.extractable is true
+PASS unwrappedKey.algorithm.name is 'AES-CBC'
+PASS unwrappedKey.algorithm.length is 256
+PASS unwrappedKey.usages is ['decrypt', 'encrypt']
+Exporting it...
+PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
+
+Wrapping the same key as JWK...
+PASS wrappedKey.toString() is '[object ArrayBuffer]'
+Unwrapping it...
+PASS unwrappedKey.toString() is '[object CryptoKey]'
+PASS unwrappedKey.type is 'secret'
+PASS unwrappedKey.extractable is true
+PASS unwrappedKey.algorithm.name is 'AES-CBC'
+PASS unwrappedKey.algorithm.length is 256
+PASS unwrappedKey.usages is ['decrypt', 'encrypt']
+Exporting it...
+PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaoaepwrapunwrapaeshtmlfromrev206882trunkLayoutTestscryptosubtlersaoaepwrapunwrapaeshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,103 @@
</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 wrapping and unwrapping AES keys with RSA-OAEP.&quot;);
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;,
+    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 wrapAlgorithm = {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;};
+var extractable = true;
+var nonExtractable = false;
+
+debug(&quot;Importing RSA keys...&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    publicKey = result;
+    return crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]);
+}).then(function(result) {
+    privateKey = result;
+
+    debug(&quot;Importing an AES key...&quot;);
+    aesKeyData = hexStringToUint8Array(&quot;603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4&quot;);
+    return crypto.webkitSubtle.importKey(&quot;raw&quot;, aesKeyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])
+}).then(function(result) {
+    aesKey = result;
+    debug(&quot;Wrapping it...&quot;);
+
+    return crypto.webkitSubtle.wrapKey(&quot;raw&quot;, aesKey, publicKey, wrapAlgorithm);
+}).then(function(result) {
+    wrappedKey = result;
+    shouldBe(&quot;wrappedKey.toString()&quot;, &quot;'[object ArrayBuffer]'&quot;);
+
+    debug(&quot;Unwrapping it...&quot;);
+    return crypto.webkitSubtle.unwrapKey(&quot;raw&quot;, wrappedKey, privateKey, wrapAlgorithm, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]);
+}).then(function(result) {
+    unwrappedKey = result;
+    shouldBe(&quot;unwrappedKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;unwrappedKey.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;256&quot;);
+    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
+
+    debug(&quot;Exporting it...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;raw&quot;, unwrappedKey);
+}).then(function(result) {
+    unwrappedKeyData = result;
+    shouldBe(&quot;bytesToHexString(unwrappedKeyData)&quot;, &quot;bytesToHexString(aesKeyData)&quot;);
+
+    debug(&quot;\nWrapping the same key as JWK...&quot;);
+    return crypto.webkitSubtle.wrapKey(&quot;jwk&quot;, aesKey, publicKey, wrapAlgorithm);
+}).then(function(result) {
+    wrappedKey = result;
+    shouldBe(&quot;wrappedKey.toString()&quot;, &quot;'[object ArrayBuffer]'&quot;);
+
+    debug(&quot;Unwrapping it...&quot;);
+    return crypto.webkitSubtle.unwrapKey(&quot;jwk&quot;, wrappedKey, privateKey, wrapAlgorithm, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]);
+}).then(function(result) {
+    unwrappedKey = result;
+    shouldBe(&quot;unwrappedKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;unwrappedKey.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;256&quot;);
+    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
+
+    debug(&quot;Exporting it...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;raw&quot;, unwrappedKey);
+}).then(function(result) {
+    unwrappedKeyData = result;
+    shouldBe(&quot;bytesToHexString(unwrappedKeyData)&quot;, &quot;bytesToHexString(aesKeyData)&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="trunkLayoutTestscryptowebkitSubtlersapostMessageexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersapostMessageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-postMessage-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+Test sending crypto keys via postMessage.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Key received in a message:
+PASS key.type is 'private'
+PASS key.extractable is true
+PASS key.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS key.algorithm.modulusLength is 2048
+PASS bytesToHexString(key.algorithm.publicExponent) is '010001'
+PASS key.usages is [&quot;sign&quot;, &quot;verify&quot;]
+
+Exported back to JWK:
+PASS exportedJWK.kty is 'RSA'
+PASS exportedJWK.alg is 'RS256'
+PASS exportedJWK.ext is true
+PASS exportedJWK.key_ops is ['sign','verify']
+PASS exportedJWK.use is undefined
+PASS exportedJWK.n is privateKeyJSON.n
+PASS exportedJWK.e is privateKeyJSON.e
+PASS exportedJWK.d is privateKeyJSON.d
+PASS exportedJWK.p is privateKeyJSON.p
+PASS exportedJWK.q is privateKeyJSON.q
+PASS exportedJWK.dp is privateKeyJSON.dp
+PASS exportedJWK.dq is privateKeyJSON.dq
+PASS exportedJWK.qi is privateKeyJSON.qi
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersapostMessagehtmlfromrev206882trunkLayoutTestscryptosubtlersapostMessagehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsa-postMessage.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsa-postMessage.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test sending crypto keys via postMessage.&quot;);
+
+jsTestIsAsync = true;
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;,
+    d: &quot;eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ&quot;,
+    p: &quot;4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0&quot;,
+    q: &quot;xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc&quot;,
+    dp: &quot;fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk&quot;,
+    dq: &quot;jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE&quot;,
+    qi: &quot;YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk&quot;
+};
+
+window.addEventListener(&quot;message&quot;, function(evt) {
+    debug(&quot;Key received in a message:&quot;);
+    key = evt.data;
+    shouldBe(&quot;key.type&quot;, &quot;'private'&quot;);
+    shouldBe(&quot;key.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;key.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;key.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(key.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
+
+    crypto.webkitSubtle.exportKey(&quot;jwk&quot;, key).then(function(result) {
+        exportedJWK = JSON.parse(bytesToASCIIString(result));
+        debug(&quot;\nExported back to JWK:&quot;);
+        shouldBe(&quot;exportedJWK.kty&quot;, &quot;'RSA'&quot;);
+        shouldBe(&quot;exportedJWK.alg&quot;, &quot;'RS256'&quot;);
+        shouldBe(&quot;exportedJWK.ext&quot;, &quot;true&quot;);
+        shouldBe(&quot;exportedJWK.key_ops&quot;, &quot;['sign','verify']&quot;);
+        shouldBe(&quot;exportedJWK.use&quot;, &quot;undefined&quot;);
+        shouldBe(&quot;exportedJWK.n&quot;, &quot;privateKeyJSON.n&quot;);
+        shouldBe(&quot;exportedJWK.e&quot;, &quot;privateKeyJSON.e&quot;);
+        shouldBe(&quot;exportedJWK.d&quot;, &quot;privateKeyJSON.d&quot;);
+        shouldBe(&quot;exportedJWK.p&quot;, &quot;privateKeyJSON.p&quot;);
+        shouldBe(&quot;exportedJWK.q&quot;, &quot;privateKeyJSON.q&quot;);
+        shouldBe(&quot;exportedJWK.dp&quot;, &quot;privateKeyJSON.dp&quot;);
+        shouldBe(&quot;exportedJWK.dq&quot;, &quot;privateKeyJSON.dq&quot;);
+        shouldBe(&quot;exportedJWK.qi&quot;, &quot;privateKeyJSON.qi&quot;);
+        debug(&quot;&quot;);
+
+        finishJSTest();
+    });
+}, false);
+
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, true, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    postMessage(result, &quot;*&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="trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5decryptexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaespkcs1v1_5decryptexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+Test decrypting a known message with RSAES-PKCS1-v1_5.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing an RSA key...
+Decrypting...
+PASS bytesToHexString(new Uint8Array(message)) is '2aacec86f423dd925ec158822a748cbe6c31a0'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5decrypthtmlfromrev206882trunkLayoutTestscryptosubtlersaespkcs1v1_5decrypthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,49 @@
</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 decrypting a known message with RSAES-PKCS1-v1_5.&quot;);
+
+jsTestIsAsync = true;
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA1_5&quot;,
+    n: Base64URL.stringify(hexStringToUint8Array(&quot;dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1&quot;)),
+    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;)),
+    d: Base64URL.stringify(hexStringToUint8Array(&quot;21950851cdf25320318b305afa0f371f07ae5a44b314ebd729f5dcb15da7fa3947acdd915daed574bd16df88bf85f61060b387172fae6e01262b3864c2d3c22f94e04a8159422b4ed279c48a4c9d767d4966071a5bbf5d043e16ff46ec1ba0716f00bbc97bff5d5693e214e99c9721f12b3ec6282ae2a485721b96ddcf7403fa037d0c57ab463c448de5cc12265add886d311ea8d8a5903fa56c5f1c9cf2eb11cb657a1a7d3e41352dc3e686898c4ce4305e8b638e1b08a2a86cc9eb9866f3499ac77b6136b81cb276d614cfeb7b6ed3f3bc775e46c00066ebeee2cff7166b57520598947ff6210320b288fb4f2c3f8fe97b279414ebf7203000a19fc0424875&quot;)),
+    p: Base64URL.stringify(hexStringToUint8Array(&quot;f123bfe53de97a569d91adcf556fa625ad30f3fd3d811f9e91e6af44b6e780cb0f327829fb21190ae2806646d728cd9b6531132b1ebfef1272993060f1ce70b124393091ee8593b727367edbba009ec5be17c4acee120c841267d47631a16c36a6d1c99973c1b0b5a835bf39feafe8f6421fd9c2a90bc27976659e67bc83124d&quot;)),
+    q: Base64URL.stringify(hexStringToUint8Array(&quot;ea9839b7e37ea89bbda27e4c93471cb4fd92189a0a96bcb4d75693f18a5c2f742af9e36fde679fbd9eae345fa269527b6965021c4bdf54d685bf08960cc976f68dca21cebf44f268a59dab8d1a25e519f5147e1f45fe287d74cf725bec1326d34212c56cf4fffa202f57b68ee8cca943f3c138c4cde33bdf2c9440df65322445&quot;)),
+    dp: Base64URL.stringify(hexStringToUint8Array(&quot;ca0c9b60b8e4a6066756c65d2088419df6253b7b688a85f4f6e964d85dad52a45262867f1e9618069fccd865e9289e46e39e2022944c5c4487d345cf252d460d977d77edfefedbcbae46a23af7fa470f077da0e50942044cb1a360497cc2760ac0f2ad4a2fcd0e84d7a1d94dfdd2658fd9ce18475c1fa75ee0cebad0cf0ac04d&quot;)),
+    dq: Base64URL.stringify(hexStringToUint8Array(&quot;528171233c4e4a6c63b86764f51338846afddbcb2958344c01c4004a1dd828145a1d02a1507def4f58247a64fc10c0a288c1ae895721d78b8f044db7c00d86da55a9b654292ecd768270be69e4bd5922d4effd1f70955f9627e3e19b749e93b40ef3dd1d61d93915e2b09d930b4b1768bfacc0136f39b0cfdfb4d050011e2e65&quot;)),
+    qi: Base64URL.stringify(hexStringToUint8Array(&quot;df2eb2322cc2daabf4d1465508f41521cda7ceff23ebe61d00d441ee728dda5d16c7bf920cd95f34beb4fe32ee817ef3362e0bcd1d1245f7b07793eaa190dc5a37fdaf4c68e2ca13972d7f5148b796b6fb6d7adda07bd2cd13be98cebed1edc6ca412e395350c59a1d842bc4aa2f3c0b243fde7dfd95356f2439251a1172c45e&quot;))
+};
+
+var extractable = true;
+var nonExtractable = false;
+
+debug(&quot;Importing an RSA key...&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;decrypt&quot;]).then(function(result) {
+    privateKey = result;
+
+    debug(&quot;Decrypting...&quot;);
+    encryptedMessage = hexStringToUint8Array(&quot;6042e745589af03af87520f93c45d8c35985ada1161a37d822e9f9460fc75fcf0179d8491b8f5d1e4de8ceb31e07c4865c5a3efdbbb69a8803b89ee65a430a5809c707569150b580bb686a94c5541c46adcd827960ce244ff688387d1616e85b4d1780c6483606cf924b54f080cf4154e66829bf6e532481048ec41fadc07d755bb34bb28145219cb30d47d0d618709180e90303ff9ef09018bed3da75761da794811f96bc9e8d7c4ba1b5946bda0bd313faec4c993ed2748eed8cce4bdb520ba7db165f9fe56aa8454d6ff33874feeebf29de2df5b7f00aa1d9fb073fc4067b58dc50624e127f711dde2cc2cfdab4919ccf28c83660dfc227b0f500ec1f904f&quot;);
+    return crypto.webkitSubtle.decrypt(&quot;RSAES-PKCS1-v1_5&quot;, privateKey, encryptedMessage);
+}).then(function(result) {
+    message = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(message))&quot;, &quot;'2aacec86f423dd925ec158822a748cbe6c31a0'&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="trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5wrapunwrapaesexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaesexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+Test wrapping and unwrapping an AES key with RSAES-PKCS1-v1_5.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing RSA keys...
+Importing an AES key...
+Wrapping it...
+PASS wrappedKey.toString() is '[object ArrayBuffer]'
+Unwrapping it...
+PASS unwrappedKey.toString() is '[object CryptoKey]'
+PASS unwrappedKey.type is 'secret'
+PASS unwrappedKey.extractable is true
+PASS unwrappedKey.algorithm.name is 'AES-CBC'
+PASS unwrappedKey.algorithm.length is 256
+PASS unwrappedKey.usages is ['decrypt', 'encrypt']
+Exporting it...
+PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
+
+Wrapping the same key as JWK...
+PASS wrappedKey.toString() is '[object ArrayBuffer]'
+Unwrapping it...
+PASS unwrappedKey.toString() is '[object CryptoKey]'
+PASS unwrappedKey.type is 'secret'
+PASS unwrappedKey.extractable is true
+PASS unwrappedKey.algorithm.name is 'AES-CBC'
+PASS unwrappedKey.algorithm.length is 256
+PASS unwrappedKey.usages is ['decrypt', 'encrypt']
+Exporting it...
+PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersaespkcs1v1_5wrapunwrapaeshtmlfromrev206882trunkLayoutTestscryptosubtlersaespkcs1v1_5wrapunwrapaeshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,103 @@
</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 wrapping and unwrapping an AES key with RSAES-PKCS1-v1_5.&quot;);
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA1_5&quot;,
+    n: Base64URL.stringify(hexStringToUint8Array(&quot;dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1&quot;)),
+    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;))
+};
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA1_5&quot;,
+    n: Base64URL.stringify(hexStringToUint8Array(&quot;dcfa10ffa74665aeef870974ea99b2ce54547c67f42aaa6dd01a2ed31fd2c242af5d960b1f896efba3543d6554b7b12687a5c688568f32e026c532d25993b97a7c2842ec2b8e1235eee2414d25806c6fbae438954eba9d2755dffeeb1b47700957815a8a233f97b1a2c714b3e2be2e42d8be30b1961582ea9948910e0c797c50fc4bb455f0fc45e5e34e6396ac5b2d46239365c7f3daaf0909400d61cf9e0ca8083eaf335a6fceb6863c1cc0cf5a171aff35d97ecb60ef251c7ec2c8a588361dc41266a4b7ed38b026ce0d53786449dbb11a06ea33ccf1eca575201ed1aa473ed1187ec1d8a744ea345bed7ea00ee4e81bba4648601dd537dc91015d31f0c2c1&quot;)),
+    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;)),
+    d: Base64URL.stringify(hexStringToUint8Array(&quot;21950851cdf25320318b305afa0f371f07ae5a44b314ebd729f5dcb15da7fa3947acdd915daed574bd16df88bf85f61060b387172fae6e01262b3864c2d3c22f94e04a8159422b4ed279c48a4c9d767d4966071a5bbf5d043e16ff46ec1ba0716f00bbc97bff5d5693e214e99c9721f12b3ec6282ae2a485721b96ddcf7403fa037d0c57ab463c448de5cc12265add886d311ea8d8a5903fa56c5f1c9cf2eb11cb657a1a7d3e41352dc3e686898c4ce4305e8b638e1b08a2a86cc9eb9866f3499ac77b6136b81cb276d614cfeb7b6ed3f3bc775e46c00066ebeee2cff7166b57520598947ff6210320b288fb4f2c3f8fe97b279414ebf7203000a19fc0424875&quot;)),
+    p: Base64URL.stringify(hexStringToUint8Array(&quot;f123bfe53de97a569d91adcf556fa625ad30f3fd3d811f9e91e6af44b6e780cb0f327829fb21190ae2806646d728cd9b6531132b1ebfef1272993060f1ce70b124393091ee8593b727367edbba009ec5be17c4acee120c841267d47631a16c36a6d1c99973c1b0b5a835bf39feafe8f6421fd9c2a90bc27976659e67bc83124d&quot;)),
+    q: Base64URL.stringify(hexStringToUint8Array(&quot;ea9839b7e37ea89bbda27e4c93471cb4fd92189a0a96bcb4d75693f18a5c2f742af9e36fde679fbd9eae345fa269527b6965021c4bdf54d685bf08960cc976f68dca21cebf44f268a59dab8d1a25e519f5147e1f45fe287d74cf725bec1326d34212c56cf4fffa202f57b68ee8cca943f3c138c4cde33bdf2c9440df65322445&quot;)),
+    dp: Base64URL.stringify(hexStringToUint8Array(&quot;ca0c9b60b8e4a6066756c65d2088419df6253b7b688a85f4f6e964d85dad52a45262867f1e9618069fccd865e9289e46e39e2022944c5c4487d345cf252d460d977d77edfefedbcbae46a23af7fa470f077da0e50942044cb1a360497cc2760ac0f2ad4a2fcd0e84d7a1d94dfdd2658fd9ce18475c1fa75ee0cebad0cf0ac04d&quot;)),
+    dq: Base64URL.stringify(hexStringToUint8Array(&quot;528171233c4e4a6c63b86764f51338846afddbcb2958344c01c4004a1dd828145a1d02a1507def4f58247a64fc10c0a288c1ae895721d78b8f044db7c00d86da55a9b654292ecd768270be69e4bd5922d4effd1f70955f9627e3e19b749e93b40ef3dd1d61d93915e2b09d930b4b1768bfacc0136f39b0cfdfb4d050011e2e65&quot;)),
+    qi: Base64URL.stringify(hexStringToUint8Array(&quot;df2eb2322cc2daabf4d1465508f41521cda7ceff23ebe61d00d441ee728dda5d16c7bf920cd95f34beb4fe32ee817ef3362e0bcd1d1245f7b07793eaa190dc5a37fdaf4c68e2ca13972d7f5148b796b6fb6d7adda07bd2cd13be98cebed1edc6ca412e395350c59a1d842bc4aa2f3c0b243fde7dfd95356f2439251a1172c45e&quot;))
+};
+var wrapAlgorithm = {name: &quot;RSAES-PKCS1-v1_5&quot;};
+var extractable = true;
+var nonExtractable = false;
+
+debug(&quot;Importing RSA keys...&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    publicKey = result;
+    return crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;wrapKey&quot;, &quot;unwrapKey&quot;]);
+}).then(function(result) {
+    privateKey = result;
+
+    debug(&quot;Importing an AES key...&quot;);
+    aesKeyData = hexStringToUint8Array(&quot;603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4&quot;);
+    return crypto.webkitSubtle.importKey(&quot;raw&quot;, aesKeyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])
+}).then(function(result) {
+    aesKey = result;
+    debug(&quot;Wrapping it...&quot;);
+
+    return crypto.webkitSubtle.wrapKey(&quot;raw&quot;, aesKey, publicKey, wrapAlgorithm);
+}).then(function(result) {
+    wrappedKey = result;
+    shouldBe(&quot;wrappedKey.toString()&quot;, &quot;'[object ArrayBuffer]'&quot;);
+
+    debug(&quot;Unwrapping it...&quot;);
+    return crypto.webkitSubtle.unwrapKey(&quot;raw&quot;, wrappedKey, privateKey, wrapAlgorithm, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]);
+}).then(function(result) {
+    unwrappedKey = result;
+    shouldBe(&quot;unwrappedKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;unwrappedKey.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;256&quot;);
+    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
+
+    debug(&quot;Exporting it...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;raw&quot;, unwrappedKey);
+}).then(function(result) {
+    unwrappedKeyData = result;
+    shouldBe(&quot;bytesToHexString(unwrappedKeyData)&quot;, &quot;bytesToHexString(aesKeyData)&quot;);
+
+    debug(&quot;\nWrapping the same key as JWK...&quot;);
+    return crypto.webkitSubtle.wrapKey(&quot;jwk&quot;, aesKey, publicKey, wrapAlgorithm);
+}).then(function(result) {
+    wrappedKey = result;
+    shouldBe(&quot;wrappedKey.toString()&quot;, &quot;'[object ArrayBuffer]'&quot;);
+
+    debug(&quot;Unwrapping it...&quot;);
+    return crypto.webkitSubtle.unwrapKey(&quot;jwk&quot;, wrappedKey, privateKey, wrapAlgorithm, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]);
+}).then(function(result) {
+    unwrappedKey = result;
+    shouldBe(&quot;unwrappedKey.toString()&quot;, &quot;'[object CryptoKey]'&quot;);
+    shouldBe(&quot;unwrappedKey.type&quot;, &quot;'secret'&quot;);
+    shouldBe(&quot;unwrappedKey.extractable&quot;, &quot;true&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.name&quot;, &quot;'AES-CBC'&quot;);
+    shouldBe(&quot;unwrappedKey.algorithm.length&quot;, &quot;256&quot;);
+    shouldBe(&quot;unwrappedKey.usages&quot;, &quot;['decrypt', 'encrypt']&quot;);
+
+    debug(&quot;Exporting it...&quot;);
+    return crypto.webkitSubtle.exportKey(&quot;raw&quot;, unwrappedKey);
+}).then(function(result) {
+    unwrappedKeyData = result;
+    shouldBe(&quot;bytesToHexString(unwrappedKeyData)&quot;, &quot;bytesToHexString(aesKeyData)&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="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+Test generating an RSA key pair for RSASSA-PKCS1-v1_5.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Generating a key pair...
+PASS keyPair.toString() is '[object CryptoKeyPair]'
+PASS keyPair.publicKey.type is 'public'
+PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS keyPair.publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
+PASS keyPair.publicKey.algorithm.hash is undefined.
+PASS keyPair.privateKey.type is 'private'
+PASS keyPair.privateKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS keyPair.privateKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
+PASS keyPair.privateKey.algorithm.hash is undefined.
+
+Testing that custom attributes on keys survive garbage collection...
+PASS keyPair.publicKey.foo is 'bar'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponentexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponentexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test generating an RSA key pair for RSASSA-PKCS1-v1_5 when exponent has leading zeroes.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Generating a key pair...
+PASS keyPair.toString() is '[object CryptoKeyPair]'
+PASS keyPair.publicKey.type is 'public'
+PASS keyPair.publicKey.algorithm.name is 'RSASSA-PKCS1-v1_5'
+PASS keyPair.publicKey.algorithm.modulusLength is 2048
+PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001'
+PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponenthtmlfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeywithleadingzeroesinexponenthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 generating an RSA key pair for RSASSA-PKCS1-v1_5 when exponent has leading zeroes.&quot;);
+
+jsTestIsAsync = true;
+
+var algorithmKeyGen = {
+    name: &quot;RSASSA-PKCS1-v1_5&quot;,
+    // RsaKeyGenParams
+    modulusLength: 2048,
+    publicExponent: new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01]),  // Equivalent to 65537
+};
+var extractable = true;
+
+debug(&quot;Generating a key pair...&quot;);
+crypto.webkitSubtle.generateKey(algorithmKeyGen, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    keyPair = result;
+    shouldBe(&quot;keyPair.toString()&quot;, &quot;'[object CryptoKeyPair]'&quot;);
+    shouldBe(&quot;keyPair.publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;keyPair.publicKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;keyPair.publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(keyPair.publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBe(&quot;bytesToHexString(keyPair.privateKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+
+    finishJSTest();
+});
+&lt;/script&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5generatekeyhtmlfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5generatekeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script&gt;
+description(&quot;Test generating an RSA key pair for RSASSA-PKCS1-v1_5.&quot;);
+
+jsTestIsAsync = true;
+
+var algorithmKeyGen = {
+    name: &quot;RSASSA-PKCS1-v1_5&quot;,
+    // RsaKeyGenParams
+    modulusLength: 2048,
+    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
+};
+var extractable = true;
+
+debug(&quot;Generating a key pair...&quot;);
+crypto.webkitSubtle.generateKey(algorithmKeyGen, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    keyPair = result;
+    shouldBe(&quot;keyPair.toString()&quot;, &quot;'[object CryptoKeyPair]'&quot;);
+    shouldBe(&quot;keyPair.publicKey.type&quot;, &quot;'public'&quot;);
+    shouldBe(&quot;keyPair.publicKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;keyPair.publicKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(keyPair.publicKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBeUndefined(&quot;keyPair.publicKey.algorithm.hash&quot;);
+    shouldBe(&quot;keyPair.privateKey.type&quot;, &quot;'private'&quot;);
+    shouldBe(&quot;keyPair.privateKey.algorithm.name&quot;, &quot;'RSASSA-PKCS1-v1_5'&quot;);
+    shouldBe(&quot;keyPair.privateKey.algorithm.modulusLength&quot;, &quot;2048&quot;);
+    shouldBe(&quot;bytesToHexString(keyPair.privateKey.algorithm.publicExponent)&quot;, &quot;'010001'&quot;);
+    shouldBeUndefined(&quot;keyPair.privateKey.algorithm.hash&quot;);
+
+    debug(&quot;\nTesting that custom attributes on keys survive garbage collection...&quot;);
+    keyPair.publicKey.foo = &quot;bar&quot;;
+    gc();
+    setTimeout(function() {
+        gc();
+        setTimeout(function() {
+            shouldBe(&quot;keyPair.publicKey.foo&quot;, &quot;'bar'&quot;);
+            finishJSTest();
+        }, 0);
+    }, 0);
+});
+&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="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwkexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+Test importing an RSA key for RSASSA-PKCS1-v1_5.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a public key...
+PASS publicKey.toString() is '[object CryptoKey]'
+PASS publicKey.type is 'public'
+PASS publicKey.usages is ['sign','verify']
+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'
+
+Importing a private key...
+PASS privateKey.toString() is '[object CryptoKey]'
+PASS privateKey.type is 'private'
+PASS privateKey.usages is ['sign','verify']
+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-256'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwksmallkeyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+A key of size 2048 bits or larger MUST be used with RS256, RS384, RS512 JWK algorithms.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;sign&quot;, &quot;verify&quot;]) threw exception TypeError: Key size is not valid for RS256.
+PASS crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;sign&quot;, &quot;verify&quot;]) threw exception TypeError: Key size is not valid for RS512.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwksmallkeyhtmlfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwksmallkeyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html        2016-10-06 21:32:02 UTC (rev 206883)
</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;A key of size 2048 bits or larger MUST be used with RS256, RS384, RS512 JWK algorithms.&quot;);
+
+var extractable = true;
+
+// openssl genrsa 1024 &gt;1024.pem
+// openssl asn1parse -in 1024.pem
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: Base64URL.stringify(hexStringToUint8Array(&quot;B7F103F8412CCD26F5D54FC3157CD8CE1F134F4EABF0A042350BDD7F00FEA2B77EEF19915B10AA2417BB2CB4EC1D57B9661A20072469B9DF9C6E89CB35CCC8543CC40770DCC30D0BBFF1BF9DA1E2549F40476EDADB9312985DAE8C7527C1C12AAFEDF4584989968CDCC9EFEB197438C534D1BFAAC30B1D41F75EADB86CC581B9&quot;)),
+    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;))
+};
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS512&quot;,
+    n: Base64URL.stringify(hexStringToUint8Array(&quot;B7F103F8412CCD26F5D54FC3157CD8CE1F134F4EABF0A042350BDD7F00FEA2B77EEF19915B10AA2417BB2CB4EC1D57B9661A20072469B9DF9C6E89CB35CCC8543CC40770DCC30D0BBFF1BF9DA1E2549F40476EDADB9312985DAE8C7527C1C12AAFEDF4584989968CDCC9EFEB197438C534D1BFAAC30B1D41F75EADB86CC581B9&quot;)),
+    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;)),
+    d: Base64URL.stringify(hexStringToUint8Array(&quot;5BA6F4F26B0F36BDB5FA6EBEE6E3096853259CFBB742B3A7A9A4DADDE0920063EC149929CB3557819A6D824E37E43B04BF323F492FC49A8028031017B81BECA8EC2A85ABCF193501D80DC251DB8863B8673D8B6772DB2D2AE08CD1829C3F542141461CACE4E8A1F112AD13FF4A4DD865A89AEA94E984D487E5798EF07643B9CD&quot;)),
+    p: Base64URL.stringify(hexStringToUint8Array(&quot;E06BFE5722A68E5D597DD8DB937483CBA352AB817209275ADAD103772B7A8EF4EA946311A2B51805959818CEB362F257D6998B475FEA9E34F2A30205B5F5A7FF&quot;)),
+    q: Base64URL.stringify(hexStringToUint8Array(&quot;D1D2DBDB1F4DCBFE8D16CDD2CF83C7B5FADFC7891F22FC527BF208F81B92F2543569C3AD22224B82D407DEB65F651D09D2558FEE8BC6E5DA51F6F13206CC1647&quot;)),
+    dp: Base64URL.stringify(hexStringToUint8Array(&quot;73ECB4F3D3AD4F6ABEF877D56C84CA339D88ED98AF0C356D040CE58A60462DA42BAC3CC47654AF34EB4226C656F96C8F9D05B1614C1588657754668E06A0FF87&quot;)),
+    dq: Base64URL.stringify(hexStringToUint8Array(&quot;5B9C5ACDB33F3E5FE7AE1B337DD325B138D5D7C2F0CB4FAB9BDE333850A1BA183631F5737441D102501D178A3CE062EB54E072B54E660B19654C12472B5C9425&quot;)),
+    qi: Base64URL.stringify(hexStringToUint8Array(&quot;D6A920B241178923C59BCBD1A815764619225A90F2C090A9FBD594A61561542D0DF179590413C26C8A72FC6E14EC63A377169970671B3A1EB5E4F4DF1A4CA725&quot;))
+};
+
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;sign&quot;, &quot;verify&quot;])');
+shouldThrow('crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, 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="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5importjwkhtmlfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5importjwkhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,65 @@
</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 RSA key for RSASSA-PKCS1-v1_5.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;,
+    d: &quot;eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ&quot;,
+    p: &quot;4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0&quot;,
+    q: &quot;xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc&quot;,
+    dp: &quot;fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk&quot;,
+    dq: &quot;jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE&quot;,
+    qi: &quot;YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk&quot;
+};
+
+debug(&quot;Importing a public key...&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;sign&quot;, &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.usages&quot;, &quot;['sign','verify']&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;);
+    debug(&quot;\nImporting a private key...&quot;);
+    return crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;sign&quot;, &quot;verify&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.usages&quot;, &quot;['sign','verify']&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-256'&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="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5signverifyexpectedtxtfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5signverifyexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+Test importing an RSA key for RSASSA-PKCS1-v1_5.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing a public key...
+
+Importing a private key...
+
+Signing some text...
+PASS bytesToHexString(new Uint8Array(signature)) is '0fd9a8aef4cc1876c0b762545336c6d1fb315ae16ae4b5e4bf34d384d8585ea7a01e76ea09ee7f7ee8d1c122e7dd15b7c94a573b2aa07203e8d13bc6fd16156cd8e5f0c15a15dccb62d152127fca09882fb53bc3e60ab586d15b95cf411e3aab4a1c231a7e91aab09ee3d4b13d11e97505ddff77683470da510ee76e8bd530c56a85f901626a5a710f716f113dfe9cf6c473ee16fa248aea3480a1033abe30f4c1243289a661e64d7818b55698280688097135968c6d4b029496d85cab2a67e4696737781f70e4392c7df71bbd6c92465947f029a1de48160aced11b5721b1cd25039fe2c16c2b38de73df3b9a83e3ea755fd0cfe51ca06b61fadf6d84677f95'
+
+Verifying the signature...
+PASS verificationResult is true
+
+Verifying a bad signature...
+PASS verificationResult is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlersassapkcs1v1_5signverifyhtmlfromrev206882trunkLayoutTestscryptosubtlersassapkcs1v1_5signverifyhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html (from rev 206882, trunk/LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,69 @@
</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 RSA key for RSASSA-PKCS1-v1_5.&quot;);
+
+jsTestIsAsync = true;
+
+var extractable = true;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: Base64URL.stringify(hexStringToUint8Array(&quot;ADC0940AFECE7351D56A6D432210B3AA49D38566B03A9F102E4F198B2DA9D740728D01426A3A058B2B805A5F91D565D969FE318AD2D1ADA713F5A829CC8CDCF8C6CB4872068164063B6D651A2226CB97ED67E0FC6C702A473DB2D79A730F8738084A2EED74922C3A119D1D101B932C0E10FAB36815F66C0792BB640B1B4C59D062FBBEDAB3CC069A535195D70E4A06432CAF149C24A00353A0B99F7CF5B17273CB4E38421BD315127CF4B3DCB3D20A7C98CFAF1A0E398A55E347FA283CE7B39273259B1B2132DC18B0EB8AAE9F78EE525356B09DF39E090E76D7985B2B71E50AF85CA36CE91F8CCB2ABBD8A529D369890D98A2CA2825C4C2FF8B7FBF09E79C0B&quot;)),
+    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;)),
+};
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: Base64URL.stringify(hexStringToUint8Array(&quot;ADC0940AFECE7351D56A6D432210B3AA49D38566B03A9F102E4F198B2DA9D740728D01426A3A058B2B805A5F91D565D969FE318AD2D1ADA713F5A829CC8CDCF8C6CB4872068164063B6D651A2226CB97ED67E0FC6C702A473DB2D79A730F8738084A2EED74922C3A119D1D101B932C0E10FAB36815F66C0792BB640B1B4C59D062FBBEDAB3CC069A535195D70E4A06432CAF149C24A00353A0B99F7CF5B17273CB4E38421BD315127CF4B3DCB3D20A7C98CFAF1A0E398A55E347FA283CE7B39273259B1B2132DC18B0EB8AAE9F78EE525356B09DF39E090E76D7985B2B71E50AF85CA36CE91F8CCB2ABBD8A529D369890D98A2CA2825C4C2FF8B7FBF09E79C0B&quot;)),
+    e: Base64URL.stringify(hexStringToUint8Array(&quot;010001&quot;)),
+    d: Base64URL.stringify(hexStringToUint8Array(&quot;78D2D2DFB682CFB45748D3C3FC3B4B049EA3E53F1C4B17734410A33DA23A59C1AA269D7A96ADD44F0BA80CB02A940F681989B6DFC76C216A6EB9C3FF950B5B59EFBB4A9C6823AFEF99819FED85541EFD7E0C5F6A88E992ACC99DC4C9D53B361763C45A4FAB613E39FF27971F2D5DB123F2F0B2B32D9A9752C8D9605F4CD3521C2DB9A86000A3040A16231F61278C7747C3AB18DBEC00A5D71023B50B134A28E51CDB419A66BA170DF618817342F7861174AA8E7499B974DBFEB9FC643B0E95645C1C4D81104BCE53DA6E6CF31B6A0085F79F2E0626482D68A5A0A45C4EAF45640D58D2F8E5164D64560CDEEA0982138CA867A870CD01A63742847ACF3A516F49&quot;)),
+    p: Base64URL.stringify(hexStringToUint8Array(&quot;E26893B808CA31E1F9B89E4A077F7B414C216E46048126DC0369A27E64A4BC4DB4D7C81BE79AA40472B5795AF27F5FE6E372CD95CE8EFDA93A81FCDD64866F4B93421A33E5D2AD3DA65529BBCA85392B2907003AEEA187EFA9459592E7FDDE328254BBC1F2EBBB8FF962CF2A2CBB3E0EA54BBE2C29A2C3A7CB25AAC0CE405E9D&quot;)),
+    q: Base64URL.stringify(hexStringToUint8Array(&quot;C4762BCE48AFB669F3FEC19C867586734ABEA433A42A2729B51A6FDA93052085F19C55F968C7845C866356E8D7B70532D5494520DD866494AFCB9289EFD9AEFD7C8D9C51CCCDE747F80DDE7B7BBC875514AD917EBD4BB5FDEE14FF1EBB34DD5D79DCD448ACA737BA459773A4B9284C056195F9CC3338F75C5407D5B9997150C7&quot;)),
+    dp: Base64URL.stringify(hexStringToUint8Array(&quot;7C1CC3CD80D40660501A8A7B1E7D1DBDFFD3DBB57A46AA5CB56A34EF809065C15B3F66AD155B4A4A3DEF8964F7C62776547CDC8220C775FA4CDE71159443B5C302289C6092BDD8C610E66288554E8EB640395C40F20B8E8F2C85BEA6D791ED3A5703C8215BDF29E494DB3BA16CFFFFD6DB7A17F7F1A30E0A6F6C689C64F41869&quot;)),
+    dq: Base64URL.stringify(hexStringToUint8Array(&quot;8E61360E220F761C0380B5C042921A06A43CD5B3B75DF553FCB4542C0C30C3094FB90575E3C1F4E33961F5327A6361991D8A2457553478E0692717E46FB74B62DA49A6E8818D17F8C88504A06964908FD09499C5485AFE62319175F347A96064C6548C64BEFBD11F662004E7746907EF3E71FABF4AC016450B81421B6860FF31&quot;)),
+    qi: Base64URL.stringify(hexStringToUint8Array(&quot;6025FFA4BC1B3010354E1547D167309A7CADA8D72B3021304E6EC1C80D9E53A9D66D0AD42EF7FB9BDFE4CDF2D4723B27A405650501B924C5CCCB44AAE29B706F2C2C6B9F86F0A00E38E4762F7BF8842F84CACF5FB6014CFF78B4A38D1E7901F86F785A3DB9EDAC878C83C23394EB9560A7FDFB642E283A1679175DECDB1DC539&quot;))
+};
+
+var data = asciiToUint8Array(&quot;Hello, world!&quot;);
+
+debug(&quot;Importing a public key...&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;sign&quot;, &quot;verify&quot;]).then(function(result) {
+    publicKey = result;
+    debug(&quot;\nImporting a private key...&quot;);
+    return crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;sign&quot;, &quot;verify&quot;]);
+}).then(function(result) {
+    privateKey = result;
+    debug(&quot;\nSigning some text...&quot;);
+    return crypto.webkitSubtle.sign({ name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;SHA-256&quot; }, privateKey, data);
+}).then(function(result) {
+    signature = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(signature))&quot;, &quot;'0fd9a8aef4cc1876c0b762545336c6d1fb315ae16ae4b5e4bf34d384d8585ea7a01e76ea09ee7f7ee8d1c122e7dd15b7c94a573b2aa07203e8d13bc6fd16156cd8e5f0c15a15dccb62d152127fca09882fb53bc3e60ab586d15b95cf411e3aab4a1c231a7e91aab09ee3d4b13d11e97505ddff77683470da510ee76e8bd530c56a85f901626a5a710f716f113dfe9cf6c473ee16fa248aea3480a1033abe30f4c1243289a661e64d7818b55698280688097135968c6d4b029496d85cab2a67e4696737781f70e4392c7df71bbd6c92465947f029a1de48160aced11b5721b1cd25039fe2c16c2b38de73df3b9a83e3ea755fd0cfe51ca06b61fadf6d84677f95'&quot;);
+
+    debug(&quot;\nVerifying the signature...&quot;);
+    return crypto.webkitSubtle.verify({ name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;SHA-256&quot; }, publicKey, signature, data);
+}).then(function(result) {
+    verificationResult = result;
+    shouldBe(&quot;verificationResult&quot;, &quot;true&quot;);
+    debug(&quot;\nVerifying a bad signature...&quot;);
+    return crypto.webkitSubtle.verify({ name: &quot;RSASSA-PKCS1-v1_5&quot;, hash: &quot;SHA-256&quot; }, publicKey, new Uint8Array(256), data);
+}).then(function(result) {
+    verificationResult = result;
+    shouldBe(&quot;verificationResult&quot;, &quot;false&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="trunkLayoutTestscryptowebkitSubtlesha1expectedtxtfromrev206882trunkLayoutTestscryptosubtlesha1expectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-1-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-1-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-1-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test crypto.webkitSubtle.digest.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+SHA1 of []
+PASS bytesToHexString(new Uint8Array(digest)) is 'da39a3ee5e6b4b0d3255bfef95601890afd80709'
+SHA1 of [0x0]
+PASS bytesToHexString(new Uint8Array(digest)) is '5ba93c9db0cff93f52b521d7420e43f6eda2784f'
+SHA1 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+PASS bytesToHexString(new Uint8Array(digest)) is '2c7e7c384f7829694282b1e3a6216def8082d055'
+PASS crypto.webkitSubtle.generateKey('sha-1') threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha1htmlfromrev206882trunkLayoutTestscryptosubtlesha1html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-1.html (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-1.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-1.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-1.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 crypto.webkitSubtle.digest.&quot;);
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+    debug(&quot;SHA1 of []&quot;);
+    return crypto.webkitSubtle.digest('sha-1', new Uint8Array([]));
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'da39a3ee5e6b4b0d3255bfef95601890afd80709'&quot;);
+
+    debug(&quot;SHA1 of [0x0]&quot;)
+    return crypto.webkitSubtle.digest({name: 'sha-1'}, new Uint8Array([0]));
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'5ba93c9db0cff93f52b521d7420e43f6eda2784f'&quot;);
+
+    debug(&quot;SHA1 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]&quot;);
+    var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
+    return crypto.webkitSubtle.digest({name: 'sha-1'}, data);
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'2c7e7c384f7829694282b1e3a6216def8082d055'&quot;);
+
+    // All SHA-1 can do is digest.
+    shouldThrow(&quot;crypto.webkitSubtle.generateKey('sha-1')&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="trunkLayoutTestscryptowebkitSubtlesha224expectedtxtfromrev206882trunkLayoutTestscryptosubtlesha224expectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-224-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-224-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-224-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-224-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test crypto.webkitSubtle.digest.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+SHA224 of []
+PASS bytesToHexString(new Uint8Array(digest)) is 'd14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f'
+SHA224 of [0x0]
+PASS bytesToHexString(new Uint8Array(digest)) is 'fff9292b4201617bdc4d3053fce02734166a683d7d858a7f5f59b073'
+SHA224 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+PASS bytesToHexString(new Uint8Array(digest)) is '767d0cdc11079ba8dca276df5c4b85507de67dce47eda4cd9196d312'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha224htmlfromrev206882trunkLayoutTestscryptosubtlesha224html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-224.html (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-224.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-224.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-224.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 crypto.webkitSubtle.digest.&quot;);
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+    debug(&quot;SHA224 of []&quot;);
+    return crypto.webkitSubtle.digest('sha-224', new Uint8Array([]));
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f'&quot;);
+
+    debug(&quot;SHA224 of [0x0]&quot;)
+    return crypto.webkitSubtle.digest({name: 'sha-224'}, new Uint8Array([0]));
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'fff9292b4201617bdc4d3053fce02734166a683d7d858a7f5f59b073'&quot;);
+
+    debug(&quot;SHA224 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]&quot;);
+    var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
+    return crypto.webkitSubtle.digest({name: 'sha-224'}, data);
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'767d0cdc11079ba8dca276df5c4b85507de67dce47eda4cd9196d312'&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="trunkLayoutTestscryptowebkitSubtlesha256expectedtxtfromrev206882trunkLayoutTestscryptosubtlesha256expectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-256-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-256-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-256-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-256-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test crypto.webkitSubtle.digest.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+SHA256 of []
+PASS bytesToHexString(new Uint8Array(digest)) is 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
+SHA256 of [0x0]
+PASS bytesToHexString(new Uint8Array(digest)) is '6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d'
+SHA256 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+PASS bytesToHexString(new Uint8Array(digest)) is '78a6273103d17c39a0b6126e226cec70e33337f4bc6a38067401b54a33e78ead'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha256htmlfromrev206882trunkLayoutTestscryptosubtlesha256html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-256.html (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-256.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-256.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-256.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 crypto.webkitSubtle.digest.&quot;);
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+    debug(&quot;SHA256 of []&quot;);
+    return crypto.webkitSubtle.digest('sha-256', new Uint8Array([]));
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'&quot;);
+
+    debug(&quot;SHA256 of [0x0]&quot;)
+    return crypto.webkitSubtle.digest({name: 'sha-256'}, new Uint8Array([0]));
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d'&quot;);
+
+    debug(&quot;SHA256 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]&quot;);
+    var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
+    return crypto.webkitSubtle.digest({name: 'sha-256'}, data);
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'78a6273103d17c39a0b6126e226cec70e33337f4bc6a38067401b54a33e78ead'&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="trunkLayoutTestscryptowebkitSubtlesha384expectedtxtfromrev206882trunkLayoutTestscryptosubtlesha384expectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-384-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-384-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-384-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-384-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test crypto.webkitSubtle.digest.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+SHA384 of []
+PASS bytesToHexString(new Uint8Array(digest)) is '38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b'
+SHA384 of [0x0]
+PASS bytesToHexString(new Uint8Array(digest)) is 'bec021b4f368e3069134e012c2b4307083d3a9bdd206e24e5f0d86e13d6636655933ec2b413465966817a9c208a11717'
+SHA384 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+PASS bytesToHexString(new Uint8Array(digest)) is '89bfcf569ae4af718510da78c67414109f5739bb5c40d51c9c8c50e2b2cee86f2f80c8b9d68f7c01201a0714572fe602'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha384htmlfromrev206882trunkLayoutTestscryptosubtlesha384html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-384.html (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-384.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-384.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-384.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 crypto.webkitSubtle.digest.&quot;);
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+    debug(&quot;SHA384 of []&quot;);
+    return crypto.webkitSubtle.digest('sha-384', new Uint8Array([]));
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b'&quot;);
+
+    debug(&quot;SHA384 of [0x0]&quot;)
+    return crypto.webkitSubtle.digest({name: 'sha-384'}, new Uint8Array([0]));
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'bec021b4f368e3069134e012c2b4307083d3a9bdd206e24e5f0d86e13d6636655933ec2b413465966817a9c208a11717'&quot;);
+
+    debug(&quot;SHA384 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]&quot;);
+    var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
+    return crypto.webkitSubtle.digest({name: 'sha-384'}, data);
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'89bfcf569ae4af718510da78c67414109f5739bb5c40d51c9c8c50e2b2cee86f2f80c8b9d68f7c01201a0714572fe602'&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="trunkLayoutTestscryptowebkitSubtlesha512expectedtxtfromrev206882trunkLayoutTestscryptosubtlesha512expectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-512-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-512-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-512-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-512-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test crypto.webkitSubtle.digest.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+SHA512 of []
+PASS bytesToHexString(new Uint8Array(digest)) is 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'
+SHA512 of [0x0]
+PASS bytesToHexString(new Uint8Array(digest)) is 'b8244d028981d693af7b456af8efa4cad63d282e19ff14942c246e50d9351d22704a802a71c3580b6370de4ceb293c324a8423342557d4e5c38438f0e36910ee'
+SHA512 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+PASS bytesToHexString(new Uint8Array(digest)) is '8ffaee0cccc162851faf051ae38667eefd423c0164c50055f8ade00afc3705e3cdeb9900004b0e426ca66ab63aa3b99b075273f44fd37c22a3555c6fd1f37ccb'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlesha512htmlfromrev206882trunkLayoutTestscryptosubtlesha512html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/sha-512.html (from rev 206882, trunk/LayoutTests/crypto/subtle/sha-512.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/sha-512.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/sha-512.html        2016-10-06 21:32:02 UTC (rev 206883)
</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 crypto.webkitSubtle.digest.&quot;);
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+    debug(&quot;SHA512 of []&quot;);
+    return crypto.webkitSubtle.digest('sha-512', new Uint8Array([]));
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e'&quot;);
+
+    debug(&quot;SHA512 of [0x0]&quot;)
+    return crypto.webkitSubtle.digest({name: 'sha-512'}, new Uint8Array([0]));
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'b8244d028981d693af7b456af8efa4cad63d282e19ff14942c246e50d9351d22704a802a71c3580b6370de4ceb293c324a8423342557d4e5c38438f0e36910ee'&quot;);
+
+    debug(&quot;SHA512 of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]&quot;);
+    var data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
+    return crypto.webkitSubtle.digest({name: 'sha-512'}, data);
+}).then(function(result) {
+    digest = result;
+    shouldBe(&quot;bytesToHexString(new Uint8Array(digest))&quot;, &quot;'8ffaee0cccc162851faf051ae38667eefd423c0164c50055f8ade00afc3705e3cdeb9900004b0e426ca66ab63aa3b99b075273f44fd37c22a3555c6fd1f37ccb'&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="trunkLayoutTestscryptowebkitSubtleunimplementedunwrapcrashexpectedtxtfromrev206882trunkLayoutTestscryptosubtleunimplementedunwrapcrashexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+Make sure that unwrap does not cause a crash.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleunimplementedunwrapcrashhtmlfromrev206882trunkLayoutTestscryptosubtleunimplementedunwrapcrashhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash.html (from rev 206882, trunk/LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/unimplemented-unwrap-crash.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,26 @@
</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/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;Make sure that unwrap does not cause a crash.&quot;);
+
+jsTestIsAsync = true;
+
+crypto.webkitSubtle.generateKey({name: &quot;AES-KW&quot;, length: 256}, false, [&quot;wrapKey&quot;]).then(function(wrappingKey) {
+    return crypto.webkitSubtle.generateKey({name: &quot;HMAC&quot;, hash: {name: &quot;SHA-256&quot;}}, true, [&quot;sign&quot;, &quot;verify&quot;]).then(function(aesKey) {
+        return crypto.webkitSubtle.wrapKey(&quot;raw&quot;, aesKey, wrappingKey, {name: &quot;AES-KW&quot;});
+    });
+}).then(finishJSTest, finishJSTest); // OK if the browser does not crash.
+&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="trunkLayoutTestscryptowebkitSubtleunwrapKeycheckusageexpectedtxtfromrev206882trunkLayoutTestscryptosubtleunwrapKeycheckusageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+CONSOLE MESSAGE: line 1: Key usages do not include 'unwrapKey'
+Verify that usage is respected in unwrapKey operation.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing RSA keys...
+Importing an AES key...
+Wrapping it...
+Unwrapping it...
+PASS crypto.webkitSubtle.unwrapKey(&quot;raw&quot;, wrappedKey, privateKey, wrapAlgorithm, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;]) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtleunwrapKeycheckusagehtmlfromrev206882trunkLayoutTestscryptosubtleunwrapKeycheckusagehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage.html (from rev 206882, trunk/LayoutTests/crypto/subtle/unwrapKey-check-usage.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/unwrapKey-check-usage.html        2016-10-06 21:32:02 UTC (rev 206883)
</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;Verify that usage is respected in unwrapKey operation.&quot;);
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;,
+    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 wrapAlgorithm = {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;};
+var extractable = true;
+var nonExtractable = false;
+
+debug(&quot;Importing RSA keys...&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;wrapKey&quot;]).then(function(result) {
+    publicKey = result;
+    return crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), null, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;]);
+}).then(function(result) {
+    privateKey = result;
+
+    debug(&quot;Importing an AES key...&quot;);
+    aesKeyData = hexStringToUint8Array(&quot;603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4&quot;);
+    return crypto.webkitSubtle.importKey(&quot;raw&quot;, aesKeyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])
+}).then(function(result) {
+    aesKey = result;
+
+    debug(&quot;Wrapping it...&quot;);
+    return crypto.webkitSubtle.wrapKey(&quot;raw&quot;, aesKey, publicKey, wrapAlgorithm);
+}).then(function(result) {
+    wrappedKey = result;
+
+    debug(&quot;Unwrapping it...&quot;);
+    // privateKey lacks unwrapKey usage.
+    shouldThrow('crypto.webkitSubtle.unwrapKey(&quot;raw&quot;, wrappedKey, privateKey, wrapAlgorithm, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&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></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlewrapKeycheckusageexpectedtxtfromrev206882trunkLayoutTestscryptosubtlewrapKeycheckusageexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage-expected.txt (from rev 206882, trunk/LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+CONSOLE MESSAGE: line 1: Key usages do not include 'wrapKey'
+Verify that usage is respected in wrapKey operation.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Importing an RSA key...
+Importing an AES key...
+Wrapping it...
+PASS crypto.webkitSubtle.wrapKey(&quot;raw&quot;, aesKey, publicKey, wrapAlgorithm) threw exception NotSupportedError (DOM Exception 9): The operation is not supported..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlewrapKeycheckusagehtmlfromrev206882trunkLayoutTestscryptosubtlewrapKeycheckusagehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage.html (from rev 206882, trunk/LayoutTests/crypto/subtle/wrapKey-check-usage.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/wrapKey-check-usage.html        2016-10-06 21:32:02 UTC (rev 206883)
</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;Verify that usage is respected in wrapKey operation.&quot;);
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA-OAEP&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+
+var wrapAlgorithm = {name: &quot;RSA-OAEP&quot;, hash: &quot;sha-1&quot;};
+var extractable = true;
+var nonExtractable = false;
+
+debug(&quot;Importing an RSA key...&quot;);
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), null, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;unwrapKey&quot;]).then(function(result) {
+    publicKey = result;
+
+    debug(&quot;Importing an AES key...&quot;);
+    aesKeyData = hexStringToUint8Array(&quot;603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4&quot;);
+    return crypto.webkitSubtle.importKey(&quot;raw&quot;, aesKeyData, &quot;aes-cbc&quot;, extractable, [&quot;encrypt&quot;, &quot;decrypt&quot;, &quot;wrapKey&quot;, &quot;unwrapKey&quot;])
+}).then(function(result) {
+    aesKey = result;
+
+    debug(&quot;Wrapping it...&quot;);
+    // publicKey lacks wrapKey usage.
+    shouldThrow('crypto.webkitSubtle.wrapKey(&quot;raw&quot;, aesKey, publicKey, wrapAlgorithm)');
+    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="trunkLayoutTestscryptoworkersaespostMessageworkerexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-Test sending aes crypto keys via postMessage to a worker.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS All checks passed in worker
-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']
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersaespostMessageworkerhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/aes-postMessage-worker.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/aes-postMessage-worker.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/aes-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,36 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test sending aes crypto keys via postMessage to a worker.&quot;);
-
-jsTestIsAsync = true;
-
-crypto.subtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;16 bytes of key!&quot;), {name: &quot;aes-cbc&quot;, length: 128}, true, [&quot;encrypt&quot;, &quot;decrypt&quot;]).then(function(localKey) {
-    var worker = new Worker(&quot;resources/aes-postMessage-worker.js&quot;);
-    worker.onmessage = function(evt) {
-        if (!evt.data.result) {
-            testFailed(&quot;Check failed in worker: &quot; + evt.data.message);
-        } else {
-            testPassed(&quot;All checks passed in worker&quot;);
-            key = evt.data.key;
-            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']&quot;);
-        }
-        finishJSTest();
-    }
-    worker.postMessage(localKey);
-});
-&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="trunkLayoutTestscryptoworkershmacpostMessageworkerexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,16 +0,0 @@
</span><del>-Test sending hmac crypto keys via postMessage to a worker.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS All checks passed in worker
-PASS key.type is 'secret'
-PASS key.extractable is true
-PASS key.algorithm.name is 'HMAC'
-PASS key.algorithm.length is 16
-PASS key.algorithm.hash.name is 'SHA-1'
-PASS key.usages is [&quot;sign&quot;, &quot;verify&quot;]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkershmacpostMessageworkerhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/hmac-postMessage-worker.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/hmac-postMessage-worker.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/hmac-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,37 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test sending hmac crypto keys via postMessage to a worker.&quot;);
-
-jsTestIsAsync = true;
-
-crypto.subtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;16 bytes of key!&quot;), {name: 'hmac', hash: {name: 'sha-1'}}, true, ['sign', 'verify']).then(function(localKey) {
-    var worker = new Worker(&quot;resources/hmac-postMessage-worker.js&quot;);
-    worker.onmessage = function(evt) {
-        if (!evt.data.result) {
-            testFailed(&quot;Check failed in worker: &quot; + evt.data.message);
-        } else {
-            testPassed(&quot;All checks passed in worker&quot;);
-            key = evt.data.key;
-            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;16&quot;);
-            shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
-            shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
-        }
-        finishJSTest();
-    }
-    worker.postMessage(localKey);
-});
-&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="trunkLayoutTestscryptoworkershrsapostMessageworkerexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,25 +0,0 @@
</span><del>-Test sending hashed rsa crypto keys via postMessage to a worker.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS All checks passed in worker for private key
-PASS privateKey.type is 'private'
-PASS privateKey.extractable is false
-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-256'
-PASS privateKey.usages is ['decrypt']
-PASS All checks passed in worker for public key
-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 ['encrypt']
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkershrsapostMessageworkerhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,84 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test sending hashed rsa crypto keys via postMessage to a worker.&quot;);
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RS256&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;
-};
-
-var privateKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RS256&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;,
-    d: &quot;eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ&quot;,
-    p: &quot;4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0&quot;,
-    q: &quot;xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc&quot;,
-    dp: &quot;fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk&quot;,
-    dq: &quot;jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE&quot;,
-    qi: &quot;YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk&quot;
-};
-
-var algorithmKeyGen = {
-    name: &quot;RSASSA-PKCS1-v1_5&quot;,
-    // RsaKeyGenParams
-    modulusLength: 2048,
-    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
-};
-
-var count = 0;
-var worker = new Worker(&quot;resources/hrsa-postMessage-worker.js&quot;);
-worker.onmessage = function(evt) {
-    if (!evt.data.result) {
-        testFailed(&quot;Check failed in worker: &quot; + evt.data.message);
-        finishJSTest();
-    } else {
-        if (publicKey = evt.data.publicKey) {
-            testPassed(&quot;All checks passed in worker for public key&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;['encrypt']&quot;);
-        } else if (privateKey = evt.data.privateKey) {
-            testPassed(&quot;All checks passed in worker for private key&quot;);
-            shouldBe(&quot;privateKey.type&quot;, &quot;'private'&quot;);
-            shouldBe(&quot;privateKey.extractable&quot;, &quot;false&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-256'&quot;);
-            shouldBe(&quot;privateKey.usages&quot;, &quot;['decrypt']&quot;);
-        }
-        count = count + 1;
-    }
-
-    if (count == 2)
-        finishJSTest();
-}
-
-crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), algorithmKeyGen, true, ['encrypt']).then(function(localPublicKey) {
-    worker.postMessage({ publicKey: localPublicKey });
-});
-crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), algorithmKeyGen, false, ['decrypt']).then(function(localPrivateKey) {
-    worker.postMessage({ privateKey: localPrivateKey });
-});
-&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="trunkLayoutTestscryptoworkersmultiplepostMessageworkerexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,69 +0,0 @@
</span><del>-Test sending multiple crypto keys via postMessage to a worker.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS All checks passed in worker: 0
-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']
-PASS All checks passed in worker: 1
-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']
-PASS All checks passed in worker: 2
-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']
-PASS All checks passed in worker: 3
-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']
-PASS All checks passed in worker: 4
-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']
-PASS All checks passed in worker: 5
-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']
-PASS All checks passed in worker: 6
-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']
-PASS All checks passed in worker: 7
-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']
-PASS All checks passed in worker: 8
-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']
-PASS All checks passed in worker: 9
-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']
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersmultiplepostMessageworkerhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/multiple-postMessage-worker.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/multiple-postMessage-worker.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/multiple-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,47 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test sending multiple crypto keys via postMessage to a worker.&quot;);
-
-jsTestIsAsync = true;
-
-var count = 0;
-var worker = new Worker(&quot;resources/aes-postMessage-worker.js&quot;);
-worker.onmessage = function(evt) {
-    if (!evt.data.result) {
-        testFailed(&quot;Check failed in worker: &quot; + evt.data.message);
-        finishJSTest();
-    } else {
-        testPassed(&quot;All checks passed in worker: &quot; + count);
-        key = evt.data.key;
-        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']&quot;);
-        count = count + 1;
-    }
-
-    if (count == 10)
-        finishJSTest();
-}
-
-var keyFormat = &quot;raw&quot;;
-var keyData = asciiToUint8Array(&quot;16 bytes of key!&quot;);
-var aesKeyGenParams = {name: &quot;aes-cbc&quot;, length: 128};
-var usages = [&quot;encrypt&quot;, &quot;decrypt&quot;]
-for (i = 0; i &lt; 10; i++)
-    crypto.subtle.importKey(keyFormat, keyData, aesKeyGenParams, true, usages).then(function(localKey) {
-        worker.postMessage(localKey);
-    });
-&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="trunkLayoutTestscryptoworkersresourcesaespostMessageworkerjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/resources/aes-postMessage-worker.js (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/resources/aes-postMessage-worker.js        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/resources/aes-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,18 +0,0 @@
</span><del>-onmessage = function(evt)
-{
-    var key = evt.data;
-    if (!key)
-        postMessage({ result:false, message:'key is ' + key });
-    if (key.type != 'secret')
-        postMessage({ result:false, message:'key.type should be &quot;secret&quot;' });
-    else if (!key.extractable)
-        postMessage({ result:false, message:'key.extractable should be true' });
-    else if (key.algorithm.name != &quot;AES-CBC&quot;)
-        postMessage({ result:false, message:'key.algorithm.name should be &quot;AES-CBC&quot;' });
-    else if (key.algorithm.length != 128)
-        postMessage({ result:false, message:'key.algorithm.length should be 128' });
-    else if (key.usages.toString() != &quot;decrypt,encrypt&quot;)
-        postMessage({ result:false, message:'key.usages should be [&quot;decrypt&quot;, &quot;encrypt&quot;]' });
-    else
-        postMessage({ result:true, key:key });
-}
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersresourceshmacpostMessageworkerjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,20 +0,0 @@
</span><del>-onmessage = function(evt)
-{
-    var key = evt.data;
-    if (!key)
-        postMessage({ result:false, message:'key is ' + key });
-    if (key.type != 'secret')
-        postMessage({ result:false, message:'key.type should be &quot;secret&quot;' });
-    else if (!key.extractable)
-        postMessage({ result:false, message:'key.extractable should be true' });
-    else if (key.algorithm.name != &quot;HMAC&quot;)
-        postMessage({ result:false, message:'key.algorithm.name should be &quot;HMAC&quot;' });
-    else if (key.algorithm.length != 16)
-        postMessage({ result:false, message:'key.algorithm.length should be 16' });
-    else if (key.algorithm.hash.name != &quot;SHA-1&quot;)
-        postMessage({ result:false, message:'key.algorithm.hash.name should be &quot;SHA-1&quot;' });
-    else if (key.usages.toString() != &quot;sign,verify&quot;)
-        postMessage({ result:false, message:'key.usages should be [&quot;sign&quot;, &quot;verify&quot;]' });
-    else
-        postMessage({ result:true, key:key });
-}
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersresourceshrsapostMessageworkerjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-importScripts(&quot;../../resources/common.js&quot;);
-
-onmessage = function(evt)
-{
-    if (publicKey = evt.data.publicKey) {
-        if (publicKey.type != 'public')
-            postMessage({ result:false, message:'publicKey.type should be &quot;public&quot;' });
-        else if (!publicKey.extractable)
-            postMessage({ result:false, message:'publicKey.extractable should be true' });
-        else if (publicKey.algorithm.name != &quot;RSASSA-PKCS1-v1_5&quot;)
-            postMessage({ result:false, message:'publicKey.algorithm.name should be &quot;RSASSA-PKCS1-v1_5&quot;' });
-        else if (publicKey.algorithm.modulusLength != 2048)
-            postMessage({ result:false, message:'publicKey.algorithm.modulusLength should be 2048' });
-        else if (bytesToHexString(publicKey.algorithm.publicExponent) != &quot;010001&quot;)
-            postMessage({ result:false, message:'publicKey.algorithm.publicExponent should be &quot;010001&quot;' });
-        else if (publicKey.algorithm.hash.name != &quot;SHA-256&quot;)
-            postMessage({ result:false, message:'publicKey.algorithm.hash.name should be &quot;SHA-256&quot;' });
-        else if (publicKey.usages.toString() != &quot;encrypt&quot;)
-            postMessage({ result:false, message:'publicKey.usages should be [&quot;encrypt&quot;]' });
-        else
-            postMessage({ result:true, publicKey:publicKey });
-    } else if (privateKey = evt.data.privateKey) {
-        if (privateKey.type != 'private')
-            postMessage({ result:false, message:'privateKey.type should be &quot;private&quot;' });
-        else if (privateKey.extractable)
-            postMessage({ result:false, message:'privateKey.extractable should be false' });
-        else if (privateKey.algorithm.name != &quot;RSASSA-PKCS1-v1_5&quot;)
-            postMessage({ result:false, message:'privateKey.algorithm.name should be &quot;RSASSA-PKCS1-v1_5&quot;' });
-        else if (privateKey.algorithm.modulusLength != 2048)
-            postMessage({ result:false, message:'privateKey.algorithm.modulusLength should be 2048' });
-        else if (bytesToHexString(privateKey.algorithm.publicExponent) != &quot;010001&quot;)
-            postMessage({ result:false, message:'privateKey.algorithm.publicExponent should be &quot;010001&quot;' });
-        else if (privateKey.algorithm.hash.name != &quot;SHA-256&quot;)
-            postMessage({ result:false, message:'publicKey.algorithm.hash.name should be &quot;SHA-256&quot;' });
-        else if (privateKey.usages.toString() != &quot;decrypt&quot;)
-            postMessage({ result:false, message:'privateKey.usages should be [&quot;decrypt&quot;]' });
-        else
-            postMessage({ result:true, privateKey:privateKey });
-    } else {
-        postMessage({ result:false, message:'key is ' + key });
-    }
-}
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersresourcesrsapostMessageworkerjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-importScripts(&quot;../../resources/common.js&quot;);
-
-onmessage = function(evt)
-{
-    if (publicKey = evt.data.publicKey) {
-        if (publicKey.type != 'public')
-            postMessage({ result:false, message:'publicKey.type should be &quot;public&quot;' });
-        else if (!publicKey.extractable)
-            postMessage({ result:false, message:'publicKey.extractable should be true' });
-        else if (publicKey.algorithm.name != &quot;RSAES-PKCS1-v1_5&quot;)
-            postMessage({ result:false, message:'publicKey.algorithm.name should be &quot;RSAES-PKCS1-v1_5&quot;' });
-        else if (publicKey.algorithm.modulusLength != 2048)
-            postMessage({ result:false, message:'publicKey.algorithm.modulusLength should be 2048' });
-        else if (bytesToHexString(publicKey.algorithm.publicExponent) != &quot;010001&quot;)
-            postMessage({ result:false, message:'publicKey.algorithm.publicExponent should be &quot;010001&quot;' });
-        else if (typeof publicKey.algorithm.hash != 'undefined')
-            postMessage({ result:false, message:'publicKey.algorithm.hash should be undefined' });
-        else if (publicKey.usages.toString() != &quot;encrypt&quot;)
-            postMessage({ result:false, message:'publicKey.usages should be [&quot;encrypt&quot;]' });
-        else
-            postMessage({ result:true, publicKey:publicKey });
-    } else if (privateKey = evt.data.privateKey) {
-        if (privateKey.type != 'private')
-            postMessage({ result:false, message:'privateKey.type should be &quot;private&quot;' });
-        else if (privateKey.extractable)
-            postMessage({ result:false, message:'privateKey.extractable should be false' });
-        else if (privateKey.algorithm.name != &quot;RSAES-PKCS1-v1_5&quot;)
-            postMessage({ result:false, message:'privateKey.algorithm.name should be &quot;RSAES-PKCS1-v1_5&quot;' });
-        else if (privateKey.algorithm.modulusLength != 2048)
-            postMessage({ result:false, message:'privateKey.algorithm.modulusLength should be 2048' });
-        else if (bytesToHexString(privateKey.algorithm.publicExponent) != &quot;010001&quot;)
-            postMessage({ result:false, message:'privateKey.algorithm.publicExponent should be &quot;010001&quot;' });
-        else if (typeof privateKey.algorithm.hash != 'undefined')
-            postMessage({ result:false, message:'privateKey.algorithm.hash should be undefined' });
-        else if (privateKey.usages.toString() != &quot;decrypt&quot;)
-            postMessage({ result:false, message:'privateKey.usages should be [&quot;decrypt&quot;]' });
-        else
-            postMessage({ result:true, privateKey:privateKey });
-    } else {
-        postMessage({ result:false, message:'key is ' + key });
-    }
-}
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersrsapostMessageworkerexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,25 +0,0 @@
</span><del>-Test sending rsa crypto keys via postMessage to a worker.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS All checks passed in worker for private key
-PASS privateKey.type is 'private'
-PASS privateKey.extractable is false
-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 All checks passed in worker for public 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
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptoworkersrsapostMessageworkerhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/workers/rsa-postMessage-worker.html (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/rsa-postMessage-worker.html        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/crypto/workers/rsa-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,84 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../resources/common.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test sending rsa crypto keys via postMessage to a worker.&quot;);
-
-jsTestIsAsync = true;
-
-var publicKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RSA1_5&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;
-};
-
-var privateKeyJSON = {
-    kty: &quot;RSA&quot;,
-    alg: &quot;RSA1_5&quot;,
-    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
-    e: &quot;AQAB&quot;,
-    d: &quot;eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ&quot;,
-    p: &quot;4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0&quot;,
-    q: &quot;xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc&quot;,
-    dp: &quot;fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk&quot;,
-    dq: &quot;jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE&quot;,
-    qi: &quot;YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk&quot;
-};
-
-var algorithmKeyGen = {
-    name: &quot;RSAES-PKCS1-v1_5&quot;,
-    // RsaKeyGenParams
-    modulusLength: 2048,
-    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
-};
-
-var count = 0;
-var worker = new Worker(&quot;resources/rsa-postMessage-worker.js&quot;);
-worker.onmessage = function(evt) {
-    if (!evt.data.result) {
-        testFailed(&quot;Check failed in worker: &quot; + evt.data.message);
-        finishJSTest();
-    } else {
-        if (publicKey = evt.data.publicKey) {
-            testPassed(&quot;All checks passed in worker for public key&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;);
-        } else if (privateKey = evt.data.privateKey) {
-            testPassed(&quot;All checks passed in worker for private key&quot;);
-            shouldBe(&quot;privateKey.type&quot;, &quot;'private'&quot;);
-            shouldBe(&quot;privateKey.extractable&quot;, &quot;false&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;);
-        }
-        count = count + 1;
-    }
-
-    if (count == 2)
-        finishJSTest();
-}
-
-crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), algorithmKeyGen, true, ['encrypt']).then(function(localPublicKey) {
-    worker.postMessage({ publicKey: localPublicKey });
-});
-crypto.subtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), algorithmKeyGen, false, ['decrypt']).then(function(localPrivateKey) {
-    worker.postMessage({ privateKey: localPrivateKey });
-});
-&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="trunkLayoutTestscryptoworkerssubtleaespostMessageworkerexpectedtxtfromrev206882trunkLayoutTestscryptoworkersaespostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker-expected.txt (from rev 206882, trunk/LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test sending aes crypto keys via postMessage to a worker.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS All checks passed in worker
+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']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleaespostMessageworkerhtmlfromrev206882trunkLayoutTestscryptoworkersaespostMessageworkerhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker.html (from rev 206882, trunk/LayoutTests/crypto/workers/aes-postMessage-worker.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker.html                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/aes-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test sending aes crypto keys via postMessage to a worker.&quot;);
+
+jsTestIsAsync = true;
+
+crypto.webkitSubtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;16 bytes of key!&quot;), {name: &quot;aes-cbc&quot;, length: 128}, true, [&quot;encrypt&quot;, &quot;decrypt&quot;]).then(function(localKey) {
+    var worker = new Worker(&quot;resources/aes-postMessage-worker.js&quot;);
+    worker.onmessage = function(evt) {
+        if (!evt.data.result) {
+            testFailed(&quot;Check failed in worker: &quot; + evt.data.message);
+        } else {
+            testPassed(&quot;All checks passed in worker&quot;);
+            key = evt.data.key;
+            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']&quot;);
+        }
+        finishJSTest();
+    }
+    worker.postMessage(localKey);
+});
+&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="trunkLayoutTestscryptoworkerssubtlegcworkerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/gc-worker-expected.txt (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/gc-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/gc-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+[Worker] Test that self.crypto.subtle wrapper preserves custom properties.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Starting worker: resources/gc-worker.js
+PASS [Worker] self.crypto.subtle.foo is &quot;bar&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtlegcworkerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/gc-worker.html (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/gc-worker.html                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/gc-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</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/gc-worker.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="trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerexpectedtxtfromrev206882trunkLayoutTestscryptoworkershmacpostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt (from rev 206882, trunk/LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+Test sending hmac crypto keys via postMessage to a worker.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS All checks passed in worker
+PASS key.type is 'secret'
+PASS key.extractable is true
+PASS key.algorithm.name is 'HMAC'
+PASS key.algorithm.length is 16
+PASS key.algorithm.hash.name is 'SHA-1'
+PASS key.usages is [&quot;sign&quot;, &quot;verify&quot;]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtlehmacpostMessageworkerhtmlfromrev206882trunkLayoutTestscryptoworkershmacpostMessageworkerhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker.html (from rev 206882, trunk/LayoutTests/crypto/workers/hmac-postMessage-worker.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker.html                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/hmac-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test sending hmac crypto keys via postMessage to a worker.&quot;);
+
+jsTestIsAsync = true;
+
+crypto.webkitSubtle.importKey(&quot;raw&quot;, asciiToUint8Array(&quot;16 bytes of key!&quot;), {name: 'hmac', hash: {name: 'sha-1'}}, true, ['sign', 'verify']).then(function(localKey) {
+    var worker = new Worker(&quot;resources/hmac-postMessage-worker.js&quot;);
+    worker.onmessage = function(evt) {
+        if (!evt.data.result) {
+            testFailed(&quot;Check failed in worker: &quot; + evt.data.message);
+        } else {
+            testPassed(&quot;All checks passed in worker&quot;);
+            key = evt.data.key;
+            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;16&quot;);
+            shouldBe(&quot;key.algorithm.hash.name&quot;, &quot;'SHA-1'&quot;);
+            shouldBe(&quot;key.usages&quot;, '[&quot;sign&quot;, &quot;verify&quot;]');
+        }
+        finishJSTest();
+    }
+    worker.postMessage(localKey);
+});
+&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="trunkLayoutTestscryptoworkerssubtlehrsapostMessageworkerexpectedtxtfromrev206882trunkLayoutTestscryptoworkershrsapostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker-expected.txt (from rev 206882, trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+Test sending hashed rsa crypto keys via postMessage to a worker.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS All checks passed in worker for private key
+PASS privateKey.type is 'private'
+PASS privateKey.extractable is false
+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-256'
+PASS privateKey.usages is ['decrypt']
+PASS All checks passed in worker for public key
+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 ['encrypt']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtlehrsapostMessageworkerhtmlfromrev206882trunkLayoutTestscryptoworkershrsapostMessageworkerhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker.html (from rev 206882, trunk/LayoutTests/crypto/workers/hrsa-postMessage-worker.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker.html                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/hrsa-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test sending hashed rsa crypto keys via postMessage to a worker.&quot;);
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RS256&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;,
+    d: &quot;eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ&quot;,
+    p: &quot;4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0&quot;,
+    q: &quot;xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc&quot;,
+    dp: &quot;fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk&quot;,
+    dq: &quot;jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE&quot;,
+    qi: &quot;YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk&quot;
+};
+
+var algorithmKeyGen = {
+    name: &quot;RSASSA-PKCS1-v1_5&quot;,
+    // RsaKeyGenParams
+    modulusLength: 2048,
+    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
+};
+
+var count = 0;
+var worker = new Worker(&quot;resources/hrsa-postMessage-worker.js&quot;);
+worker.onmessage = function(evt) {
+    if (!evt.data.result) {
+        testFailed(&quot;Check failed in worker: &quot; + evt.data.message);
+        finishJSTest();
+    } else {
+        if (publicKey = evt.data.publicKey) {
+            testPassed(&quot;All checks passed in worker for public key&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;['encrypt']&quot;);
+        } else if (privateKey = evt.data.privateKey) {
+            testPassed(&quot;All checks passed in worker for private key&quot;);
+            shouldBe(&quot;privateKey.type&quot;, &quot;'private'&quot;);
+            shouldBe(&quot;privateKey.extractable&quot;, &quot;false&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-256'&quot;);
+            shouldBe(&quot;privateKey.usages&quot;, &quot;['decrypt']&quot;);
+        }
+        count = count + 1;
+    }
+
+    if (count == 2)
+        finishJSTest();
+}
+
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), algorithmKeyGen, true, ['encrypt']).then(function(localPublicKey) {
+    worker.postMessage({ publicKey: localPublicKey });
+});
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), algorithmKeyGen, false, ['decrypt']).then(function(localPrivateKey) {
+    worker.postMessage({ privateKey: localPrivateKey });
+});
+&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="trunkLayoutTestscryptoworkerssubtlemultiplepostMessageworkerexpectedtxtfromrev206882trunkLayoutTestscryptoworkersmultiplepostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker-expected.txt (from rev 206882, trunk/LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+Test sending multiple crypto keys via postMessage to a worker.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS All checks passed in worker: 0
+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']
+PASS All checks passed in worker: 1
+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']
+PASS All checks passed in worker: 2
+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']
+PASS All checks passed in worker: 3
+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']
+PASS All checks passed in worker: 4
+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']
+PASS All checks passed in worker: 5
+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']
+PASS All checks passed in worker: 6
+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']
+PASS All checks passed in worker: 7
+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']
+PASS All checks passed in worker: 8
+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']
+PASS All checks passed in worker: 9
+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']
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtlemultiplepostMessageworkerhtmlfromrev206882trunkLayoutTestscryptoworkersmultiplepostMessageworkerhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker.html (from rev 206882, trunk/LayoutTests/crypto/workers/multiple-postMessage-worker.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker.html                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/multiple-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test sending multiple crypto keys via postMessage to a worker.&quot;);
+
+jsTestIsAsync = true;
+
+var count = 0;
+var worker = new Worker(&quot;resources/aes-postMessage-worker.js&quot;);
+worker.onmessage = function(evt) {
+    if (!evt.data.result) {
+        testFailed(&quot;Check failed in worker: &quot; + evt.data.message);
+        finishJSTest();
+    } else {
+        testPassed(&quot;All checks passed in worker: &quot; + count);
+        key = evt.data.key;
+        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']&quot;);
+        count = count + 1;
+    }
+
+    if (count == 10)
+        finishJSTest();
+}
+
+var keyFormat = &quot;raw&quot;;
+var keyData = asciiToUint8Array(&quot;16 bytes of key!&quot;);
+var aesKeyGenParams = {name: &quot;aes-cbc&quot;, length: 128};
+var usages = [&quot;encrypt&quot;, &quot;decrypt&quot;]
+for (i = 0; i &lt; 10; i++)
+    crypto.webkitSubtle.importKey(keyFormat, keyData, aesKeyGenParams, true, usages).then(function(localKey) {
+        worker.postMessage(localKey);
+    });
+&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="trunkLayoutTestscryptoworkerssubtleresourcesaespostMessageworkerjsfromrev206882trunkLayoutTestscryptoworkersresourcesaespostMessageworkerjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/resources/aes-postMessage-worker.js (from rev 206882, trunk/LayoutTests/crypto/workers/resources/aes-postMessage-worker.js) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/aes-postMessage-worker.js                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/aes-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+onmessage = function(evt)
+{
+    var key = evt.data;
+    if (!key)
+        postMessage({ result:false, message:'key is ' + key });
+    if (key.type != 'secret')
+        postMessage({ result:false, message:'key.type should be &quot;secret&quot;' });
+    else if (!key.extractable)
+        postMessage({ result:false, message:'key.extractable should be true' });
+    else if (key.algorithm.name != &quot;AES-CBC&quot;)
+        postMessage({ result:false, message:'key.algorithm.name should be &quot;AES-CBC&quot;' });
+    else if (key.algorithm.length != 128)
+        postMessage({ result:false, message:'key.algorithm.length should be 128' });
+    else if (key.usages.toString() != &quot;decrypt,encrypt&quot;)
+        postMessage({ result:false, message:'key.usages should be [&quot;decrypt&quot;, &quot;encrypt&quot;]' });
+    else
+        postMessage({ result:true, key:key });
+}
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleresourcesgcworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/crypto/workers/subtle/resources/gc-worker.js (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/gc-worker.js                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/gc-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+importScripts('../../../../resources/js-test-pre.js');
+
+description(&quot;Test that self.crypto.subtle wrapper preserves custom properties.&quot;);
+jsTestIsAsync = true;
+
+function startTest()
+{
+    self.crypto.subtle.foo = &quot;bar&quot;;
+    gc();
+    setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+    gc();
+    setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+    gc();
+    shouldBe('self.crypto.subtle.foo', '&quot;bar&quot;');
+    finishJSTest();
+}
+
+startTest();
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleresourceshmacpostMessageworkerjsfromrev206882trunkLayoutTestscryptoworkersresourceshmacpostMessageworkerjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/resources/hmac-postMessage-worker.js (from rev 206882, trunk/LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/hmac-postMessage-worker.js                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/hmac-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+onmessage = function(evt)
+{
+    var key = evt.data;
+    if (!key)
+        postMessage({ result:false, message:'key is ' + key });
+    if (key.type != 'secret')
+        postMessage({ result:false, message:'key.type should be &quot;secret&quot;' });
+    else if (!key.extractable)
+        postMessage({ result:false, message:'key.extractable should be true' });
+    else if (key.algorithm.name != &quot;HMAC&quot;)
+        postMessage({ result:false, message:'key.algorithm.name should be &quot;HMAC&quot;' });
+    else if (key.algorithm.length != 16)
+        postMessage({ result:false, message:'key.algorithm.length should be 16' });
+    else if (key.algorithm.hash.name != &quot;SHA-1&quot;)
+        postMessage({ result:false, message:'key.algorithm.hash.name should be &quot;SHA-1&quot;' });
+    else if (key.usages.toString() != &quot;sign,verify&quot;)
+        postMessage({ result:false, message:'key.usages should be [&quot;sign&quot;, &quot;verify&quot;]' });
+    else
+        postMessage({ result:true, key:key });
+}
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleresourceshrsapostMessageworkerjsfromrev206882trunkLayoutTestscryptoworkersresourceshrsapostMessageworkerjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/resources/hrsa-postMessage-worker.js (from rev 206882, trunk/LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/hrsa-postMessage-worker.js                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/hrsa-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+importScripts(&quot;../../../resources/common.js&quot;);
+
+onmessage = function(evt)
+{
+    if (publicKey = evt.data.publicKey) {
+        if (publicKey.type != 'public')
+            postMessage({ result:false, message:'publicKey.type should be &quot;public&quot;' });
+        else if (!publicKey.extractable)
+            postMessage({ result:false, message:'publicKey.extractable should be true' });
+        else if (publicKey.algorithm.name != &quot;RSASSA-PKCS1-v1_5&quot;)
+            postMessage({ result:false, message:'publicKey.algorithm.name should be &quot;RSASSA-PKCS1-v1_5&quot;' });
+        else if (publicKey.algorithm.modulusLength != 2048)
+            postMessage({ result:false, message:'publicKey.algorithm.modulusLength should be 2048' });
+        else if (bytesToHexString(publicKey.algorithm.publicExponent) != &quot;010001&quot;)
+            postMessage({ result:false, message:'publicKey.algorithm.publicExponent should be &quot;010001&quot;' });
+        else if (publicKey.algorithm.hash.name != &quot;SHA-256&quot;)
+            postMessage({ result:false, message:'publicKey.algorithm.hash.name should be &quot;SHA-256&quot;' });
+        else if (publicKey.usages.toString() != &quot;encrypt&quot;)
+            postMessage({ result:false, message:'publicKey.usages should be [&quot;encrypt&quot;]' });
+        else
+            postMessage({ result:true, publicKey:publicKey });
+    } else if (privateKey = evt.data.privateKey) {
+        if (privateKey.type != 'private')
+            postMessage({ result:false, message:'privateKey.type should be &quot;private&quot;' });
+        else if (privateKey.extractable)
+            postMessage({ result:false, message:'privateKey.extractable should be false' });
+        else if (privateKey.algorithm.name != &quot;RSASSA-PKCS1-v1_5&quot;)
+            postMessage({ result:false, message:'privateKey.algorithm.name should be &quot;RSASSA-PKCS1-v1_5&quot;' });
+        else if (privateKey.algorithm.modulusLength != 2048)
+            postMessage({ result:false, message:'privateKey.algorithm.modulusLength should be 2048' });
+        else if (bytesToHexString(privateKey.algorithm.publicExponent) != &quot;010001&quot;)
+            postMessage({ result:false, message:'privateKey.algorithm.publicExponent should be &quot;010001&quot;' });
+        else if (privateKey.algorithm.hash.name != &quot;SHA-256&quot;)
+            postMessage({ result:false, message:'publicKey.algorithm.hash.name should be &quot;SHA-256&quot;' });
+        else if (privateKey.usages.toString() != &quot;decrypt&quot;)
+            postMessage({ result:false, message:'privateKey.usages should be [&quot;decrypt&quot;]' });
+        else
+            postMessage({ result:true, privateKey:privateKey });
+    } else {
+        postMessage({ result:false, message:'key is ' + key });
+    }
+}
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtleresourcesrsapostMessageworkerjsfromrev206882trunkLayoutTestscryptoworkersresourcesrsapostMessageworkerjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/resources/rsa-postMessage-worker.js (from rev 206882, trunk/LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/resources/rsa-postMessage-worker.js                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/resources/rsa-postMessage-worker.js        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+importScripts(&quot;../../../resources/common.js&quot;);
+
+onmessage = function(evt)
+{
+    if (publicKey = evt.data.publicKey) {
+        if (publicKey.type != 'public')
+            postMessage({ result:false, message:'publicKey.type should be &quot;public&quot;' });
+        else if (!publicKey.extractable)
+            postMessage({ result:false, message:'publicKey.extractable should be true' });
+        else if (publicKey.algorithm.name != &quot;RSAES-PKCS1-v1_5&quot;)
+            postMessage({ result:false, message:'publicKey.algorithm.name should be &quot;RSAES-PKCS1-v1_5&quot;' });
+        else if (publicKey.algorithm.modulusLength != 2048)
+            postMessage({ result:false, message:'publicKey.algorithm.modulusLength should be 2048' });
+        else if (bytesToHexString(publicKey.algorithm.publicExponent) != &quot;010001&quot;)
+            postMessage({ result:false, message:'publicKey.algorithm.publicExponent should be &quot;010001&quot;' });
+        else if (typeof publicKey.algorithm.hash != 'undefined')
+            postMessage({ result:false, message:'publicKey.algorithm.hash should be undefined' });
+        else if (publicKey.usages.toString() != &quot;encrypt&quot;)
+            postMessage({ result:false, message:'publicKey.usages should be [&quot;encrypt&quot;]' });
+        else
+            postMessage({ result:true, publicKey:publicKey });
+    } else if (privateKey = evt.data.privateKey) {
+        if (privateKey.type != 'private')
+            postMessage({ result:false, message:'privateKey.type should be &quot;private&quot;' });
+        else if (privateKey.extractable)
+            postMessage({ result:false, message:'privateKey.extractable should be false' });
+        else if (privateKey.algorithm.name != &quot;RSAES-PKCS1-v1_5&quot;)
+            postMessage({ result:false, message:'privateKey.algorithm.name should be &quot;RSAES-PKCS1-v1_5&quot;' });
+        else if (privateKey.algorithm.modulusLength != 2048)
+            postMessage({ result:false, message:'privateKey.algorithm.modulusLength should be 2048' });
+        else if (bytesToHexString(privateKey.algorithm.publicExponent) != &quot;010001&quot;)
+            postMessage({ result:false, message:'privateKey.algorithm.publicExponent should be &quot;010001&quot;' });
+        else if (typeof privateKey.algorithm.hash != 'undefined')
+            postMessage({ result:false, message:'privateKey.algorithm.hash should be undefined' });
+        else if (privateKey.usages.toString() != &quot;decrypt&quot;)
+            postMessage({ result:false, message:'privateKey.usages should be [&quot;decrypt&quot;]' });
+        else
+            postMessage({ result:true, privateKey:privateKey });
+    } else {
+        postMessage({ result:false, message:'key is ' + key });
+    }
+}
</ins></span></pre></div>
<a id="trunkLayoutTestscryptoworkerssubtlersapostMessageworkerexpectedtxtfromrev206882trunkLayoutTestscryptoworkersrsapostMessageworkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker-expected.txt (from rev 206882, trunk/LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+Test sending rsa crypto keys via postMessage to a worker.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS All checks passed in worker for private key
+PASS privateKey.type is 'private'
+PASS privateKey.extractable is false
+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 All checks passed in worker for public 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="trunkLayoutTestscryptoworkerssubtlersapostMessageworkerhtmlfromrev206882trunkLayoutTestscryptoworkersrsapostMessageworkerhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker.html (from rev 206882, trunk/LayoutTests/crypto/workers/rsa-postMessage-worker.html) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker.html                                (rev 0)
+++ trunk/LayoutTests/crypto/workers/subtle/rsa-postMessage-worker.html        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/common.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test sending rsa crypto keys via postMessage to a worker.&quot;);
+
+jsTestIsAsync = true;
+
+var publicKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA1_5&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;
+};
+
+var privateKeyJSON = {
+    kty: &quot;RSA&quot;,
+    alg: &quot;RSA1_5&quot;,
+    n: &quot;rcCUCv7Oc1HVam1DIhCzqknThWawOp8QLk8Ziy2p10ByjQFCajoFiyuAWl-R1WXZaf4xitLRracT9agpzIzc-MbLSHIGgWQGO21lGiImy5ftZ-D8bHAqRz2y15pzD4c4CEou7XSSLDoRnR0QG5MsDhD6s2gV9mwHkrtkCxtMWdBi-77as8wGmlNRldcOSgZDLK8UnCSgA1OguZ989bFyc8tOOEIb0xUSfPSz3LPSCnyYz68aDjmKVeNH-ig857OScyWbGyEy3Biw64qun3juUlNWsJ3zngkOdteYWytx5Qr4XKNs6R-Myyq72KUp02mJDZiiyiglxML_i3-_CeecCw&quot;,
+    e: &quot;AQAB&quot;,
+    d: &quot;eNLS37aCz7RXSNPD_DtLBJ6j5T8cSxdzRBCjPaI6WcGqJp16lq3UTwuoDLAqlA9oGYm238dsIWpuucP_lQtbWe-7SpxoI6_vmYGf7YVUHv1-DF9qiOmSrMmdxMnVOzYXY8RaT6thPjn_J5cfLV2xI_LwsrMtmpdSyNlgX0zTUhwtuahgAKMEChYjH2EnjHdHw6sY2-wApdcQI7ULE0oo5RzbQZpmuhcN9hiBc0L3hhF0qo50mbl02_65_GQ7DpVkXBxNgRBLzlPabmzzG2oAhfefLgYmSC1opaCkXE6vRWQNWNL45RZNZFYM3uoJghOMqGeocM0BpjdChHrPOlFvSQ&quot;,
+    p: &quot;4miTuAjKMeH5uJ5KB397QUwhbkYEgSbcA2mifmSkvE2018gb55qkBHK1eVryf1_m43LNlc6O_ak6gfzdZIZvS5NCGjPl0q09plUpu8qFOSspBwA67qGH76lFlZLn_d4yglS7wfLru4_5Ys8qLLs-DqVLviwposOnyyWqwM5AXp0&quot;,
+    q: &quot;xHYrzkivtmnz_sGchnWGc0q-pDOkKicptRpv2pMFIIXxnFX5aMeEXIZjVujXtwUy1UlFIN2GZJSvy5KJ79mu_XyNnFHMzedH-A3ee3u8h1UUrZF-vUu1_e4U_x67NN1dedzUSKynN7pFl3OkuShMBWGV-cwzOPdcVAfVuZlxUMc&quot;,
+    dp: &quot;fBzDzYDUBmBQGop7Hn0dvf_T27V6RqpctWo074CQZcFbP2atFVtKSj3viWT3xid2VHzcgiDHdfpM3nEVlEO1wwIonGCSvdjGEOZiiFVOjrZAOVxA8guOjyyFvqbXke06VwPIIVvfKeSU2zuhbP__1tt6F_fxow4Kb2xonGT0GGk&quot;,
+    dq: &quot;jmE2DiIPdhwDgLXAQpIaBqQ81bO3XfVT_LRULAwwwwlPuQV148H04zlh9TJ6Y2GZHYokV1U0eOBpJxfkb7dLYtpJpuiBjRf4yIUEoGlkkI_QlJnFSFr-YjGRdfNHqWBkxlSMZL770R9mIATndGkH7z5x-r9KwBZFC4FCG2hg_zE&quot;,
+    qi: &quot;YCX_pLwbMBA1ThVH0WcwmnytqNcrMCEwTm7ByA2eU6nWbQrULvf7m9_kzfLUcjsnpAVlBQG5JMXMy0Sq4ptwbywsa5-G8KAOOOR2L3v4hC-Eys9ftgFM_3i0o40eeQH4b3haPbntrIeMg8IzlOuVYKf9-2QuKDoWeRdd7NsdxTk&quot;
+};
+
+var algorithmKeyGen = {
+    name: &quot;RSAES-PKCS1-v1_5&quot;,
+    // RsaKeyGenParams
+    modulusLength: 2048,
+    publicExponent: new Uint8Array([0x01, 0x00, 0x01]),  // Equivalent to 65537
+};
+
+var count = 0;
+var worker = new Worker(&quot;resources/rsa-postMessage-worker.js&quot;);
+worker.onmessage = function(evt) {
+    if (!evt.data.result) {
+        testFailed(&quot;Check failed in worker: &quot; + evt.data.message);
+        finishJSTest();
+    } else {
+        if (publicKey = evt.data.publicKey) {
+            testPassed(&quot;All checks passed in worker for public key&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;);
+        } else if (privateKey = evt.data.privateKey) {
+            testPassed(&quot;All checks passed in worker for private key&quot;);
+            shouldBe(&quot;privateKey.type&quot;, &quot;'private'&quot;);
+            shouldBe(&quot;privateKey.extractable&quot;, &quot;false&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;);
+        }
+        count = count + 1;
+    }
+
+    if (count == 2)
+        finishJSTest();
+}
+
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(publicKeyJSON)), algorithmKeyGen, true, ['encrypt']).then(function(localPublicKey) {
+    worker.postMessage({ publicKey: localPublicKey });
+});
+crypto.webkitSubtle.importKey(&quot;jwk&quot;, asciiToUint8Array(JSON.stringify(privateKeyJSON)), algorithmKeyGen, false, ['decrypt']).then(function(localPrivateKey) {
+    worker.postMessage({ privateKey: localPrivateKey });
+});
+&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 (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-10-06  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        Add a dummy SubtleCrypto interface
+        https://bugs.webkit.org/show_bug.cgi?id=162992
+        &lt;rdar://problem/28643573&gt;
+
+        Reviewed by Brent Fulgham.
+
+        * WebCryptoAPI/digest/test_digest-expected.txt:
+        * WebCryptoAPI/idlharness-expected.txt:
+
</ins><span class="cx"> 2016-10-06  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, drop bad tests that were included by mistake in r206874.
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIdigesttest_digestexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/digest/test_digest-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,84 +1,84 @@
</span><span class="cx"> encrypt Tests for digest method
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-FAIL SHA-1 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-1 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-1 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-1 with empty source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-256 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-256 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with empty source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-384 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-384 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with empty source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-512 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-512 with empty source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with empty source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-1 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-1 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-1 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-1 with short source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-256 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-256 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with short source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-384 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-384 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with short source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-512 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-512 with short source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with short source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-1 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-1 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-1 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-1 with medium source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-256 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-256 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with medium source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-384 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-384 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with medium source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-512 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-512 with medium source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with medium source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-1 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-1 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-1 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-1 with long source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-256 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-256 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-256 with long source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-384 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-384 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-384 with long source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL sha-512 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL Sha-512 with long source data undefined is not an object (evaluating 'subtle.digest')
-FAIL SHA-512 with long source data and altered buffer after call undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-GCM with empty undefined is not an object (evaluating 'subtle.digest')
-FAIL RSA-OAEP with empty undefined is not an object (evaluating 'subtle.digest')
-FAIL PBKDF2 with empty undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-KW with empty undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-GCM with short undefined is not an object (evaluating 'subtle.digest')
-FAIL RSA-OAEP with short undefined is not an object (evaluating 'subtle.digest')
-FAIL PBKDF2 with short undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-KW with short undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-GCM with medium undefined is not an object (evaluating 'subtle.digest')
-FAIL RSA-OAEP with medium undefined is not an object (evaluating 'subtle.digest')
-FAIL PBKDF2 with medium undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-KW with medium undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-GCM with long undefined is not an object (evaluating 'subtle.digest')
-FAIL RSA-OAEP with long undefined is not an object (evaluating 'subtle.digest')
-FAIL PBKDF2 with long undefined is not an object (evaluating 'subtle.digest')
-FAIL AES-KW with long undefined is not an object (evaluating 'subtle.digest')
</del><ins>+FAIL SHA-1 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-1 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-1 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-1 with empty source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-256 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-256 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-256 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-256 with empty source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-384 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-384 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-384 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-384 with empty source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-512 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-512 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-512 with empty source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-512 with empty source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-1 with short source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-1 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-1 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-1 with short source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-256 with short source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-256 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-256 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-256 with short source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-384 with short source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-384 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-384 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-384 with short source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-512 with short source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-512 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-512 with short source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-512 with short source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-1 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-1 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-1 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-1 with medium source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-256 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-256 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-256 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-256 with medium source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-384 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-384 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-384 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-384 with medium source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-512 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-512 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-512 with medium source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-512 with medium source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-1 with long source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-1 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-1 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-1 with long source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-256 with long source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-256 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-256 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-256 with long source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-384 with long source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-384 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-384 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-384 with long source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL SHA-512 with long source data subtle.digest is not a function. (In 'subtle.digest({name: upCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL sha-512 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL Sha-512 with long source data subtle.digest is not a function. (In 'subtle.digest({name: mixedCase}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL SHA-512 with long source data and altered buffer after call subtle.digest is not a function. (In 'subtle.digest({name: upCase}, copiedBuffer)', 'subtle.digest' is undefined)
+FAIL AES-GCM with empty subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL RSA-OAEP with empty subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL PBKDF2 with empty subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL AES-KW with empty subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL AES-GCM with short subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL RSA-OAEP with short subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL PBKDF2 with short subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL AES-KW with short subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL AES-GCM with medium subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL RSA-OAEP with medium subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL PBKDF2 with medium subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL AES-KW with medium subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL AES-GCM with long subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL RSA-OAEP with long subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL PBKDF2 with long subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
+FAIL AES-KW with long subtle.digest is not a function. (In 'subtle.digest({name: badName}, sourceData[size])', 'subtle.digest' is undefined)
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cWebCryptoAPIidlharnessexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/imported/w3c/WebCryptoAPI/idlharness-expected.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -8,11 +8,11 @@
</span><span class="cx"> PASS Crypto interface object name 
</span><span class="cx"> PASS Crypto interface: existence and properties of interface prototype object 
</span><span class="cx"> PASS Crypto interface: existence and properties of interface prototype object's &quot;constructor&quot; property 
</span><del>-FAIL Crypto interface: attribute subtle assert_true: The prototype object must have a property &quot;subtle&quot; expected true got false
</del><ins>+PASS Crypto interface: attribute subtle 
</ins><span class="cx"> PASS Crypto interface: operation getRandomValues(ArrayBufferView) 
</span><span class="cx"> PASS Crypto must be primary interface of crypto 
</span><span class="cx"> PASS Stringification of crypto 
</span><del>-FAIL Crypto interface: crypto must inherit property &quot;subtle&quot; with the proper type (0) assert_inherits: property &quot;subtle&quot; not found in prototype chain
</del><ins>+PASS Crypto interface: crypto must inherit property &quot;subtle&quot; with the proper type (0) 
</ins><span class="cx"> PASS Crypto interface: crypto must inherit property &quot;getRandomValues&quot; with the proper type (1) 
</span><span class="cx"> PASS Crypto interface: calling getRandomValues(ArrayBufferView) on crypto with too few arguments must throw TypeError 
</span><span class="cx"> PASS CryptoKey interface: existence and properties of interface object 
</span><span class="lines">@@ -41,30 +41,30 @@
</span><span class="cx"> FAIL SubtleCrypto interface: operation exportKey(KeyFormat,CryptoKey) assert_own_property: self does not have own property &quot;SubtleCrypto&quot; expected property &quot;SubtleCrypto&quot; missing
</span><span class="cx"> FAIL SubtleCrypto interface: operation wrapKey(KeyFormat,CryptoKey,CryptoKey,AlgorithmIdentifier) assert_own_property: self does not have own property &quot;SubtleCrypto&quot; expected property &quot;SubtleCrypto&quot; missing
</span><span class="cx"> FAIL SubtleCrypto interface: operation unwrapKey(KeyFormat,BufferSource,CryptoKey,AlgorithmIdentifier,AlgorithmIdentifier,boolean,[object Object]) assert_own_property: self does not have own property &quot;SubtleCrypto&quot; expected property &quot;SubtleCrypto&quot; missing
</span><del>-FAIL SubtleCrypto must be primary interface of crypto.subtle assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL Stringification of crypto.subtle assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;encrypt&quot; with the proper type (0) assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: calling encrypt(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;decrypt&quot; with the proper type (1) assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: calling decrypt(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;sign&quot; with the proper type (2) assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: calling sign(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;verify&quot; with the proper type (3) assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: calling verify(AlgorithmIdentifier,CryptoKey,BufferSource,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;digest&quot; with the proper type (4) assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: calling digest(AlgorithmIdentifier,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;generateKey&quot; with the proper type (5) assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: calling generateKey(AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;deriveKey&quot; with the proper type (6) assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: calling deriveKey(AlgorithmIdentifier,CryptoKey,AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;deriveBits&quot; with the proper type (7) assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: calling deriveBits(AlgorithmIdentifier,CryptoKey,unsigned long) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;importKey&quot; with the proper type (8) assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-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_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;exportKey&quot; with the proper type (9) assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: calling exportKey(KeyFormat,CryptoKey) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;wrapKey&quot; with the proper type (10) assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: calling wrapKey(KeyFormat,CryptoKey,CryptoKey,AlgorithmIdentifier) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;unwrapKey&quot; with the proper type (11) assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
-FAIL SubtleCrypto interface: calling unwrapKey(KeyFormat,BufferSource,CryptoKey,AlgorithmIdentifier,AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_equals: wrong typeof object expected &quot;object&quot; but got &quot;undefined&quot;
</del><ins>+FAIL SubtleCrypto must be primary interface of crypto.subtle assert_own_property: self does not have own property &quot;SubtleCrypto&quot; expected property &quot;SubtleCrypto&quot; missing
+PASS Stringification of crypto.subtle 
+FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;encrypt&quot; with the proper type (0) assert_inherits: property &quot;encrypt&quot; not found in prototype chain
+FAIL SubtleCrypto interface: calling encrypt(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property &quot;encrypt&quot; not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;decrypt&quot; with the proper type (1) assert_inherits: property &quot;decrypt&quot; not found in prototype chain
+FAIL SubtleCrypto interface: calling decrypt(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property &quot;decrypt&quot; not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;sign&quot; with the proper type (2) assert_inherits: property &quot;sign&quot; not found in prototype chain
+FAIL SubtleCrypto interface: calling sign(AlgorithmIdentifier,CryptoKey,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property &quot;sign&quot; not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;verify&quot; with the proper type (3) assert_inherits: property &quot;verify&quot; not found in prototype chain
+FAIL SubtleCrypto interface: calling verify(AlgorithmIdentifier,CryptoKey,BufferSource,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property &quot;verify&quot; not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;digest&quot; with the proper type (4) assert_inherits: property &quot;digest&quot; not found in prototype chain
+FAIL SubtleCrypto interface: calling digest(AlgorithmIdentifier,BufferSource) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property &quot;digest&quot; not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;generateKey&quot; with the proper type (5) assert_inherits: property &quot;generateKey&quot; not found in prototype chain
+FAIL SubtleCrypto interface: calling generateKey(AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property &quot;generateKey&quot; not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;deriveKey&quot; with the proper type (6) assert_inherits: property &quot;deriveKey&quot; not found in prototype chain
+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
+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
+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
+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
+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
+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
+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
+FAIL SubtleCrypto interface: calling wrapKey(KeyFormat,CryptoKey,CryptoKey,AlgorithmIdentifier) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property &quot;wrapKey&quot; not found in prototype chain
+FAIL SubtleCrypto interface: crypto.subtle must inherit property &quot;unwrapKey&quot; with the proper type (11) assert_inherits: property &quot;unwrapKey&quot; not found in prototype chain
+FAIL SubtleCrypto interface: calling unwrapKey(KeyFormat,BufferSource,CryptoKey,AlgorithmIdentifier,AlgorithmIdentifier,boolean,[object Object]) on crypto.subtle with too few arguments must throw TypeError assert_inherits: property &quot;unwrapKey&quot; not found in prototype chain
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformeflTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/TestExpectations (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/TestExpectations        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/platform/efl/TestExpectations        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -375,7 +375,7 @@
</span><span class="cx"> http/tests/security/cross-origin-worker-indexeddb-allowed.html [ Skip ]
</span><span class="cx"> http/tests/security/cross-origin-worker-indexeddb.html [ Skip ]
</span><span class="cx"> 
</span><del>-webkit.org/b/87661 crypto/subtle/rsa-indexeddb.html [ Skip ]
</del><ins>+webkit.org/b/87661 crypto/webkitSubtle/rsa-indexeddb.html [ Skip ]
</ins><span class="cx"> storage/indexeddb/database-odd-names.html [ Skip ]
</span><span class="cx"> 
</span><span class="cx"> # EFL port has not supported selection gap painting since r200412
</span><span class="lines">@@ -1957,17 +1957,17 @@
</span><span class="cx"> # and their tests are whitelisted
</span><span class="cx"> webkit.org/b/133122 crypto/subtle [ Skip ]
</span><span class="cx"> webkit.org/b/133122 crypto/webkitSubtle [ Skip ]
</span><del>-webkit.org/b/133319 crypto/subtle/sha-1.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-224.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-256.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-384.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-512.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-check-algorithm.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-export-key.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-generate-key.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-import-jwk.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-sign-verify-empty-key.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-sign-verify.html [ Pass ]
</del><ins>+webkit.org/b/133319 crypto/webkitSubtle/sha-1.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-224.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-256.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-384.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-512.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-check-algorithm.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-export-key.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-generate-key.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-import-jwk.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-sign-verify-empty-key.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-sign-verify.html [ Pass ]
</ins><span class="cx"> 
</span><span class="cx"> # Missing EFL's accessibility functions
</span><span class="cx"> webkit.org/b/111984 accessibility/aria-hidden-updates-alldescendants.html [ Failure ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -377,17 +377,17 @@
</span><span class="cx"> # and their tests are whitelisted
</span><span class="cx"> webkit.org/b/133122 crypto/subtle [ Skip ]
</span><span class="cx"> webkit.org/b/133122 crypto/webkitSubtle [ Skip ]
</span><del>-webkit.org/b/133319 crypto/subtle/sha-1.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-224.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-256.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-384.html [ Pass ]
-webkit.org/b/133319 crypto/subtle/sha-512.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-check-algorithm.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-export-key.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-generate-key.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-import-jwk.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-sign-verify-empty-key.html [ Pass ]
-webkit.org/b/133320 crypto/subtle/hmac-sign-verify.html [ Pass ]
</del><ins>+webkit.org/b/133319 crypto/webkitSubtle/sha-1.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-224.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-256.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-384.html [ Pass ]
+webkit.org/b/133319 crypto/webkitSubtle/sha-512.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-check-algorithm.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-export-key.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-generate-key.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-import-jwk.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-sign-verify-empty-key.html [ Pass ]
+webkit.org/b/133320 crypto/webkitSubtle/hmac-sign-verify.html [ Pass ]
</ins><span class="cx"> 
</span><span class="cx"> # GTK does not implement setAutomaticLinkDetectionEnabled
</span><span class="cx"> editing/inserting/typing-space-to-trigger-smart-link.html [ Skip ]
</span><span class="lines">@@ -2261,7 +2261,7 @@
</span><span class="cx"> webkit.org/b/107825 media/nodesFromRect-shadowContent.html [ Failure ]
</span><span class="cx"> webkit.org/b/107825 media/video-controls-fullscreen-volume.html [ Failure ]
</span><span class="cx"> 
</span><del>-webkit.org/b/107194 crypto/subtle/rsa-indexeddb.html [ Skip ]
</del><ins>+webkit.org/b/107194 crypto/webkitSubtle/rsa-indexeddb.html [ Skip ]
</ins><span class="cx"> 
</span><span class="cx"> # Test marked in TestExpectations as failing on non-retina displays, passing on GTK port
</span><span class="cx"> webkit.org/b/129113 fast/multicol/newmulticol/clipping.html [ Pass ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -996,10 +996,10 @@
</span><span class="cx"> storage/indexeddb
</span><span class="cx"> imported/w3c/IndexedDB-private-browsing
</span><span class="cx"> imported/w3c/web-platform-tests/IndexedDB
</span><del>-crypto/subtle/rsa-indexeddb-non-exportable-private.html
-crypto/subtle/rsa-indexeddb-non-exportable.html
-crypto/subtle/rsa-indexeddb-private.html
-crypto/subtle/rsa-indexeddb.html
</del><ins>+crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html
+crypto/webkitSubtle/rsa-indexeddb-non-exportable.html
+crypto/webkitSubtle/rsa-indexeddb-private.html
+crypto/webkitSubtle/rsa-indexeddb.html
</ins><span class="cx"> fast/history/page-cache-indexed-closed-db.html
</span><span class="cx"> fast/history/page-cache-indexed-opened-db.html
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwinTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/TestExpectations (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/TestExpectations        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/LayoutTests/platform/win/TestExpectations        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -257,10 +257,10 @@
</span><span class="cx"> http/tests/security/cross-origin-worker-indexeddb-allowed.html [ Skip ]
</span><span class="cx"> http/tests/security/cross-origin-worker-indexeddb.html [ Skip ]
</span><span class="cx"> http/tests/security/no-indexeddb-from-sandbox.html [ Skip ]
</span><del>-crypto/subtle/rsa-indexeddb-non-exportable-private.html [ Skip ]
-crypto/subtle/rsa-indexeddb-non-exportable.html [ Skip ]
-crypto/subtle/rsa-indexeddb-private.html [ Skip ]
-crypto/subtle/rsa-indexeddb.html [ Skip ]
</del><ins>+crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html [ Skip ]
+crypto/webkitSubtle/rsa-indexeddb-non-exportable.html [ Skip ]
+crypto/webkitSubtle/rsa-indexeddb-private.html [ Skip ]
+crypto/webkitSubtle/rsa-indexeddb.html [ Skip ]
</ins><span class="cx"> fast/history/page-cache-indexed-closed-db.html [ Skip ]
</span><span class="cx"> fast/history/page-cache-indexed-opened-db.html [ Skip ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -327,6 +327,7 @@
</span><span class="cx"> 
</span><span class="cx">     crypto/CryptoKey.idl
</span><span class="cx">     crypto/CryptoKeyPair.idl
</span><ins>+    crypto/SubtleCrypto.idl
</ins><span class="cx">     crypto/WebKitSubtleCrypto.idl
</span><span class="cx"> 
</span><span class="cx">     css/CSSCharsetRule.idl
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/ChangeLog        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -1,3 +1,99 @@
</span><ins>+2016-10-06  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        Add a dummy SubtleCrypto interface
+        https://bugs.webkit.org/show_bug.cgi?id=162992
+        &lt;rdar://problem/28643573&gt;
+
+        Reviewed by Brent Fulgham.
+
+        Add a dummy SubtleCrypto interface and rename KeyPair to CryptoKeyPair.
+
+        Tests: crypto/subtle/gc-2.html
+               crypto/subtle/gc-3.html
+               crypto/subtle/gc.html
+               crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html
+               crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html
+               crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html
+               crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html
+               crypto/webkitSubtle/aes-cbc-generate-key.html
+               crypto/webkitSubtle/aes-cbc-import-jwk.html
+               crypto/webkitSubtle/aes-cbc-invalid-length.html
+               crypto/webkitSubtle/aes-cbc-unwrap-failure.html
+               crypto/webkitSubtle/aes-cbc-unwrap-rsa.html
+               crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html
+               crypto/webkitSubtle/aes-cbc-wrap-rsa.html
+               crypto/webkitSubtle/aes-cbc-wrong-key-class.html
+               crypto/webkitSubtle/aes-export-key.html
+               crypto/webkitSubtle/aes-kw-key-manipulation.html
+               crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html
+               crypto/webkitSubtle/aes-postMessage.html
+               crypto/webkitSubtle/argument-conversion.html
+               crypto/webkitSubtle/array-buffer-view-offset.html
+               crypto/webkitSubtle/crypto-key-algorithm-gc.html
+               crypto/webkitSubtle/crypto-key-usages-gc.html
+               crypto/webkitSubtle/hmac-check-algorithm.html
+               crypto/webkitSubtle/hmac-export-key.html
+               crypto/webkitSubtle/hmac-generate-key.html
+               crypto/webkitSubtle/hmac-import-jwk.html
+               crypto/webkitSubtle/hmac-postMessage.html
+               crypto/webkitSubtle/hmac-sign-verify-empty-key.html
+               crypto/webkitSubtle/hmac-sign-verify.html
+               crypto/webkitSubtle/import-jwk.html
+               crypto/webkitSubtle/jwk-export-use-values.html
+               crypto/webkitSubtle/jwk-import-use-values.html
+               crypto/webkitSubtle/rsa-export-generated-keys.html
+               crypto/webkitSubtle/rsa-export-key.html
+               crypto/webkitSubtle/rsa-export-private-key.html
+               crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html
+               crypto/webkitSubtle/rsa-indexeddb-non-exportable.html
+               crypto/webkitSubtle/rsa-indexeddb-private.html
+               crypto/webkitSubtle/rsa-indexeddb.html
+               crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html
+               crypto/webkitSubtle/rsa-oaep-key-manipulation.html
+               crypto/webkitSubtle/rsa-oaep-plaintext-length.html
+               crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html
+               crypto/webkitSubtle/rsa-postMessage.html
+               crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html
+               crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html
+               crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html
+               crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html
+               crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html
+               crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html
+               crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html
+               crypto/webkitSubtle/sha-1.html
+               crypto/webkitSubtle/sha-224.html
+               crypto/webkitSubtle/sha-256.html
+               crypto/webkitSubtle/sha-384.html
+               crypto/webkitSubtle/sha-512.html
+               crypto/webkitSubtle/unimplemented-unwrap-crash.html
+               crypto/webkitSubtle/unwrapKey-check-usage.html
+               crypto/webkitSubtle/wrapKey-check-usage.html
+               crypto/workers/subtle/aes-postMessage-worker.html
+               crypto/workers/subtle/gc-worker.html
+               crypto/workers/subtle/hmac-postMessage-worker.html
+               crypto/workers/subtle/hrsa-postMessage-worker.html
+               crypto/workers/subtle/multiple-postMessage-worker.html
+               crypto/workers/subtle/rsa-postMessage-worker.html
+
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * PlatformEfl.cmake:
+        * PlatformGTK.cmake:
+        * PlatformMac.cmake:
+        * WebCore.xcodeproj/project.pbxproj:
+        * crypto/CryptoKeyPair.idl:
+        * crypto/SubtleCrypto.cpp:
+        (WebCore::SubtleCrypto::SubtleCrypto):
+        * crypto/SubtleCrypto.h:
+        (WebCore::SubtleCrypto::create):
+        * crypto/SubtleCrypto.idl: Added.
+        * page/Crypto.cpp:
+        (WebCore::Crypto::Crypto):
+        (WebCore::Crypto::subtle):
+        * page/Crypto.h:
+        * page/Crypto.idl:
+
</ins><span class="cx"> 2016-10-06  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Crash when ApplePaySession.completeMerchantValidation is not passed a dictionary
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.cpp (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.cpp        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/DerivedSources.cpp        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -599,6 +599,7 @@
</span><span class="cx"> #include &quot;JSStyleMedia.cpp&quot;
</span><span class="cx"> #include &quot;JSStyleSheet.cpp&quot;
</span><span class="cx"> #include &quot;JSStyleSheetList.cpp&quot;
</span><ins>+#include &quot;JSSubtleCrypto.cpp&quot;
</ins><span class="cx"> #include &quot;JSText.cpp&quot;
</span><span class="cx"> #include &quot;JSTextEvent.cpp&quot;
</span><span class="cx"> #include &quot;JSTextMetrics.cpp&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/DerivedSources.make        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -238,6 +238,7 @@
</span><span class="cx">     $(WebCore)/animation/WebAnimation.idl \
</span><span class="cx">     $(WebCore)/crypto/CryptoKey.idl \
</span><span class="cx">     $(WebCore)/crypto/CryptoKeyPair.idl \
</span><ins>+    $(WebCore)/crypto/SubtleCrypto.idl \
</ins><span class="cx">     $(WebCore)/crypto/WebKitSubtleCrypto.idl \
</span><span class="cx">     $(WebCore)/css/CSSCharsetRule.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 (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformEfl.cmake        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/PlatformEfl.cmake        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -407,6 +407,7 @@
</span><span class="cx">         crypto/CryptoAlgorithmRegistry.cpp
</span><span class="cx">         crypto/CryptoKey.cpp
</span><span class="cx">         crypto/CryptoKeyPair.cpp
</span><ins>+        crypto/SubtleCrypto.cpp
</ins><span class="cx">         crypto/WebKitSubtleCrypto.cpp
</span><span class="cx"> 
</span><span class="cx">         crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/PlatformGTK.cmake        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -400,6 +400,7 @@
</span><span class="cx">         crypto/CryptoAlgorithmRegistry.cpp
</span><span class="cx">         crypto/CryptoKey.cpp
</span><span class="cx">         crypto/CryptoKeyPair.cpp
</span><ins>+        crypto/SubtleCrypto.cpp
</ins><span class="cx">         crypto/WebKitSubtleCrypto.cpp
</span><span class="cx"> 
</span><span class="cx">         crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformMac.cmake (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformMac.cmake        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/PlatformMac.cmake        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -180,6 +180,7 @@
</span><span class="cx">     crypto/CryptoAlgorithmRegistry.cpp
</span><span class="cx">     crypto/CryptoKey.cpp
</span><span class="cx">     crypto/CryptoKeyPair.cpp
</span><ins>+    crypto/SubtleCrypto.cpp
</ins><span class="cx">     crypto/WebKitSubtleCrypto.cpp
</span><span class="cx"> 
</span><span class="cx">     crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -2282,8 +2282,12 @@
</span><span class="cx">                 5709E8CF1D413D9A003244AC /* WebKitSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */; };
</span><span class="cx">                 570A99DA1D417408004EC630 /* JSWebKitSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F62180745D800132674 /* JSWebKitSubtleCrypto.cpp */; };
</span><span class="cx">                 570A99DB1D41A2F3004EC630 /* JSWebKitSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F63180745D800132674 /* JSWebKitSubtleCrypto.h */; };
</span><ins>+                571F21891DA57C54005C9EFD /* JSSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */; };
+                571F218B1DA57C7B005C9EFD /* JSSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */; };
</ins><span class="cx">                 572A7F211C6E5719009C6149 /* SimulatedClick.h in Headers */ = {isa = PBXBuildFile; fileRef = 572A7F201C6E5719009C6149 /* SimulatedClick.h */; };
</span><span class="cx">                 572A7F231C6E5A66009C6149 /* SimulatedClick.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */; };
</span><ins>+                5778BD821DA4806C009E3009 /* SubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 5778BD811DA4802C009E3009 /* SubtleCrypto.h */; };
+                5778BD841DA4817B009E3009 /* SubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5778BD831DA4817B009E3009 /* SubtleCrypto.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><span class="cx">                 580371611A66F00A00BAF519 /* ClipRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5803715F1A66F00A00BAF519 /* ClipRect.cpp */; };
</span><span class="lines">@@ -9323,9 +9327,14 @@
</span><span class="cx">                 5709E8CA1D413CE3003244AC /* WebKitSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitSubtleCrypto.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitSubtleCrypto.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5709E8CC1D413CE3003244AC /* WebKitSubtleCrypto.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitSubtleCrypto.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSubtleCrypto.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSubtleCrypto.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 572A7F201C6E5719009C6149 /* SimulatedClick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimulatedClick.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimulatedClick.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 574D42791D594FF6002CF50E /* GlobalCrypto.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GlobalCrypto.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                5778BD801DA4733E009E3009 /* SubtleCrypto.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SubtleCrypto.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                5778BD811DA4802C009E3009 /* SubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubtleCrypto.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubtleCrypto.cpp; 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">                 5803715F1A66F00A00BAF519 /* ClipRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClipRect.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -22248,6 +22257,9 @@
</span><span class="cx">                                 E19727151820549E00592D51 /* CryptoKeyType.h */,
</span><span class="cx">                                 E172AF6F180F289500FBADB9 /* CryptoKeyUsage.h */,
</span><span class="cx">                                 E18DF33418AAF12C00773E59 /* SerializedCryptoKeyWrap.h */,
</span><ins>+                                5778BD811DA4802C009E3009 /* SubtleCrypto.h */,
+                                5778BD831DA4817B009E3009 /* SubtleCrypto.cpp */,
+                                5778BD801DA4733E009E3009 /* SubtleCrypto.idl */,
</ins><span class="cx">                                 5709E8CA1D413CE3003244AC /* WebKitSubtleCrypto.cpp */,
</span><span class="cx">                                 5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */,
</span><span class="cx">                                 5709E8CC1D413CE3003244AC /* WebKitSubtleCrypto.idl */,
</span><span class="lines">@@ -22262,6 +22274,8 @@
</span><span class="cx">                                 E157A8DF1817331C009F821D /* JSCryptoKey.h */,
</span><span class="cx">                                 E1F80B8B183172B5007885C3 /* JSCryptoKeyPair.cpp */,
</span><span class="cx">                                 E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */,
</span><ins>+                                571F218A1DA57C7A005C9EFD /* JSSubtleCrypto.cpp */,
+                                571F21881DA57C54005C9EFD /* JSSubtleCrypto.h */,
</ins><span class="cx">                                 E1FF8F62180745D800132674 /* JSWebKitSubtleCrypto.cpp */,
</span><span class="cx">                                 E1FF8F63180745D800132674 /* JSWebKitSubtleCrypto.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -24502,6 +24516,7 @@
</span><span class="cx">                                 84730D891248F0B300D3A9C9 /* FESpecularLighting.h in Headers */,
</span><span class="cx">                                 416E6FE81BBD12DF000A6023 /* FetchInternalsBuiltins.h in Headers */,
</span><span class="cx">                                 41AD753A1CEF6BD100A31486 /* FetchOptions.h in Headers */,
</span><ins>+                                5778BD821DA4806C009E3009 /* SubtleCrypto.h in Headers */,
</ins><span class="cx">                                 84730D8B1248F0B300D3A9C9 /* FETile.h in Headers */,
</span><span class="cx">                                 84730D8D1248F0B300D3A9C9 /* FETurbulence.h in Headers */,
</span><span class="cx">                                 FD31609512B026F700C1A359 /* FFTConvolver.h in Headers */,
</span><span class="lines">@@ -25170,6 +25185,7 @@
</span><span class="cx">                                 E446143C0CD689CC00FADA75 /* JSHTMLSourceElement.h in Headers */,
</span><span class="cx">                                 9752D38E1413104B003305BD /* JSHTMLSpanElement.h in Headers */,
</span><span class="cx">                                 A80E7B0E0A19D606007FB8C5 /* JSHTMLStyleElement.h in Headers */,
</span><ins>+                                571F21891DA57C54005C9EFD /* JSSubtleCrypto.h in Headers */,
</ins><span class="cx">                                 BCA169A30BFD55B40019CA76 /* JSHTMLTableCaptionElement.h in Headers */,
</span><span class="cx">                                 BC06EDE40BFD6D0D00856E9D /* JSHTMLTableCellElement.h in Headers */,
</span><span class="cx">                                 BC06ED9E0BFD660600856E9D /* JSHTMLTableColElement.h in Headers */,
</span><span class="lines">@@ -27550,6 +27566,7 @@
</span><span class="cx">                         isa = PBXSourcesBuildPhase;
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><ins>+                                571F218B1DA57C7B005C9EFD /* JSSubtleCrypto.cpp in Sources */,
</ins><span class="cx">                                 41E1B1D00FF5986900576B3B /* AbstractWorker.cpp in Sources */,
</span><span class="cx">                                 37F57AB91A50726900876F98 /* AccessibilityARIAGrid.cpp in Sources */,
</span><span class="cx">                                 37F57ABA1A50726F00876F98 /* AccessibilityARIAGridCell.cpp in Sources */,
</span><span class="lines">@@ -30299,6 +30316,7 @@
</span><span class="cx">                                 442ABCD617D9262F00D30715 /* SynchronousLoaderClientCFNet.cpp in Sources */,
</span><span class="cx">                                 26FAE4CE1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.cpp in Sources */,
</span><span class="cx">                                 E45390AE0EAFF4B5003695C8 /* SystemMemoryIOS.cpp in Sources */,
</span><ins>+                                5778BD841DA4817B009E3009 /* SubtleCrypto.cpp in Sources */,
</ins><span class="cx">                                 CDA07FBD18E0A16A004699FA /* SystemSleepListener.cpp in Sources */,
</span><span class="cx">                                 CDA07FC118E0A22B004699FA /* SystemSleepListenerMac.mm in Sources */,
</span><span class="cx">                                 5D5975B419635F1100D00878 /* SystemVersion.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoCryptoKeyPairidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/CryptoKeyPair.idl (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/CryptoKeyPair.idl        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/crypto/CryptoKeyPair.idl        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> [
</span><span class="cx">     Conditional=SUBTLE_CRYPTO,
</span><span class="cx">     ImplementationLacksVTable,
</span><del>-    InterfaceName=KeyPair,
</del><span class="cx">     JSCustomMarkFunction,
</span><span class="cx">     NoInterfaceObject
</span><span class="cx"> ] interface CryptoKeyPair {
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoSubtleCryptocppfromrev206882trunkSourceWebCorecryptoCryptoKeyPairidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/SubtleCrypto.cpp (from rev 206882, trunk/Source/WebCore/crypto/CryptoKeyPair.idl) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/SubtleCrypto.cpp                                (rev 0)
+++ trunk/Source/WebCore/crypto/SubtleCrypto.cpp        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,40 @@
</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;SubtleCrypto.h&quot;
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+namespace WebCore {
+
+SubtleCrypto::SubtleCrypto(ScriptExecutionContext&amp; context)
+    : ContextDestructionObserver(&amp;context)
+{
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptoSubtleCryptohfromrev206882trunkSourceWebCorecryptoCryptoKeyPairidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/SubtleCrypto.h (from rev 206882, trunk/Source/WebCore/crypto/CryptoKeyPair.idl) (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/SubtleCrypto.h                                (rev 0)
+++ trunk/Source/WebCore/crypto/SubtleCrypto.h        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -0,0 +1,46 @@
</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;ContextDestructionObserver.h&quot;
+#include &lt;wtf/Ref.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+namespace WebCore {
+
+class SubtleCrypto : public ContextDestructionObserver, public RefCounted&lt;SubtleCrypto&gt; {
+public:
+    static Ref&lt;SubtleCrypto&gt; create(ScriptExecutionContext&amp; context) { return adoptRef(*new SubtleCrypto(context)); }
+
+private:
+    SubtleCrypto(ScriptExecutionContext&amp;);
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptoSubtleCryptoidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/crypto/SubtleCrypto.idl (0 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/SubtleCrypto.idl                                (rev 0)
+++ trunk/Source/WebCore/crypto/SubtleCrypto.idl        2016-10-06 21:32:02 UTC (rev 206883)
</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,
+    Exposed=(Window,Worker),
+    GenerateIsReachable=ImplScriptExecutionContext,
+    NoInterfaceObject,
+] interface SubtleCrypto {
+};
</ins></span></pre></div>
<a id="trunkSourceWebCorepageCryptocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Crypto.cpp (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Crypto.cpp        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/page/Crypto.cpp        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><ins>+#include &quot;SubtleCrypto.h&quot;
</ins><span class="cx"> #include &quot;WebKitSubtleCrypto.h&quot;
</span><span class="cx"> #include &lt;runtime/ArrayBufferView.h&gt;
</span><span class="cx"> #include &lt;wtf/CryptographicallyRandomNumber.h&gt;
</span><span class="lines">@@ -41,6 +42,9 @@
</span><span class="cx"> 
</span><span class="cx"> Crypto::Crypto(ScriptExecutionContext&amp; context)
</span><span class="cx">     : ContextDestructionObserver(&amp;context)
</span><ins>+#if ENABLE(SUBTLE_CRYPTO)
+    , m_subtle(SubtleCrypto::create(context))
+#endif
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -62,6 +66,11 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><ins>+SubtleCrypto&amp; Crypto::subtle()
+{
+    return m_subtle;
+}
+
</ins><span class="cx"> WebKitSubtleCrypto* Crypto::webkitSubtle(ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (!isMainThread()) {
</span></span></pre></div>
<a id="trunkSourceWebCorepageCryptoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Crypto.h (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Crypto.h        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/page/Crypto.h        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> 
</span><span class="cx"> class Document;
</span><span class="cx"> class WebKitSubtleCrypto;
</span><ins>+class SubtleCrypto;
</ins><span class="cx"> 
</span><span class="cx"> class Crypto : public ContextDestructionObserver, public RefCounted&lt;Crypto&gt; {
</span><span class="cx"> public:
</span><span class="lines">@@ -54,6 +55,9 @@
</span><span class="cx">     void getRandomValues(JSC::ArrayBufferView*, ExceptionCode&amp;);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><ins>+    SubtleCrypto&amp; subtle();
+
+    // Will be deprecated.
</ins><span class="cx">     WebKitSubtleCrypto* webkitSubtle(ExceptionCode&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -61,6 +65,9 @@
</span><span class="cx">     Crypto(ScriptExecutionContext&amp;);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><ins>+    Ref&lt;SubtleCrypto&gt; m_subtle;
+
+    // Will be deprecated.
</ins><span class="cx">     RefPtr&lt;WebKitSubtleCrypto&gt; m_webkitSubtle;
</span><span class="cx"> #endif
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorepageCryptoidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Crypto.idl (206882 => 206883)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Crypto.idl        2016-10-06 21:26:36 UTC (rev 206882)
+++ trunk/Source/WebCore/page/Crypto.idl        2016-10-06 21:32:02 UTC (rev 206883)
</span><span class="lines">@@ -31,7 +31,9 @@
</span><span class="cx">     Exposed=(Window,Worker),
</span><span class="cx">     GenerateIsReachable=ImplScriptExecutionContext,
</span><span class="cx"> ] interface Crypto {
</span><ins>+    [Conditional=SUBTLE_CRYPTO] readonly attribute SubtleCrypto subtle;
</ins><span class="cx">     [Custom, MayThrowLegacyException] ArrayBufferView getRandomValues(ArrayBufferView array);
</span><span class="cx"> 
</span><ins>+    // Will be deprecated.
</ins><span class="cx">     [Conditional=SUBTLE_CRYPTO, GetterMayThrowLegacyException] readonly attribute WebKitSubtleCrypto webkitSubtle;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>