| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ae61cd6 commit a835363
25 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,7 +34,7 @@ Last update: | |||
| 34 | 34 | - wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi | |
| 35 | 35 | - wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi | |
| 36 | 36 | - web-locks: https://github.com/web-platform-tests/wpt/tree/10a122a6bc/web-locks | |
| 37 | - - WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/2cb332d710/WebCryptoAPI | ||
| 37 | + - WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/97bbc7247a/WebCryptoAPI | ||
| 38 | 38 | - webidl: https://github.com/web-platform-tests/wpt/tree/63ca529a02/webidl | |
| 39 | 39 | - webidl/ecmascript-binding/es-exceptions: https://github.com/web-platform-tests/wpt/tree/2f96fa1996/webidl/ecmascript-binding/es-exceptions | |
| 40 | 40 | - webmessaging/broadcastchannel: https://github.com/web-platform-tests/wpt/tree/6495c91853/webmessaging/broadcastchannel | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,14 +3,14 @@ var subtle = crypto.subtle; | |||
| 3 | 3 | function runTests(algorithmName) { | |
| 4 | 4 | var algorithm = { name: algorithmName }; | |
| 5 | 5 | var data = keyData[algorithmName]; | |
| 6 | - // var jwkData = {jwk: {kty: data.jwk.kty, alg: data.jwk.alg, pub: data.jwk.pub}}; | ||
| 7 | - | ||
| 8 | - // TODO: add JWK when its definition is done in IETF JOSE WG | ||
| 6 | + var jwkData = { | ||
| 7 | + jwk: { kty: data.jwk.kty, alg: data.jwk.alg, pub: data.jwk.pub }, | ||
| 8 | + }; | ||
| 9 | 9 | ||
| 10 | 10 | [true, false].forEach(function (extractable) { | |
| 11 | 11 | // Test public keys first | |
| 12 | 12 | allValidUsages(data.publicUsages, true).forEach(function (usages) { | |
| 13 | - ['spki', /*'jwk',*/ 'raw-public'].forEach(function (format) { | ||
| 13 | + ['spki', 'jwk', 'raw-public'].forEach(function (format) { | ||
| 14 | 14 | if (format === 'jwk') { | |
| 15 | 15 | // Not all fields used for public keys | |
| 16 | 16 | testFormat( | |
@@ -36,7 +36,7 @@ function runTests(algorithmName) { | |||
| 36 | 36 | ||
| 37 | 37 | // Next, test private keys | |
| 38 | 38 | allValidUsages(data.privateUsages).forEach(function (usages) { | |
| 39 | - ['pkcs8', /*'jwk',*/ 'raw-seed'].forEach(function (format) { | ||
| 39 | + ['pkcs8', 'jwk', 'raw-seed'].forEach(function (format) { | ||
| 40 | 40 | testFormat(format, algorithm, data, algorithmName, usages, extractable); | |
| 41 | 41 | }); | |
| 42 | 42 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,11 @@ | |||
| 1 | + // META: title=WebCryptoAPI: CryptoKey serialization | ||
| 2 | + // META: script=../util/helpers.js | ||
| 3 | + // META: script=serialization.js | ||
| 4 | + run_test([ | ||
| 5 | + { | ||
| 6 | + name: 'AES-CBC', | ||
| 7 | + resultType: 'CryptoKey', | ||
| 8 | + usages: ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'], | ||
| 9 | + exportFormat: 'raw' | ||
| 10 | + }, | ||
| 11 | + ]); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,11 @@ | |||
| 1 | + // META: title=WebCryptoAPI: CryptoKey serialization | ||
| 2 | + // META: script=../util/helpers.js | ||
| 3 | + // META: script=serialization.js | ||
| 4 | + run_test([ | ||
| 5 | + { | ||
| 6 | + name: 'AES-CTR', | ||
| 7 | + resultType: 'CryptoKey', | ||
| 8 | + usages: ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'], | ||
| 9 | + exportFormat: 'raw' | ||
| 10 | + }, | ||
| 11 | + ]); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,11 @@ | |||
| 1 | + // META: title=WebCryptoAPI: CryptoKey serialization | ||
| 2 | + // META: script=../util/helpers.js | ||
| 3 | + // META: script=serialization.js | ||
| 4 | + run_test([ | ||
| 5 | + { | ||
| 6 | + name: 'AES-GCM', | ||
| 7 | + resultType: 'CryptoKey', | ||
| 8 | + usages: ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'], | ||
| 9 | + exportFormat: 'raw' | ||
| 10 | + }, | ||
| 11 | + ]); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,11 @@ | |||
| 1 | + // META: title=WebCryptoAPI: CryptoKey serialization | ||
| 2 | + // META: script=../util/helpers.js | ||
| 3 | + // META: script=serialization.js | ||
| 4 | + run_test([ | ||
| 5 | + { | ||
| 6 | + name: 'AES-KW', | ||
| 7 | + resultType: 'CryptoKey', | ||
| 8 | + usages: ['wrapKey', 'unwrapKey'], | ||
| 9 | + exportFormat: 'raw' | ||
| 10 | + }, | ||
| 11 | + ]); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,11 @@ | |||
| 1 | + // META: title=WebCryptoAPI: CryptoKey serialization | ||
| 2 | + // META: script=../util/helpers.js | ||
| 3 | + // META: script=serialization.js | ||
| 4 | + run_test([ | ||
| 5 | + { | ||
| 6 | + name: 'AES-OCB', | ||
| 7 | + resultType: 'CryptoKey', | ||
| 8 | + usages: ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'], | ||
| 9 | + exportFormat: 'raw-secret' | ||
| 10 | + }, | ||
| 11 | + ]); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,11 @@ | |||
| 1 | + // META: title=WebCryptoAPI: CryptoKey serialization | ||
| 2 | + // META: script=../util/helpers.js | ||
| 3 | + // META: script=serialization.js | ||
| 4 | + run_test([ | ||
| 5 | + { | ||
| 6 | + name: 'ChaCha20-Poly1305', | ||
| 7 | + resultType: 'CryptoKey', | ||
| 8 | + usages: ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'], | ||
| 9 | + exportFormat: 'raw-secret' | ||
| 10 | + }, | ||
| 11 | + ]); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,12 @@ | |||
| 1 | + // META: title=WebCryptoAPI: CryptoKey serialization | ||
| 2 | + // META: script=../util/helpers.js | ||
| 3 | + // META: script=serialization.js | ||
| 4 | + run_test([ | ||
| 5 | + { | ||
| 6 | + name: 'ECDH', | ||
| 7 | + resultType: 'CryptoKeyPair', | ||
| 8 | + usages: ['deriveKey', 'deriveBits'], | ||
| 9 | + publicFormat: 'raw', | ||
| 10 | + privateFormat: 'pkcs8' | ||
| 11 | + }, | ||
| 12 | + ]); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments