5 <title>WebCrypto Test Suite
</title>
6 <meta http-equiv=
"Content-Type" content=
"text/html;charset=utf-8" />
7 <link rel=
"stylesheet" href=
"./test_WebCrypto.css"/>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <!-- Utilities for manipulating ABVs -->
11 <script src=
"util.js"></script>
13 <!-- A simple wrapper around IndexedDB -->
14 <script src=
"simpledb.js"></script>
16 <!-- Test vectors drawn from the literature -->
17 <script src=
"./test-vectors.js"></script>
19 <!-- General testing framework -->
20 <script src=
"./test-array.js"></script>
22 <script>/* <![CDATA[*/
26 "Test that we properly normalize algorithm names",
29 var alg
= { name
: "hmac", hash
: {name
: "sHa-256"} };
31 function doGenerateAesKey() {
32 return crypto
.subtle
.generateKey({ name
: "AES-gcm", length
: 192 }, false, ["encrypt"]);
35 function doGenerateRsaOaepKey() {
40 publicExponent
: new Uint8Array([0x01, 0x00, 0x01]),
42 return crypto
.subtle
.generateKey(algo
, false, ["encrypt", "decrypt"]);
45 function doGenerateRsaSsaPkcs1Key() {
46 return crypto
.subtle
.importKey("pkcs8", tv
.pkcs8
, { name
: "RSASSA-pkcs1-V1_5", hash
: "SHA-1" }, true, ["sign"]);
49 crypto
.subtle
.generateKey(alg
, false, ["sign"])
50 .then(doGenerateAesKey
)
51 .then(doGenerateRsaOaepKey
)
52 .then(doGenerateRsaSsaPkcs1Key
)
53 .then(complete(that
), error(that
));
67 <div id=
"start" onclick=
"start();">RUN ALL
</div>
69 <div id=
"resultDiv" class=
"content">
71 <span class=
"pass"><span id=
"passN">0</span> passed,
</span>
72 <span class=
"fail"><span id=
"failN">0</span> failed,
</span>
73 <span class=
"pending"><span id=
"pendingN">0</span> pending.
</span>