LibWeb: Import WebCryptoAPI ECDH tests from WPT
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run

Import and rebaseline tests related to WebCryptoAPI ECDH. The commits
before this one allow for ~700 tests to pass.
This commit is contained in:
devgianlu 2024-11-26 20:35:39 +01:00 committed by Andreas Kling
parent 6fa53a4382
commit 601eae47f2
Notes: github-actions[bot] 2024-11-27 10:00:48 +00:00
17 changed files with 2123 additions and 53 deletions

View file

@ -1,13 +1,13 @@
Summary
Harness status: Error
Harness status: OK
Rerun
Found 18 tests
15 Pass
3 Fail
16 Pass
2 Fail
Details
Result Test Name MessagePass setup - define tests
Pass X448 key derivation checks for all-zero value result with a key of order 0
@ -21,7 +21,7 @@ Pass X448 short result
Fail X448 non-multiple of 8 bits
Pass X448 missing public property
Pass X448 public property of algorithm is not a CryptoKey
Fail X448 mismatched algorithms
Pass X448 mismatched algorithms
Pass X448 no deriveBits usage for base key
Pass X448 base key is not a private key
Pass X448 public property value is a private key

View file

@ -0,0 +1,51 @@
Summary
Harness status: OK
Rerun
Found 40 tests
23 Pass
17 Fail
Details
Result Test Name MessagePass setup - define tests
Fail P-521 good parameters
Fail P-521 mixed case parameters
Fail P-521 short result
Fail P-521 non-multiple of 8 bits
Pass P-521 missing public curve
Pass P-521 public property of algorithm is not a CryptoKey
Fail P-521 mismatched curves
Fail P-521 public property of algorithm is not an ECDSA public key Cannot access property "publicKey" on null object "ecdsaKeyPairs[namedCurve]"
Fail P-521 no deriveBits usage for base key
Fail P-521 base key is not a private key
Fail P-521 public property value is a private key
Fail P-521 public property value is a secret key
Fail P-521 asking for too many bits
Pass P-256 good parameters
Fail P-256 mixed case parameters
Pass P-256 short result
Fail P-256 non-multiple of 8 bits
Pass P-256 missing public curve
Pass P-256 public property of algorithm is not a CryptoKey
Pass P-256 mismatched curves
Pass P-256 public property of algorithm is not an ECDSA public key
Pass P-256 no deriveBits usage for base key
Pass P-256 base key is not a private key
Pass P-256 public property value is a private key
Pass P-256 public property value is a secret key
Fail P-256 asking for too many bits
Pass P-384 good parameters
Fail P-384 mixed case parameters
Pass P-384 short result
Fail P-384 non-multiple of 8 bits
Pass P-384 missing public curve
Pass P-384 public property of algorithm is not a CryptoKey
Pass P-384 mismatched curves
Pass P-384 public property of algorithm is not an ECDSA public key
Pass P-384 no deriveBits usage for base key
Pass P-384 base key is not a private key
Pass P-384 public property value is a private key
Pass P-384 public property value is a secret key
Fail P-384 asking for too many bits

View file

@ -0,0 +1,42 @@
Summary
Harness status: OK
Rerun
Found 31 tests
21 Pass
10 Fail
Details
Result Test Name MessagePass setup - define tests
Fail P-521 good parameters
Fail P-521 mixed case parameters
Pass P-521 missing public curve
Pass P-521 public property of algorithm is not a CryptoKey
Fail P-521 mismatched curves
Fail P-521 public property of algorithm is not an ECDSA public key Cannot access property "publicKey" on null object "ecdsaKeyPairs[namedCurve]"
Fail P-521 no deriveKey usage for base key
Fail P-521 base key is not a private key
Fail P-521 public property value is a private key
Fail P-521 public property value is a secret key
Pass P-256 good parameters
Fail P-256 mixed case parameters
Pass P-256 missing public curve
Pass P-256 public property of algorithm is not a CryptoKey
Pass P-256 mismatched curves
Pass P-256 public property of algorithm is not an ECDSA public key
Pass P-256 no deriveKey usage for base key
Pass P-256 base key is not a private key
Pass P-256 public property value is a private key
Pass P-256 public property value is a secret key
Pass P-384 good parameters
Fail P-384 mixed case parameters
Pass P-384 missing public curve
Pass P-384 public property of algorithm is not a CryptoKey
Pass P-384 mismatched curves
Pass P-384 public property of algorithm is not an ECDSA public key
Pass P-384 no deriveKey usage for base key
Pass P-384 base key is not a private key
Pass P-384 public property value is a private key
Pass P-384 public property value is a secret key

View file

@ -6,24 +6,25 @@ Rerun
Found 72 tests
72 Fail
48 Pass
24 Fail
Details
Result Test Name MessageFail Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveKey])
Fail Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey])
Fail Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey])
Fail Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey])
Fail Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveBits])
Fail Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits])
Fail Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveKey])
Fail Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey])
Fail Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey])
Fail Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey])
Fail Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveBits])
Fail Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits])
Fail Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Result Test Name MessagePass Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveKey])
Pass Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey])
Pass Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey])
Pass Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey])
Pass Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveBits])
Pass Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveBits])
Pass Success: generateKey({name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Pass Success: generateKey({name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Pass Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveKey])
Pass Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey])
Pass Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey])
Pass Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey])
Pass Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveBits])
Pass Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveBits])
Pass Success: generateKey({name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Pass Success: generateKey({name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveKey])
Fail Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey])
Fail Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])
@ -32,22 +33,22 @@ Fail Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveBits])
Fail Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveBits])
Fail Success: generateKey({name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveKey])
Fail Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveKey])
Fail Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveBits, deriveKey])
Fail Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveBits, deriveKey])
Fail Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveBits])
Fail Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveBits])
Fail Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveKey])
Fail Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveKey])
Fail Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveBits, deriveKey])
Fail Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveBits, deriveKey])
Fail Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveBits])
Fail Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveBits])
Fail Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Pass Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveKey])
Pass Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveKey])
Pass Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveBits, deriveKey])
Pass Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveBits, deriveKey])
Pass Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveBits])
Pass Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveBits])
Pass Success: generateKey({name: ecdh, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Pass Success: generateKey({name: ecdh, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Pass Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveKey])
Pass Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveKey])
Pass Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveBits, deriveKey])
Pass Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveBits, deriveKey])
Pass Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveBits])
Pass Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveBits])
Pass Success: generateKey({name: ecdh, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Pass Success: generateKey({name: ecdh, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveKey])
Fail Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveKey])
Fail Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveBits, deriveKey])
@ -56,22 +57,22 @@ Fail Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveBits])
Fail Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveBits])
Fail Success: generateKey({name: ecdh, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: ecdh, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveKey])
Fail Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveKey])
Fail Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveBits, deriveKey])
Fail Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveBits, deriveKey])
Fail Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveBits])
Fail Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveBits])
Fail Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveKey])
Fail Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveKey])
Fail Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveBits, deriveKey])
Fail Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveBits, deriveKey])
Fail Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveBits])
Fail Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveBits])
Fail Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Pass Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveKey])
Pass Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveKey])
Pass Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveBits, deriveKey])
Pass Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveBits, deriveKey])
Pass Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveBits])
Pass Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveBits])
Pass Success: generateKey({name: Ecdh, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Pass Success: generateKey({name: Ecdh, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Pass Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveKey])
Pass Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveKey])
Pass Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveBits, deriveKey])
Pass Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveBits, deriveKey])
Pass Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveBits])
Pass Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveBits])
Pass Success: generateKey({name: Ecdh, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Pass Success: generateKey({name: Ecdh, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits])
Fail Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveKey])
Fail Success: generateKey({name: Ecdh, namedCurve: P-521}, true, [deriveKey])
Fail Success: generateKey({name: Ecdh, namedCurve: P-521}, false, [deriveBits, deriveKey])

View file

@ -0,0 +1,258 @@
Summary
Harness status: OK
Rerun
Found 246 tests
90 Pass
144 Fail
12 Optional Feature Unsupported
Details
Result Test Name MessageFail Good parameters: P-256 bits (spki, buffer(91), {name: ECDSA, namedCurve: P-256}, true, [verify])
Fail Good parameters: P-256 bits (spki, buffer(59, compressed), {name: ECDSA, namedCurve: P-256}, true, [verify])
Fail Good parameters: P-256 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-256}, true, [verify])
Fail Good parameters: P-256 bits (raw, buffer(65), {name: ECDSA, namedCurve: P-256}, true, [verify])
Fail Good parameters: P-256 bits (raw, buffer(33, compressed), {name: ECDSA, namedCurve: P-256}, true, [verify])
Fail Good parameters: P-256 bits (spki, buffer(91), {name: ECDSA, namedCurve: P-256}, true, [])
Fail Good parameters: P-256 bits (spki, buffer(59, compressed), {name: ECDSA, namedCurve: P-256}, true, [])
Fail Good parameters: P-256 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-256}, true, [])
Fail Good parameters: P-256 bits (raw, buffer(65), {name: ECDSA, namedCurve: P-256}, true, [])
Fail Good parameters: P-256 bits (raw, buffer(33, compressed), {name: ECDSA, namedCurve: P-256}, true, [])
Fail Good parameters: P-256 bits (spki, buffer(91), {name: ECDSA, namedCurve: P-256}, true, [verify, verify])
Fail Good parameters: P-256 bits (spki, buffer(59, compressed), {name: ECDSA, namedCurve: P-256}, true, [verify, verify])
Fail Good parameters: P-256 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-256}, true, [verify, verify])
Fail Good parameters: P-256 bits (raw, buffer(65), {name: ECDSA, namedCurve: P-256}, true, [verify, verify])
Fail Good parameters: P-256 bits (raw, buffer(33, compressed), {name: ECDSA, namedCurve: P-256}, true, [verify, verify])
Fail Good parameters: P-256 bits (pkcs8, buffer(138), {name: ECDSA, namedCurve: P-256}, true, [sign])
Fail Good parameters: P-256 bits (pkcs8, buffer(138), {name: ECDSA, namedCurve: P-256}, true, [sign, sign])
Fail Empty Usages: P-256 bits (pkcs8, buffer(138), {name: ECDSA, namedCurve: P-256}, true, [])
Fail Good parameters: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-256}, true, [sign])
Fail Good parameters: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-256}, true, [sign, sign])
Fail Empty Usages: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-256}, true, [])
Fail Good parameters: P-256 bits (spki, buffer(91), {name: ECDSA, namedCurve: P-256}, false, [verify])
Fail Good parameters: P-256 bits (spki, buffer(59, compressed), {name: ECDSA, namedCurve: P-256}, false, [verify])
Fail Good parameters: P-256 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-256}, false, [verify])
Fail Good parameters: P-256 bits (raw, buffer(65), {name: ECDSA, namedCurve: P-256}, false, [verify])
Fail Good parameters: P-256 bits (raw, buffer(33, compressed), {name: ECDSA, namedCurve: P-256}, false, [verify])
Fail Good parameters: P-256 bits (spki, buffer(91), {name: ECDSA, namedCurve: P-256}, false, [])
Fail Good parameters: P-256 bits (spki, buffer(59, compressed), {name: ECDSA, namedCurve: P-256}, false, [])
Fail Good parameters: P-256 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-256}, false, [])
Fail Good parameters: P-256 bits (raw, buffer(65), {name: ECDSA, namedCurve: P-256}, false, [])
Fail Good parameters: P-256 bits (raw, buffer(33, compressed), {name: ECDSA, namedCurve: P-256}, false, [])
Fail Good parameters: P-256 bits (spki, buffer(91), {name: ECDSA, namedCurve: P-256}, false, [verify, verify])
Fail Good parameters: P-256 bits (spki, buffer(59, compressed), {name: ECDSA, namedCurve: P-256}, false, [verify, verify])
Fail Good parameters: P-256 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-256}, false, [verify, verify])
Fail Good parameters: P-256 bits (raw, buffer(65), {name: ECDSA, namedCurve: P-256}, false, [verify, verify])
Fail Good parameters: P-256 bits (raw, buffer(33, compressed), {name: ECDSA, namedCurve: P-256}, false, [verify, verify])
Fail Good parameters: P-256 bits (pkcs8, buffer(138), {name: ECDSA, namedCurve: P-256}, false, [sign])
Fail Good parameters: P-256 bits (pkcs8, buffer(138), {name: ECDSA, namedCurve: P-256}, false, [sign, sign])
Fail Empty Usages: P-256 bits (pkcs8, buffer(138), {name: ECDSA, namedCurve: P-256}, false, [])
Fail Good parameters: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-256}, false, [sign])
Fail Good parameters: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-256}, false, [sign, sign])
Fail Empty Usages: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-256}, false, [])
Fail Good parameters: P-384 bits (spki, buffer(120), {name: ECDSA, namedCurve: P-384}, true, [verify])
Fail Good parameters: P-384 bits (spki, buffer(72, compressed), {name: ECDSA, namedCurve: P-384}, true, [verify])
Fail Good parameters: P-384 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-384}, true, [verify])
Fail Good parameters: P-384 bits (raw, buffer(97), {name: ECDSA, namedCurve: P-384}, true, [verify])
Fail Good parameters: P-384 bits (raw, buffer(49, compressed), {name: ECDSA, namedCurve: P-384}, true, [verify])
Fail Good parameters: P-384 bits (spki, buffer(120), {name: ECDSA, namedCurve: P-384}, true, [])
Fail Good parameters: P-384 bits (spki, buffer(72, compressed), {name: ECDSA, namedCurve: P-384}, true, [])
Fail Good parameters: P-384 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-384}, true, [])
Fail Good parameters: P-384 bits (raw, buffer(97), {name: ECDSA, namedCurve: P-384}, true, [])
Fail Good parameters: P-384 bits (raw, buffer(49, compressed), {name: ECDSA, namedCurve: P-384}, true, [])
Fail Good parameters: P-384 bits (spki, buffer(120), {name: ECDSA, namedCurve: P-384}, true, [verify, verify])
Fail Good parameters: P-384 bits (spki, buffer(72, compressed), {name: ECDSA, namedCurve: P-384}, true, [verify, verify])
Fail Good parameters: P-384 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-384}, true, [verify, verify])
Fail Good parameters: P-384 bits (raw, buffer(97), {name: ECDSA, namedCurve: P-384}, true, [verify, verify])
Fail Good parameters: P-384 bits (raw, buffer(49, compressed), {name: ECDSA, namedCurve: P-384}, true, [verify, verify])
Fail Good parameters: P-384 bits (pkcs8, buffer(185), {name: ECDSA, namedCurve: P-384}, true, [sign])
Fail Good parameters: P-384 bits (pkcs8, buffer(185), {name: ECDSA, namedCurve: P-384}, true, [sign, sign])
Fail Empty Usages: P-384 bits (pkcs8, buffer(185), {name: ECDSA, namedCurve: P-384}, true, [])
Fail Good parameters: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-384}, true, [sign])
Fail Good parameters: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-384}, true, [sign, sign])
Fail Empty Usages: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-384}, true, [])
Fail Good parameters: P-384 bits (spki, buffer(120), {name: ECDSA, namedCurve: P-384}, false, [verify])
Fail Good parameters: P-384 bits (spki, buffer(72, compressed), {name: ECDSA, namedCurve: P-384}, false, [verify])
Fail Good parameters: P-384 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-384}, false, [verify])
Fail Good parameters: P-384 bits (raw, buffer(97), {name: ECDSA, namedCurve: P-384}, false, [verify])
Fail Good parameters: P-384 bits (raw, buffer(49, compressed), {name: ECDSA, namedCurve: P-384}, false, [verify])
Fail Good parameters: P-384 bits (spki, buffer(120), {name: ECDSA, namedCurve: P-384}, false, [])
Fail Good parameters: P-384 bits (spki, buffer(72, compressed), {name: ECDSA, namedCurve: P-384}, false, [])
Fail Good parameters: P-384 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-384}, false, [])
Fail Good parameters: P-384 bits (raw, buffer(97), {name: ECDSA, namedCurve: P-384}, false, [])
Fail Good parameters: P-384 bits (raw, buffer(49, compressed), {name: ECDSA, namedCurve: P-384}, false, [])
Fail Good parameters: P-384 bits (spki, buffer(120), {name: ECDSA, namedCurve: P-384}, false, [verify, verify])
Fail Good parameters: P-384 bits (spki, buffer(72, compressed), {name: ECDSA, namedCurve: P-384}, false, [verify, verify])
Fail Good parameters: P-384 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-384}, false, [verify, verify])
Fail Good parameters: P-384 bits (raw, buffer(97), {name: ECDSA, namedCurve: P-384}, false, [verify, verify])
Fail Good parameters: P-384 bits (raw, buffer(49, compressed), {name: ECDSA, namedCurve: P-384}, false, [verify, verify])
Fail Good parameters: P-384 bits (pkcs8, buffer(185), {name: ECDSA, namedCurve: P-384}, false, [sign])
Fail Good parameters: P-384 bits (pkcs8, buffer(185), {name: ECDSA, namedCurve: P-384}, false, [sign, sign])
Fail Empty Usages: P-384 bits (pkcs8, buffer(185), {name: ECDSA, namedCurve: P-384}, false, [])
Fail Good parameters: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-384}, false, [sign])
Fail Good parameters: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-384}, false, [sign, sign])
Fail Empty Usages: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-384}, false, [])
Fail Good parameters: P-521 bits (spki, buffer(158), {name: ECDSA, namedCurve: P-521}, true, [verify])
Fail Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDSA, namedCurve: P-521}, true, [verify])
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-521}, true, [verify])
Fail Good parameters: P-521 bits (raw, buffer(133), {name: ECDSA, namedCurve: P-521}, true, [verify])
Fail Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDSA, namedCurve: P-521}, true, [verify])
Fail Good parameters: P-521 bits (spki, buffer(158), {name: ECDSA, namedCurve: P-521}, true, [])
Fail Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDSA, namedCurve: P-521}, true, [])
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-521}, true, [])
Fail Good parameters: P-521 bits (raw, buffer(133), {name: ECDSA, namedCurve: P-521}, true, [])
Fail Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDSA, namedCurve: P-521}, true, [])
Fail Good parameters: P-521 bits (spki, buffer(158), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])
Fail Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])
Fail Good parameters: P-521 bits (raw, buffer(133), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])
Fail Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDSA, namedCurve: P-521}, true, [verify, verify])
Fail Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, true, [sign])
Fail Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, true, [sign, sign])
Fail Empty Usages: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, true, [])
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, true, [sign])
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, true, [sign, sign])
Fail Empty Usages: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, true, [])
Fail Good parameters: P-521 bits (spki, buffer(158), {name: ECDSA, namedCurve: P-521}, false, [verify])
Fail Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDSA, namedCurve: P-521}, false, [verify])
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-521}, false, [verify])
Fail Good parameters: P-521 bits (raw, buffer(133), {name: ECDSA, namedCurve: P-521}, false, [verify])
Fail Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDSA, namedCurve: P-521}, false, [verify])
Fail Good parameters: P-521 bits (spki, buffer(158), {name: ECDSA, namedCurve: P-521}, false, [])
Fail Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDSA, namedCurve: P-521}, false, [])
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-521}, false, [])
Fail Good parameters: P-521 bits (raw, buffer(133), {name: ECDSA, namedCurve: P-521}, false, [])
Fail Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDSA, namedCurve: P-521}, false, [])
Fail Good parameters: P-521 bits (spki, buffer(158), {name: ECDSA, namedCurve: P-521}, false, [verify, verify])
Fail Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDSA, namedCurve: P-521}, false, [verify, verify])
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDSA, namedCurve: P-521}, false, [verify, verify])
Fail Good parameters: P-521 bits (raw, buffer(133), {name: ECDSA, namedCurve: P-521}, false, [verify, verify])
Fail Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDSA, namedCurve: P-521}, false, [verify, verify])
Fail Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, false, [sign])
Fail Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, false, [sign, sign])
Fail Empty Usages: P-521 bits (pkcs8, buffer(241), {name: ECDSA, namedCurve: P-521}, false, [])
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, false, [sign])
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, false, [sign, sign])
Fail Empty Usages: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDSA, namedCurve: P-521}, false, [])
Pass Good parameters: P-256 bits (spki, buffer(91), {name: ECDH, namedCurve: P-256}, true, [])
Optional Feature Unsupported Good parameters: P-256 bits (spki, buffer(59, compressed), {name: ECDH, namedCurve: P-256}, true, []) Compressed point format not supported: DataError: Unsupported key format
Pass Good parameters: P-256 bits (jwk, object(kty, crv, x, y), {name: ECDH, namedCurve: P-256}, true, [])
Pass ECDH any JWK alg: P-256 bits (jwk, object(kty, crv, x, y, alg), {name: ECDH, namedCurve: P-256}, true, [])
Pass Good parameters: P-256 bits (raw, buffer(65), {name: ECDH, namedCurve: P-256}, true, [])
Optional Feature Unsupported Good parameters: P-256 bits (raw, buffer(33, compressed), {name: ECDH, namedCurve: P-256}, true, []) Compressed point format not supported: DataError: Invalid key size
Pass Good parameters: P-256 bits (pkcs8, buffer(138), {name: ECDH, namedCurve: P-256}, true, [deriveKey])
Pass Good parameters: P-256 bits (pkcs8, buffer(138), {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey])
Pass Good parameters: P-256 bits (pkcs8, buffer(138), {name: ECDH, namedCurve: P-256}, true, [deriveBits])
Pass Good parameters: P-256 bits (pkcs8, buffer(138), {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Empty Usages: P-256 bits (pkcs8, buffer(138), {name: ECDH, namedCurve: P-256}, true, [])
Pass Good parameters: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-256}, true, [deriveKey])
Pass ECDH any JWK alg: P-256 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-256}, true, [deriveKey])
Pass Good parameters: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey])
Pass ECDH any JWK alg: P-256 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey])
Pass Good parameters: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-256}, true, [deriveBits])
Pass ECDH any JWK alg: P-256 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-256}, true, [deriveBits])
Pass Good parameters: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass ECDH any JWK alg: P-256 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Empty Usages: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-256}, true, [])
Pass Good parameters: P-256 bits (spki, buffer(91), {name: ECDH, namedCurve: P-256}, false, [])
Optional Feature Unsupported Good parameters: P-256 bits (spki, buffer(59, compressed), {name: ECDH, namedCurve: P-256}, false, []) Compressed point format not supported: DataError: Unsupported key format
Pass Good parameters: P-256 bits (jwk, object(kty, crv, x, y), {name: ECDH, namedCurve: P-256}, false, [])
Pass ECDH any JWK alg: P-256 bits (jwk, object(kty, crv, x, y, alg), {name: ECDH, namedCurve: P-256}, false, [])
Pass Good parameters: P-256 bits (raw, buffer(65), {name: ECDH, namedCurve: P-256}, false, [])
Optional Feature Unsupported Good parameters: P-256 bits (raw, buffer(33, compressed), {name: ECDH, namedCurve: P-256}, false, []) Compressed point format not supported: DataError: Invalid key size
Pass Good parameters: P-256 bits (pkcs8, buffer(138), {name: ECDH, namedCurve: P-256}, false, [deriveKey])
Pass Good parameters: P-256 bits (pkcs8, buffer(138), {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey])
Pass Good parameters: P-256 bits (pkcs8, buffer(138), {name: ECDH, namedCurve: P-256}, false, [deriveBits])
Pass Good parameters: P-256 bits (pkcs8, buffer(138), {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Empty Usages: P-256 bits (pkcs8, buffer(138), {name: ECDH, namedCurve: P-256}, false, [])
Pass Good parameters: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-256}, false, [deriveKey])
Pass ECDH any JWK alg: P-256 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-256}, false, [deriveKey])
Pass Good parameters: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey])
Pass ECDH any JWK alg: P-256 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey])
Pass Good parameters: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-256}, false, [deriveBits])
Pass ECDH any JWK alg: P-256 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-256}, false, [deriveBits])
Pass Good parameters: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass ECDH any JWK alg: P-256 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Empty Usages: P-256 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-256}, false, [])
Pass Good parameters: P-384 bits (spki, buffer(120), {name: ECDH, namedCurve: P-384}, true, [])
Optional Feature Unsupported Good parameters: P-384 bits (spki, buffer(72, compressed), {name: ECDH, namedCurve: P-384}, true, []) Compressed point format not supported: DataError: Unsupported key format
Pass Good parameters: P-384 bits (jwk, object(kty, crv, x, y), {name: ECDH, namedCurve: P-384}, true, [])
Pass ECDH any JWK alg: P-384 bits (jwk, object(kty, crv, x, y, alg), {name: ECDH, namedCurve: P-384}, true, [])
Pass Good parameters: P-384 bits (raw, buffer(97), {name: ECDH, namedCurve: P-384}, true, [])
Optional Feature Unsupported Good parameters: P-384 bits (raw, buffer(49, compressed), {name: ECDH, namedCurve: P-384}, true, []) Compressed point format not supported: DataError: Invalid key size
Pass Good parameters: P-384 bits (pkcs8, buffer(185), {name: ECDH, namedCurve: P-384}, true, [deriveKey])
Pass Good parameters: P-384 bits (pkcs8, buffer(185), {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey])
Pass Good parameters: P-384 bits (pkcs8, buffer(185), {name: ECDH, namedCurve: P-384}, true, [deriveBits])
Pass Good parameters: P-384 bits (pkcs8, buffer(185), {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Empty Usages: P-384 bits (pkcs8, buffer(185), {name: ECDH, namedCurve: P-384}, true, [])
Pass Good parameters: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-384}, true, [deriveKey])
Pass ECDH any JWK alg: P-384 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-384}, true, [deriveKey])
Pass Good parameters: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey])
Pass ECDH any JWK alg: P-384 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey])
Pass Good parameters: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-384}, true, [deriveBits])
Pass ECDH any JWK alg: P-384 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-384}, true, [deriveBits])
Pass Good parameters: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass ECDH any JWK alg: P-384 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Empty Usages: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-384}, true, [])
Pass Good parameters: P-384 bits (spki, buffer(120), {name: ECDH, namedCurve: P-384}, false, [])
Optional Feature Unsupported Good parameters: P-384 bits (spki, buffer(72, compressed), {name: ECDH, namedCurve: P-384}, false, []) Compressed point format not supported: DataError: Unsupported key format
Pass Good parameters: P-384 bits (jwk, object(kty, crv, x, y), {name: ECDH, namedCurve: P-384}, false, [])
Pass ECDH any JWK alg: P-384 bits (jwk, object(kty, crv, x, y, alg), {name: ECDH, namedCurve: P-384}, false, [])
Pass Good parameters: P-384 bits (raw, buffer(97), {name: ECDH, namedCurve: P-384}, false, [])
Optional Feature Unsupported Good parameters: P-384 bits (raw, buffer(49, compressed), {name: ECDH, namedCurve: P-384}, false, []) Compressed point format not supported: DataError: Invalid key size
Pass Good parameters: P-384 bits (pkcs8, buffer(185), {name: ECDH, namedCurve: P-384}, false, [deriveKey])
Pass Good parameters: P-384 bits (pkcs8, buffer(185), {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey])
Pass Good parameters: P-384 bits (pkcs8, buffer(185), {name: ECDH, namedCurve: P-384}, false, [deriveBits])
Pass Good parameters: P-384 bits (pkcs8, buffer(185), {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Empty Usages: P-384 bits (pkcs8, buffer(185), {name: ECDH, namedCurve: P-384}, false, [])
Pass Good parameters: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-384}, false, [deriveKey])
Pass ECDH any JWK alg: P-384 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-384}, false, [deriveKey])
Pass Good parameters: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey])
Pass ECDH any JWK alg: P-384 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey])
Pass Good parameters: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-384}, false, [deriveBits])
Pass ECDH any JWK alg: P-384 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-384}, false, [deriveBits])
Pass Good parameters: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass ECDH any JWK alg: P-384 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Empty Usages: P-384 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-384}, false, [])
Fail Good parameters: P-521 bits (spki, buffer(158), {name: ECDH, namedCurve: P-521}, true, [])
Optional Feature Unsupported Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDH, namedCurve: P-521}, true, []) Compressed point format not supported: DataError: Error parsing subjectPublicKeyInfo: [ "SubjectPublicKeyInfo"sv, "AlgorithmIdentifier"sv ]: Unknown named curve [ 1, 3, 132, 0, 35, 0, 0 ]
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDH, namedCurve: P-521}, true, [])
Pass ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, alg), {name: ECDH, namedCurve: P-521}, true, [])
Fail Good parameters: P-521 bits (raw, buffer(133), {name: ECDH, namedCurve: P-521}, true, [])
Optional Feature Unsupported Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDH, namedCurve: P-521}, true, []) Compressed point format not supported: DataError: Invalid key size
Fail Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [deriveKey])
Fail Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey])
Fail Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [deriveBits])
Fail Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Fail Empty Usages: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, true, [])
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [deriveKey])
Pass ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, true, [deriveKey])
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey])
Pass ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey])
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [deriveBits])
Pass ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, true, [deriveBits])
Fail Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Empty Usages: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, true, [])
Fail Good parameters: P-521 bits (spki, buffer(158), {name: ECDH, namedCurve: P-521}, false, [])
Optional Feature Unsupported Good parameters: P-521 bits (spki, buffer(90, compressed), {name: ECDH, namedCurve: P-521}, false, []) Compressed point format not supported: DataError: Error parsing subjectPublicKeyInfo: [ "SubjectPublicKeyInfo"sv, "AlgorithmIdentifier"sv ]: Unknown named curve [ 1, 3, 132, 0, 35, 0, 0 ]
Pass Good parameters: P-521 bits (jwk, object(kty, crv, x, y), {name: ECDH, namedCurve: P-521}, false, [])
Pass ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, alg), {name: ECDH, namedCurve: P-521}, false, [])
Pass Good parameters: P-521 bits (raw, buffer(133), {name: ECDH, namedCurve: P-521}, false, [])
Optional Feature Unsupported Good parameters: P-521 bits (raw, buffer(67, compressed), {name: ECDH, namedCurve: P-521}, false, []) Compressed point format not supported: DataError: Invalid key size
Fail Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [deriveKey])
Fail Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])
Fail Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [deriveBits])
Fail Good parameters: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Fail Empty Usages: P-521 bits (pkcs8, buffer(241), {name: ECDH, namedCurve: P-521}, false, [])
Pass Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [deriveKey])
Pass ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, false, [deriveKey])
Pass Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])
Pass ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])
Pass Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [deriveBits])
Pass ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, false, [deriveBits])
Pass Good parameters: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass ECDH any JWK alg: P-521 bits (jwk, object(kty, crv, x, y, d, alg), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Empty Usages: P-521 bits (jwk, object(kty, crv, x, y, d), {name: ECDH, namedCurve: P-521}, false, [])

View file

@ -0,0 +1,619 @@
Summary
Harness status: OK
Rerun
Found 608 tests
606 Pass
2 Fail
Details
Result Test Name MessagePass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, true, [encrypt])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, false, [encrypt])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, true, [decrypt])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, false, [decrypt])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, true, [sign])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, false, [sign])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, true, [verify])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, false, [verify])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, true, [wrapKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, false, [wrapKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, true, [unwrapKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, false, [unwrapKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, true, [deriveKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, false, [deriveKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, true, [deriveBits])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-256}, false, [deriveBits])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, true, [encrypt])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, false, [encrypt])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, true, [decrypt])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, false, [decrypt])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, true, [sign])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, false, [sign])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, true, [verify])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, false, [verify])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, true, [wrapKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, false, [wrapKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, true, [unwrapKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, false, [unwrapKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, true, [deriveKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, false, [deriveKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, true, [deriveBits])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-256}, false, [deriveBits])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveKey, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveKey, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveBits, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveBits, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveKey, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveKey, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveBits, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveBits, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveKey, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveKey, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveBits, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveBits, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveKey, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveKey, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveBits, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveBits, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveKey, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveKey, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveBits, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveBits, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveKey, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveKey, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveBits, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveBits, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, true, [encrypt])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, false, [encrypt])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, true, [decrypt])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, false, [decrypt])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, true, [sign])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, false, [sign])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, true, [verify])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, false, [verify])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, true, [wrapKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, false, [wrapKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, true, [unwrapKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, false, [unwrapKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, true, [deriveKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, false, [deriveKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, true, [deriveBits])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-384}, false, [deriveBits])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, true, [encrypt])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, false, [encrypt])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, true, [decrypt])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, false, [decrypt])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, true, [sign])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, false, [sign])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, true, [verify])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, false, [verify])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, true, [wrapKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, false, [wrapKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, true, [unwrapKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, false, [unwrapKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, true, [deriveKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, false, [deriveKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, true, [deriveBits])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-384}, false, [deriveBits])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveKey, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveKey, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveBits, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveBits, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveKey, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveKey, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveBits, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveBits, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveKey, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveKey, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveBits, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveBits, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveKey, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveKey, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveBits, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveBits, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveKey, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveKey, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveBits, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveBits, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveKey, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveKey, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveBits, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveBits, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, true, [encrypt])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, false, [encrypt])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, true, [decrypt])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, false, [decrypt])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, true, [sign])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, false, [sign])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, true, [verify])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, false, [verify])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, true, [wrapKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, false, [wrapKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, true, [unwrapKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, false, [unwrapKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, true, [deriveKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, false, [deriveKey])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, true, [deriveBits])
Pass Bad usages: importKey(spki, {name: ECDH, namedCurve: P-521}, false, [deriveBits])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, true, [encrypt])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, false, [encrypt])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, true, [decrypt])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, false, [decrypt])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, true, [sign])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, false, [sign])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, true, [verify])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, false, [verify])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, true, [wrapKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, false, [wrapKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, true, [unwrapKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, false, [unwrapKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, true, [deriveKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, false, [deriveKey])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, true, [deriveBits])
Pass Bad usages: importKey(raw, {name: ECDH, namedCurve: P-521}, false, [deriveBits])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveKey, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveKey, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveBits, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveBits, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveKey, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveKey, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveBits, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveBits, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveKey, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveKey, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveBits, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveBits, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, sign])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveKey, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveKey, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveBits, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveBits, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, verify])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveKey, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveKey, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveBits, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveBits, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveKey, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveKey, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveBits, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveBits, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
Pass Bad usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, encrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, decrypt])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, sign])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, verify])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, wrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
Pass Bad usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey])
Pass Empty usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [])
Pass Empty usages: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [])
Pass Empty usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [])
Pass Empty usages: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [])
Pass Empty usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [])
Pass Empty usages: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [])
Pass Empty usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [])
Pass Empty usages: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [])
Fail Empty usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [])
Fail Empty usages: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [])
Pass Empty usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [])
Pass Empty usages: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [])
Pass Bad key length: importKey(spki, {name: ECDH, namedCurve: P-256}, true, [])
Pass Bad key length: importKey(spki, {name: ECDH, namedCurve: P-256}, false, [])
Pass Bad key length: importKey(raw, {name: ECDH, namedCurve: P-256}, true, [])
Pass Bad key length: importKey(raw, {name: ECDH, namedCurve: P-256}, false, [])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveKey])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveKey])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveBits])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveBits])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Bad key length: importKey(spki, {name: ECDH, namedCurve: P-384}, true, [])
Pass Bad key length: importKey(spki, {name: ECDH, namedCurve: P-384}, false, [])
Pass Bad key length: importKey(raw, {name: ECDH, namedCurve: P-384}, true, [])
Pass Bad key length: importKey(raw, {name: ECDH, namedCurve: P-384}, false, [])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveKey])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveKey])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveBits])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveBits])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Bad key length: importKey(spki, {name: ECDH, namedCurve: P-521}, true, [])
Pass Bad key length: importKey(spki, {name: ECDH, namedCurve: P-521}, false, [])
Pass Bad key length: importKey(raw, {name: ECDH, namedCurve: P-521}, true, [])
Pass Bad key length: importKey(raw, {name: ECDH, namedCurve: P-521}, false, [])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveKey])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveKey])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveBits])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveBits])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Bad key length: importKey(pkcs8, {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Bad key length: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits, deriveKey])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits, deriveKey])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveBits])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveBits])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-256}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits, deriveKey])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits, deriveKey])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveBits])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveBits])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-384}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'x' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'kty' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits, deriveKey])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits, deriveKey])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveBits])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveBits])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, true, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing JWK 'crv' parameter: importKey(jwk(private), {name: ECDH, namedCurve: P-521}, false, [deriveKey, deriveBits, deriveKey, deriveBits])
Pass Missing algorithm name: importKey(pkcs8, {}, true, deriveKey)
Pass Missing algorithm name: importKey(pkcs8, {}, false, deriveKey)
Pass Missing algorithm name: importKey(pkcs8, {}, true, deriveBits)
Pass Missing algorithm name: importKey(pkcs8, {}, false, deriveBits)
Pass Missing algorithm name: importKey(jwk(private), {}, true, deriveKey)
Pass Missing algorithm name: importKey(jwk(private), {}, false, deriveKey)
Pass Missing algorithm name: importKey(jwk(private), {}, true, deriveBits)
Pass Missing algorithm name: importKey(jwk(private), {}, false, deriveBits)

View file

@ -0,0 +1,15 @@
<!doctype html>
<meta charset=utf-8>
<title>WebCryptoAPI: deriveBits() Using ECDH</title>
<script>
self.GLOBAL = {
isWindow: function() { return true; },
isWorker: function() { return false; },
isShadowRealm: function() { return false; },
};
</script>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="ecdh_bits.js"></script>
<div id=log></div>
<script src="../../WebCryptoAPI/derive_bits_keys/ecdh_bits.https.any.js"></script>

View file

@ -0,0 +1,9 @@
// META: title=WebCryptoAPI: deriveBits() Using ECDH
// META: script=ecdh_bits.js
// Define subtests from a `promise_test` to ensure the harness does not
// complete before the subtests are available. `explicit_done` cannot be used
// for this purpose because the global `done` function is automatically invoked
// by the WPT infrastructure in dedicated worker tests defined using the
// "multi-global" pattern.
promise_test(define_tests, 'setup - define tests');

View file

@ -0,0 +1,266 @@
function define_tests() {
// May want to test prefixed implementations.
var subtle = self.crypto.subtle;
var pkcs8 = {
"P-521": new Uint8Array([48, 129, 238, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 35, 4, 129, 214, 48, 129, 211, 2, 1, 1, 4, 66, 1, 166, 126, 211, 33, 145, 90, 100, 170, 53, 155, 125, 100, 141, 220, 38, 24, 250, 142, 141, 24, 103, 232, 247, 24, 48, 177, 13, 37, 237, 40, 145, 250, 241, 47, 60, 126, 117, 66, 26, 46, 162, 100, 249, 169, 21, 50, 13, 39, 79, 225, 71, 7, 66, 185, 132, 233, 107, 152, 145, 32, 129, 250, 205, 71, 141, 161, 129, 137, 3, 129, 134, 0, 4, 0, 32, 157, 72, 63, 40, 102, 104, 129, 198, 100, 31, 58, 18, 111, 64, 15, 81, 228, 101, 17, 112, 254, 103, 140, 117, 232, 87, 18, 226, 134, 138, 220, 133, 8, 36, 153, 123, 235, 240, 188, 130, 180, 48, 40, 166, 210, 236, 23, 119, 202, 69, 39, 159, 114, 6, 163, 234, 139, 92, 210, 7, 63, 73, 62, 69, 0, 12, 181, 76, 58, 90, 202, 162, 104, 197, 103, 16, 66, 136, 120, 217, 139, 138, 251, 246, 138, 97, 33, 83, 99, 40, 70, 216, 7, 233, 38, 114, 105, 143, 27, 156, 97, 29, 231, 211, 142, 52, 205, 108, 115, 136, 144, 146, 197, 110, 82, 214, 128, 241, 223, 208, 146, 184, 122, 200, 239, 159, 243, 200, 251, 72]),
"P-256": new Uint8Array([48, 129, 135, 2, 1, 0, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 4, 109, 48, 107, 2, 1, 1, 4, 32, 15, 247, 79, 232, 241, 202, 175, 97, 92, 206, 241, 29, 217, 53, 114, 87, 98, 217, 216, 65, 236, 186, 185, 94, 170, 38, 68, 123, 52, 100, 245, 113, 161, 68, 3, 66, 0, 4, 140, 96, 11, 44, 102, 25, 45, 97, 158, 39, 210, 37, 107, 59, 151, 118, 178, 141, 30, 5, 246, 13, 234, 189, 98, 174, 123, 154, 211, 157, 224, 217, 59, 4, 102, 109, 199, 119, 14, 126, 207, 13, 211, 203, 203, 211, 110, 221, 107, 94, 220, 153, 81, 7, 55, 161, 237, 104, 46, 205, 112, 244, 10, 47]),
"P-384": new Uint8Array([48, 129, 182, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 4, 129, 158, 48, 129, 155, 2, 1, 1, 4, 48, 248, 113, 165, 102, 101, 137, 193, 74, 87, 71, 38, 62, 248, 91, 49, 156, 192, 35, 219, 110, 53, 103, 108, 61, 120, 30, 239, 139, 5, 95, 207, 190, 134, 250, 13, 6, 208, 86, 181, 25, 95, 177, 50, 58, 248, 222, 37, 179, 161, 100, 3, 98, 0, 4, 241, 25, 101, 223, 125, 212, 89, 77, 4, 25, 197, 8, 100, 130, 163, 184, 38, 185, 121, 127, 155, 224, 189, 13, 16, 156, 158, 30, 153, 137, 193, 185, 169, 43, 143, 38, 159, 152, 225, 122, 209, 132, 186, 115, 193, 247, 151, 98, 175, 69, 175, 129, 65, 96, 38, 66, 218, 39, 26, 107, 176, 255, 235, 12, 180, 71, 143, 207, 112, 126, 102, 26, 166, 214, 205, 245, 21, 73, 200, 140, 63, 19, 11, 233, 232, 32, 31, 111, 106, 9, 244, 24, 90, 175, 149, 196])
};
var spki = {
"P-521": new Uint8Array([48, 129, 155, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 35, 3, 129, 134, 0, 4, 0, 238, 105, 249, 71, 21, 215, 1, 233, 226, 1, 19, 51, 212, 244, 249, 108, 186, 125, 145, 248, 139, 17, 43, 175, 117, 207, 9, 204, 31, 138, 202, 151, 97, 141, 169, 56, 152, 34, 210, 155, 111, 233, 153, 106, 97, 32, 62, 247, 82, 183, 113, 232, 149, 143, 196, 103, 123, 179, 119, 133, 101, 171, 96, 214, 237, 0, 222, 171, 103, 97, 137, 91, 147, 94, 58, 211, 37, 251, 133, 73, 229, 111, 19, 120, 106, 167, 63, 136, 162, 236, 254, 64, 147, 52, 115, 216, 174, 242, 64, 196, 223, 215, 213, 6, 242, 44, 221, 14, 85, 85, 143, 63, 191, 5, 235, 247, 239, 239, 122, 114, 215, 143, 70, 70, 155, 132, 72, 242, 110, 39, 18]),
"P-256": new Uint8Array([48, 89, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 3, 66, 0, 4, 154, 116, 32, 120, 126, 95, 77, 105, 211, 232, 34, 114, 115, 1, 109, 56, 224, 71, 129, 133, 223, 127, 238, 156, 142, 103, 60, 202, 211, 79, 126, 128, 254, 49, 141, 182, 221, 107, 119, 218, 99, 32, 165, 246, 151, 89, 9, 68, 23, 177, 52, 239, 138, 139, 116, 193, 101, 4, 57, 198, 115, 0, 90, 61]),
"P-384": new Uint8Array([48, 118, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 3, 98, 0, 4, 145, 130, 45, 194, 175, 89, 193, 143, 91, 103, 248, 13, 246, 26, 38, 3, 194, 168, 240, 179, 192, 175, 130, 45, 99, 194, 121, 112, 26, 130, 69, 96, 64, 68, 1, 221, 233, 165, 110, 229, 39, 87, 234, 139, 199, 72, 212, 200, 43, 83, 55, 180, 141, 123, 101, 88, 58, 61, 87, 36, 56, 136, 0, 54, 186, 198, 115, 15, 66, 202, 82, 120, 150, 107, 213, 242, 30, 134, 226, 29, 48, 197, 166, 208, 70, 62, 197, 19, 221, 80, 159, 252, 220, 175, 31, 245])
};
var sizes = {
"P-521": 66,
"P-256": 32,
"P-384": 48
};
var derivations = {
"P-521": new Uint8Array([0, 156, 43, 206, 87, 190, 128, 173, 171, 59, 7, 56, 91, 142, 89, 144, 235, 125, 111, 222, 189, 176, 27, 243, 83, 113, 164, 246, 7, 94, 157, 40, 138, 193, 42, 109, 254, 3, 170, 87, 67, 188, 129, 112, 157, 73, 168, 34, 148, 2, 25, 182, 75, 118, 138, 205, 82, 15, 161, 54, 142, 160, 175, 141, 71, 93]),
"P-256": new Uint8Array([14, 143, 60, 77, 177, 178, 162, 131, 115, 90, 0, 220, 87, 31, 26, 232, 151, 28, 227, 35, 250, 17, 131, 137, 203, 95, 65, 196, 59, 61, 181, 161]),
"P-384": new Uint8Array([224, 189, 107, 206, 10, 239, 140, 164, 136, 56, 166, 226, 252, 197, 126, 103, 185, 197, 232, 134, 12, 95, 11, 233, 218, 190, 197, 62, 69, 78, 24, 160, 161, 116, 196, 136, 136, 162, 100, 136, 17, 91, 45, 201, 241, 223, 165, 45])
};
return importKeys(pkcs8, spki, sizes)
.then(function(results) {
publicKeys = results.publicKeys;
privateKeys = results.privateKeys;
ecdsaKeyPairs = results.ecdsaKeyPairs;
noDeriveBitsKeys = results.noDeriveBitsKeys;
Object.keys(sizes).forEach(function(namedCurve) {
// Basic success case
promise_test(function(test) {
return subtle.deriveBits({name: "ECDH", public: publicKeys[namedCurve]}, privateKeys[namedCurve], 8 * sizes[namedCurve])
.then(function(derivation) {
assert_true(equalBuffers(derivation, derivations[namedCurve]), "Derived correct bits");
}, function(err) {
assert_unreached("deriveBits failed with error " + err.name + ": " + err.message);
});
}, namedCurve + " good parameters");
// Case insensitivity check
promise_test(function(test) {
return subtle.deriveBits({name: "EcDh", public: publicKeys[namedCurve]}, privateKeys[namedCurve], 8 * sizes[namedCurve])
.then(function(derivation) {
assert_true(equalBuffers(derivation, derivations[namedCurve]), "Derived correct bits");
}, function(err) {
assert_unreached("deriveBits failed with error " + err.name + ": " + err.message);
});
}, namedCurve + " mixed case parameters");
// Shorter than entire derivation per algorithm
promise_test(function(test) {
return subtle.deriveBits({name: "ECDH", public: publicKeys[namedCurve]}, privateKeys[namedCurve], 8 * sizes[namedCurve] - 32)
.then(function(derivation) {
assert_true(equalBuffers(derivation, derivations[namedCurve], 8 * sizes[namedCurve] - 32), "Derived correct bits");
}, function(err) {
assert_unreached("deriveBits failed with error " + err.name + ": " + err.message);
});
}, namedCurve + " short result");
// Non-multiple of 8
promise_test(function(test) {
return subtle.deriveBits({name: "ECDH", public: publicKeys[namedCurve]}, privateKeys[namedCurve], 8 * sizes[namedCurve] - 11)
.then(function(derivation) {
assert_true(equalBuffers(derivation, derivations[namedCurve], 8 * sizes[namedCurve] - 11), "Derived correct bits");
}, function(err) {
assert_unreached("deriveBits failed with error " + err.name + ": " + err.message);
});
}, namedCurve + " non-multiple of 8 bits");
// Errors to test:
// - missing public property TypeError
promise_test(function(test) {
return subtle.deriveBits({name: "ECDH"}, privateKeys[namedCurve], 8 * sizes[namedCurve])
.then(function(derivation) {
assert_unreached("deriveBits succeeded but should have failed with TypeError");
}, function(err) {
assert_equals(err.name, "TypeError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " missing public curve");
// - Non CryptoKey public property TypeError
promise_test(function(test) {
return subtle.deriveBits({name: "ECDH", public: {message: "Not a CryptoKey"}}, privateKeys[namedCurve], 8 * sizes[namedCurve])
.then(function(derivation) {
assert_unreached("deriveBits succeeded but should have failed with TypeError");
}, function(err) {
assert_equals(err.name, "TypeError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " public property of algorithm is not a CryptoKey");
// - wrong named curve
promise_test(function(test) {
publicKey = publicKeys["P-256"];
if (namedCurve === "P-256") {
publicKey = publicKeys["P-384"];
}
return subtle.deriveBits({name: "ECDH", public: publicKey}, privateKeys[namedCurve], 8 * sizes[namedCurve])
.then(function(derivation) {
assert_unreached("deriveBits succeeded but should have failed with InvalidAccessError");
}, function(err) {
assert_equals(err.name, "InvalidAccessError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " mismatched curves");
// - not ECDH public property InvalidAccessError
promise_test(function(test) {
return subtle.deriveBits({name: "ECDH", public: ecdsaKeyPairs[namedCurve].publicKey}, privateKeys[namedCurve], 8 * sizes[namedCurve])
.then(function(derivation) {
assert_unreached("deriveBits succeeded but should have failed with InvalidAccessError");
}, function(err) {
assert_equals(err.name, "InvalidAccessError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " public property of algorithm is not an ECDSA public key");
// - No deriveBits usage in baseKey InvalidAccessError
promise_test(function(test) {
return subtle.deriveBits({name: "ECDH", public: publicKeys[namedCurve]}, noDeriveBitsKeys[namedCurve], 8 * sizes[namedCurve])
.then(function(derivation) {
assert_unreached("deriveBits succeeded but should have failed with InvalidAccessError");
}, function(err) {
assert_equals(err.name, "InvalidAccessError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " no deriveBits usage for base key");
// - Use public key for baseKey InvalidAccessError
promise_test(function(test) {
return subtle.deriveBits({name: "ECDH", public: publicKeys[namedCurve]}, publicKeys[namedCurve], 8 * sizes[namedCurve])
.then(function(derivation) {
assert_unreached("deriveBits succeeded but should have failed with InvalidAccessError");
}, function(err) {
assert_equals(err.name, "InvalidAccessError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " base key is not a private key");
// - Use private key for public property InvalidAccessError
promise_test(function(test) {
return subtle.deriveBits({name: "ECDH", public: privateKeys[namedCurve]}, privateKeys[namedCurve], 8 * sizes[namedCurve])
.then(function(derivation) {
assert_unreached("deriveBits succeeded but should have failed with InvalidAccessError");
}, function(err) {
assert_equals(err.name, "InvalidAccessError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " public property value is a private key");
// - Use secret key for public property InvalidAccessError
promise_test(function(test) {
return subtle.generateKey({name: "AES-CBC", length: 128}, true, ["encrypt", "decrypt"])
.then(function(secretKey) {
return subtle.deriveBits({name: "ECDH", public: secretKey}, privateKeys[namedCurve], 8 * sizes[namedCurve])
.then(function(derivation) {
assert_unreached("deriveBits succeeded but should have failed with InvalidAccessError");
}, function(err) {
assert_equals(err.name, "InvalidAccessError", "Should throw correct error, not " + err.name + ": " + err.message);
});
});
}, namedCurve + " public property value is a secret key");
// - Length greater than 256, 384, 521 for particular curves OperationError
promise_test(function(test) {
return subtle.deriveBits({name: "ECDH", public: publicKeys[namedCurve]}, privateKeys[namedCurve], 8 * sizes[namedCurve] + 8)
.then(function(derivation) {
assert_unreached("deriveBits succeeded but should have failed with OperationError");
}, function(err) {
assert_equals(err.name, "OperationError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " asking for too many bits");
});
});
function importKeys(pkcs8, spki, sizes) {
var privateKeys = {};
var publicKeys = {};
var ecdsaKeyPairs = {};
var noDeriveBitsKeys = {};
var promises = [];
Object.keys(pkcs8).forEach(function(namedCurve) {
var operation = subtle.importKey("pkcs8", pkcs8[namedCurve],
{name: "ECDH", namedCurve: namedCurve},
false, ["deriveBits", "deriveKey"])
.then(function(key) {
privateKeys[namedCurve] = key;
}, function (err) {
privateKeys[namedCurve] = null;
});
promises.push(operation);
});
Object.keys(pkcs8).forEach(function(namedCurve) {
var operation = subtle.importKey("pkcs8", pkcs8[namedCurve],
{name: "ECDH", namedCurve: namedCurve},
false, ["deriveKey"])
.then(function(key) {
noDeriveBitsKeys[namedCurve] = key;
}, function (err) {
noDeriveBitsKeys[namedCurve] = null;
});
promises.push(operation);
});
Object.keys(spki).forEach(function(namedCurve) {
var operation = subtle.importKey("spki", spki[namedCurve],
{name: "ECDH", namedCurve: namedCurve},
false, [])
.then(function(key) {
publicKeys[namedCurve] = key;
}, function (err) {
publicKeys[namedCurve] = null;
});
promises.push(operation);
});
Object.keys(sizes).forEach(function(namedCurve) {
var operation = subtle.generateKey({name: "ECDSA", namedCurve: namedCurve}, false, ["sign", "verify"])
.then(function(keyPair) {
ecdsaKeyPairs[namedCurve] = keyPair;
}, function (err) {
ecdsaKeyPairs[namedCurve] = null;
});
promises.push(operation);
});
return Promise.all(promises)
.then(function(results) {return {privateKeys: privateKeys, publicKeys: publicKeys, ecdsaKeyPairs: ecdsaKeyPairs, noDeriveBitsKeys: noDeriveBitsKeys}});
}
// Compares two ArrayBuffer or ArrayBufferView objects. If bitCount is
// omitted, the two values must be the same length and have the same contents
// in every byte. If bitCount is included, only that leading number of bits
// have to match.
function equalBuffers(a, b, bitCount) {
var remainder;
if (typeof bitCount === "undefined" && a.byteLength !== b.byteLength) {
return false;
}
var aBytes = new Uint8Array(a);
var bBytes = new Uint8Array(b);
var length = a.byteLength;
if (typeof bitCount !== "undefined") {
length = Math.floor(bitCount / 8);
}
for (var i=0; i<length; i++) {
if (aBytes[i] !== bBytes[i]) {
return false;
}
}
if (typeof bitCount !== "undefined") {
remainder = bitCount % 8;
return aBytes[length] >> (8 - remainder) === bBytes[length] >> (8 - remainder);
}
return true;
}
}

View file

@ -0,0 +1,15 @@
<!doctype html>
<meta charset=utf-8>
<title>WebCryptoAPI: deriveKey() Using ECDH</title>
<script>
self.GLOBAL = {
isWindow: function() { return true; },
isWorker: function() { return false; },
isShadowRealm: function() { return false; },
};
</script>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="ecdh_keys.js"></script>
<div id=log></div>
<script src="../../WebCryptoAPI/derive_bits_keys/ecdh_keys.https.any.js"></script>

View file

@ -0,0 +1,9 @@
// META: title=WebCryptoAPI: deriveKey() Using ECDH
// META: script=ecdh_keys.js
// Define subtests from a `promise_test` to ensure the harness does not
// complete before the subtests are available. `explicit_done` cannot be used
// for this purpose because the global `done` function is automatically invoked
// by the WPT infrastructure in dedicated worker tests defined using the
// "multi-global" pattern.
promise_test(define_tests, 'setup - define tests');

View file

@ -0,0 +1,245 @@
function define_tests() {
// May want to test prefixed implementations.
var subtle = self.crypto.subtle;
var pkcs8 = {
"P-521": new Uint8Array([48, 129, 238, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 35, 4, 129, 214, 48, 129, 211, 2, 1, 1, 4, 66, 1, 166, 126, 211, 33, 145, 90, 100, 170, 53, 155, 125, 100, 141, 220, 38, 24, 250, 142, 141, 24, 103, 232, 247, 24, 48, 177, 13, 37, 237, 40, 145, 250, 241, 47, 60, 126, 117, 66, 26, 46, 162, 100, 249, 169, 21, 50, 13, 39, 79, 225, 71, 7, 66, 185, 132, 233, 107, 152, 145, 32, 129, 250, 205, 71, 141, 161, 129, 137, 3, 129, 134, 0, 4, 0, 32, 157, 72, 63, 40, 102, 104, 129, 198, 100, 31, 58, 18, 111, 64, 15, 81, 228, 101, 17, 112, 254, 103, 140, 117, 232, 87, 18, 226, 134, 138, 220, 133, 8, 36, 153, 123, 235, 240, 188, 130, 180, 48, 40, 166, 210, 236, 23, 119, 202, 69, 39, 159, 114, 6, 163, 234, 139, 92, 210, 7, 63, 73, 62, 69, 0, 12, 181, 76, 58, 90, 202, 162, 104, 197, 103, 16, 66, 136, 120, 217, 139, 138, 251, 246, 138, 97, 33, 83, 99, 40, 70, 216, 7, 233, 38, 114, 105, 143, 27, 156, 97, 29, 231, 211, 142, 52, 205, 108, 115, 136, 144, 146, 197, 110, 82, 214, 128, 241, 223, 208, 146, 184, 122, 200, 239, 159, 243, 200, 251, 72]),
"P-256": new Uint8Array([48, 129, 135, 2, 1, 0, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 4, 109, 48, 107, 2, 1, 1, 4, 32, 15, 247, 79, 232, 241, 202, 175, 97, 92, 206, 241, 29, 217, 53, 114, 87, 98, 217, 216, 65, 236, 186, 185, 94, 170, 38, 68, 123, 52, 100, 245, 113, 161, 68, 3, 66, 0, 4, 140, 96, 11, 44, 102, 25, 45, 97, 158, 39, 210, 37, 107, 59, 151, 118, 178, 141, 30, 5, 246, 13, 234, 189, 98, 174, 123, 154, 211, 157, 224, 217, 59, 4, 102, 109, 199, 119, 14, 126, 207, 13, 211, 203, 203, 211, 110, 221, 107, 94, 220, 153, 81, 7, 55, 161, 237, 104, 46, 205, 112, 244, 10, 47]),
"P-384": new Uint8Array([48, 129, 182, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 4, 129, 158, 48, 129, 155, 2, 1, 1, 4, 48, 248, 113, 165, 102, 101, 137, 193, 74, 87, 71, 38, 62, 248, 91, 49, 156, 192, 35, 219, 110, 53, 103, 108, 61, 120, 30, 239, 139, 5, 95, 207, 190, 134, 250, 13, 6, 208, 86, 181, 25, 95, 177, 50, 58, 248, 222, 37, 179, 161, 100, 3, 98, 0, 4, 241, 25, 101, 223, 125, 212, 89, 77, 4, 25, 197, 8, 100, 130, 163, 184, 38, 185, 121, 127, 155, 224, 189, 13, 16, 156, 158, 30, 153, 137, 193, 185, 169, 43, 143, 38, 159, 152, 225, 122, 209, 132, 186, 115, 193, 247, 151, 98, 175, 69, 175, 129, 65, 96, 38, 66, 218, 39, 26, 107, 176, 255, 235, 12, 180, 71, 143, 207, 112, 126, 102, 26, 166, 214, 205, 245, 21, 73, 200, 140, 63, 19, 11, 233, 232, 32, 31, 111, 106, 9, 244, 24, 90, 175, 149, 196])
};
var spki = {
"P-521": new Uint8Array([48, 129, 155, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 35, 3, 129, 134, 0, 4, 0, 238, 105, 249, 71, 21, 215, 1, 233, 226, 1, 19, 51, 212, 244, 249, 108, 186, 125, 145, 248, 139, 17, 43, 175, 117, 207, 9, 204, 31, 138, 202, 151, 97, 141, 169, 56, 152, 34, 210, 155, 111, 233, 153, 106, 97, 32, 62, 247, 82, 183, 113, 232, 149, 143, 196, 103, 123, 179, 119, 133, 101, 171, 96, 214, 237, 0, 222, 171, 103, 97, 137, 91, 147, 94, 58, 211, 37, 251, 133, 73, 229, 111, 19, 120, 106, 167, 63, 136, 162, 236, 254, 64, 147, 52, 115, 216, 174, 242, 64, 196, 223, 215, 213, 6, 242, 44, 221, 14, 85, 85, 143, 63, 191, 5, 235, 247, 239, 239, 122, 114, 215, 143, 70, 70, 155, 132, 72, 242, 110, 39, 18]),
"P-256": new Uint8Array([48, 89, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 3, 66, 0, 4, 154, 116, 32, 120, 126, 95, 77, 105, 211, 232, 34, 114, 115, 1, 109, 56, 224, 71, 129, 133, 223, 127, 238, 156, 142, 103, 60, 202, 211, 79, 126, 128, 254, 49, 141, 182, 221, 107, 119, 218, 99, 32, 165, 246, 151, 89, 9, 68, 23, 177, 52, 239, 138, 139, 116, 193, 101, 4, 57, 198, 115, 0, 90, 61]),
"P-384": new Uint8Array([48, 118, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 3, 98, 0, 4, 145, 130, 45, 194, 175, 89, 193, 143, 91, 103, 248, 13, 246, 26, 38, 3, 194, 168, 240, 179, 192, 175, 130, 45, 99, 194, 121, 112, 26, 130, 69, 96, 64, 68, 1, 221, 233, 165, 110, 229, 39, 87, 234, 139, 199, 72, 212, 200, 43, 83, 55, 180, 141, 123, 101, 88, 58, 61, 87, 36, 56, 136, 0, 54, 186, 198, 115, 15, 66, 202, 82, 120, 150, 107, 213, 242, 30, 134, 226, 29, 48, 197, 166, 208, 70, 62, 197, 19, 221, 80, 159, 252, 220, 175, 31, 245])
};
var sizes = {
"P-521": 66,
"P-256": 32,
"P-384": 48
};
var derivations = {
"P-521": new Uint8Array([0, 156, 43, 206, 87, 190, 128, 173, 171, 59, 7, 56, 91, 142, 89, 144, 235, 125, 111, 222, 189, 176, 27, 243, 83, 113, 164, 246, 7, 94, 157, 40, 138, 193, 42, 109, 254, 3, 170, 87, 67, 188, 129, 112, 157, 73, 168, 34, 148, 2, 25, 182, 75, 118, 138, 205, 82, 15, 161, 54, 142, 160, 175, 141, 71, 93]),
"P-256": new Uint8Array([14, 143, 60, 77, 177, 178, 162, 131, 115, 90, 0, 220, 87, 31, 26, 232, 151, 28, 227, 35, 250, 17, 131, 137, 203, 95, 65, 196, 59, 61, 181, 161]),
"P-384": new Uint8Array([224, 189, 107, 206, 10, 239, 140, 164, 136, 56, 166, 226, 252, 197, 126, 103, 185, 197, 232, 134, 12, 95, 11, 233, 218, 190, 197, 62, 69, 78, 24, 160, 161, 116, 196, 136, 136, 162, 100, 136, 17, 91, 45, 201, 241, 223, 165, 45])
};
return importKeys(pkcs8, spki, sizes)
.then(function(results) {
publicKeys = results.publicKeys;
privateKeys = results.privateKeys;
ecdsaKeyPairs = results.ecdsaKeyPairs;
noDeriveKeyKeys = results.noDeriveKeyKeys;
Object.keys(sizes).forEach(function(namedCurve) {
// Basic success case
promise_test(function(test) {
return subtle.deriveKey({name: "ECDH", public: publicKeys[namedCurve]}, privateKeys[namedCurve], {name: "HMAC", hash: "SHA-256", length: 256}, true, ["sign", "verify"])
.then(function(key) {return crypto.subtle.exportKey("raw", key);})
.then(function(exportedKey) {
assert_true(equalBuffers(exportedKey, derivations[namedCurve], 8 * exportedKey.length), "Derived correct key");
}, function(err) {
assert_unreached("deriveKey failed with error " + err.name + ": " + err.message);
});
}, namedCurve + " good parameters");
// Case insensitivity check
promise_test(function(test) {
return subtle.deriveKey({name: "EcDh", public: publicKeys[namedCurve]}, privateKeys[namedCurve], {name: "HMAC", hash: "SHA-256", length: 256}, true, ["sign", "verify"])
.then(function(key) {return crypto.subtle.exportKey("raw", key);})
.then(function(exportedKey) {
assert_true(equalBuffers(exportedKey, derivations[namedCurve], 8 * exportedKey.length), "Derived correct key");
}, function(err) {
assert_unreached("deriveKey failed with error " + err.name + ": " + err.message);
});
}, namedCurve + " mixed case parameters");
// Errors to test:
// - missing public property TypeError
promise_test(function(test) {
return subtle.deriveKey({name: "ECDH"}, privateKeys[namedCurve], {name: "HMAC", hash: "SHA-256", length: 256}, true, ["sign", "verify"])
.then(function(key) {return crypto.subtle.exportKey("raw", key);})
.then(function(exportedKey) {
assert_unreached("deriveKey succeeded but should have failed with TypeError");
}, function(err) {
assert_equals(err.name, "TypeError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " missing public curve");
// - Non CryptoKey public property TypeError
promise_test(function(test) {
return subtle.deriveKey({name: "ECDH", public: {message: "Not a CryptoKey"}}, privateKeys[namedCurve], {name: "HMAC", hash: "SHA-256", length: 256}, true, ["sign", "verify"])
.then(function(key) {return crypto.subtle.exportKey("raw", key);})
.then(function(exportedKey) {
assert_unreached("deriveKey succeeded but should have failed with TypeError");
}, function(err) {
assert_equals(err.name, "TypeError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " public property of algorithm is not a CryptoKey");
// - wrong named curve
promise_test(function(test) {
publicKey = publicKeys["P-256"];
if (namedCurve === "P-256") {
publicKey = publicKeys["P-384"];
}
return subtle.deriveKey({name: "ECDH", public: publicKey}, privateKeys[namedCurve], {name: "HMAC", hash: "SHA-256", length: 256}, true, ["sign", "verify"])
.then(function(key) {return crypto.subtle.exportKey("raw", key);})
.then(function(exportedKey) {
assert_unreached("deriveKey succeeded but should have failed with InvalidAccessError");
}, function(err) {
assert_equals(err.name, "InvalidAccessError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " mismatched curves");
// - not ECDH public property InvalidAccessError
promise_test(function(test) {
return subtle.deriveKey({name: "ECDH", public: ecdsaKeyPairs[namedCurve].publicKey}, privateKeys[namedCurve], {name: "HMAC", hash: "SHA-256", length: 256}, true, ["sign", "verify"])
.then(function(key) {return crypto.subtle.exportKey("raw", key);})
.then(function(exportedKey) {
assert_unreached("deriveKey succeeded but should have failed with InvalidAccessError");
}, function(err) {
assert_equals(err.name, "InvalidAccessError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " public property of algorithm is not an ECDSA public key");
// - No deriveKey usage in baseKey InvalidAccessError
promise_test(function(test) {
return subtle.deriveKey({name: "ECDH", public: publicKeys[namedCurve]}, noDeriveKeyKeys[namedCurve], {name: "HMAC", hash: "SHA-256", length: 256}, true, ["sign", "verify"])
.then(function(key) {return crypto.subtle.exportKey("raw", key);})
.then(function(exportedKey) {
assert_unreached("deriveKey succeeded but should have failed with InvalidAccessError");
}, function(err) {
assert_equals(err.name, "InvalidAccessError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " no deriveKey usage for base key");
// - Use public key for baseKey InvalidAccessError
promise_test(function(test) {
return subtle.deriveKey({name: "ECDH", public: publicKeys[namedCurve]}, publicKeys[namedCurve], {name: "HMAC", hash: "SHA-256", length: 256}, true, ["sign", "verify"])
.then(function(key) {return crypto.subtle.exportKey("raw", key);})
.then(function(exportedKey) {
assert_unreached("deriveKey succeeded but should have failed with InvalidAccessError");
}, function(err) {
assert_equals(err.name, "InvalidAccessError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " base key is not a private key");
// - Use private key for public property InvalidAccessError
promise_test(function(test) {
return subtle.deriveKey({name: "ECDH", public: privateKeys[namedCurve]}, privateKeys[namedCurve], {name: "HMAC", hash: "SHA-256", length: 256}, true, ["sign", "verify"])
.then(function(key) {return crypto.subtle.exportKey("raw", key);})
.then(function(exportedKey) {
assert_unreached("deriveKey succeeded but should have failed with InvalidAccessError");
}, function(err) {
assert_equals(err.name, "InvalidAccessError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, namedCurve + " public property value is a private key");
// - Use secret key for public property InvalidAccessError
promise_test(function(test) {
return subtle.generateKey({name: "HMAC", hash: "SHA-256", length: 256}, true, ["sign", "verify"])
.then(function(secretKey) {
return subtle.deriveKey({name: "ECDH", public: secretKey}, privateKeys[namedCurve], {name: "AES-CBC", length: 256}, true, ["sign", "verify"])
.then(function(key) {return crypto.subtle.exportKey("raw", key);})
.then(function(exportedKey) {
assert_unreached("deriveKey succeeded but should have failed with InvalidAccessError");
}, function(err) {
assert_equals(err.name, "InvalidAccessError", "Should throw correct error, not " + err.name + ": " + err.message);
});
});
}, namedCurve + " public property value is a secret key");
});
});
function importKeys(pkcs8, spki, sizes) {
var privateKeys = {};
var publicKeys = {};
var ecdsaKeyPairs = {};
var noDeriveKeyKeys = {};
var promises = [];
Object.keys(pkcs8).forEach(function(namedCurve) {
var operation = subtle.importKey("pkcs8", pkcs8[namedCurve],
{name: "ECDH", namedCurve: namedCurve},
false, ["deriveBits", "deriveKey"])
.then(function(key) {
privateKeys[namedCurve] = key;
}, function (err) {
privateKeys[namedCurve] = null;
});
promises.push(operation);
});
Object.keys(pkcs8).forEach(function(namedCurve) {
var operation = subtle.importKey("pkcs8", pkcs8[namedCurve],
{name: "ECDH", namedCurve: namedCurve},
false, ["deriveBits"])
.then(function(key) {
noDeriveKeyKeys[namedCurve] = key;
}, function (err) {
noDeriveKeyKeys[namedCurve] = null;
});
promises.push(operation);
});
Object.keys(spki).forEach(function(namedCurve) {
var operation = subtle.importKey("spki", spki[namedCurve],
{name: "ECDH", namedCurve: namedCurve},
false, [])
.then(function(key) {
publicKeys[namedCurve] = key;
}, function (err) {
publicKeys[namedCurve] = null;
});
promises.push(operation);
});
Object.keys(sizes).forEach(function(namedCurve) {
var operation = subtle.generateKey({name: "ECDSA", namedCurve: namedCurve}, false, ["sign", "verify"])
.then(function(keyPair) {
ecdsaKeyPairs[namedCurve] = keyPair;
}, function (err) {
ecdsaKeyPairs[namedCurve] = null;
});
promises.push(operation);
});
return Promise.all(promises)
.then(function(results) {return {privateKeys: privateKeys, publicKeys: publicKeys, ecdsaKeyPairs: ecdsaKeyPairs, noDeriveKeyKeys: noDeriveKeyKeys}});
}
// Compares two ArrayBuffer or ArrayBufferView objects. If bitCount is
// omitted, the two values must be the same length and have the same contents
// in every byte. If bitCount is included, only that leading number of bits
// have to match.
function equalBuffers(a, b, bitCount) {
var remainder;
if (typeof bitCount === "undefined" && a.byteLength !== b.byteLength) {
return false;
}
var aBytes = new Uint8Array(a);
var bBytes = new Uint8Array(b);
var length = a.byteLength;
if (typeof bitCount !== "undefined") {
length = Math.floor(bitCount / 8);
}
for (var i=0; i<length; i++) {
if (aBytes[i] !== bBytes[i]) {
return false;
}
}
if (typeof bitCount !== "undefined") {
remainder = bitCount % 8;
return aBytes[length] >> (8 - remainder) === bBytes[length] >> (8 - remainder);
}
return true;
}
}

View file

@ -0,0 +1,16 @@
<!doctype html>
<meta charset=utf-8>
<title>WebCryptoAPI: importKey() for EC keys</title>
<meta name="timeout" content="long">
<script>
self.GLOBAL = {
isWindow: function() { return true; },
isWorker: function() { return false; },
isShadowRealm: function() { return false; },
};
</script>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../util/helpers.js"></script>
<div id=log></div>
<script src="../../WebCryptoAPI/import_export/ec_importKey.https.any.js"></script>

View file

@ -0,0 +1,293 @@
// META: title=WebCryptoAPI: importKey() for EC keys
// META: timeout=long
// META: script=../util/helpers.js
// Test importKey and exportKey for EC algorithms. Only "happy paths" are
// currently tested - those where the operation should succeed.
var subtle = crypto.subtle;
var curves = ['P-256', 'P-384', 'P-521'];
var keyData = {
"P-521": {
spki: new Uint8Array([48, 129, 155, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 35, 3, 129, 134, 0, 4, 1, 86, 244, 121, 248, 223, 30, 32, 167, 255, 192, 76, 228, 32, 195, 225, 84, 174, 37, 25, 150, 190, 228, 47, 3, 75, 132, 212, 27, 116, 63, 52, 228, 95, 49, 27, 129, 58, 156, 222, 200, 205, 165, 155, 187, 189, 49, 212, 96, 179, 41, 37, 33, 231, 193, 183, 34, 229, 102, 124, 3, 219, 47, 174, 117, 63, 1, 80, 23, 54, 207, 226, 71, 57, 67, 32, 216, 228, 175, 194, 253, 57, 181, 169, 51, 16, 97, 184, 30, 34, 65, 40, 43, 158, 23, 137, 24, 34, 181, 183, 158, 5, 47, 69, 151, 181, 150, 67, 253, 57, 55, 156, 81, 189, 81, 37, 196, 244, 139, 195, 240, 37, 206, 60, 211, 105, 83, 40, 108, 203, 56, 251]),
spki_compressed: new Uint8Array([48, 88, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 35, 3, 68, 0, 3, 1, 86, 244, 121, 248, 223, 30, 32, 167, 255, 192, 76, 228, 32, 195, 225, 84, 174, 37, 25, 150, 190, 228, 47, 3, 75, 132, 212, 27, 116, 63, 52, 228, 95, 49, 27, 129, 58, 156, 222, 200, 205, 165, 155, 187, 189, 49, 212, 96, 179, 41, 37, 33, 231, 193, 183, 34, 229, 102, 124, 3, 219, 47, 174, 117, 63]),
raw: new Uint8Array([4, 1, 86, 244, 121, 248, 223, 30, 32, 167, 255, 192, 76, 228, 32, 195, 225, 84, 174, 37, 25, 150, 190, 228, 47, 3, 75, 132, 212, 27, 116, 63, 52, 228, 95, 49, 27, 129, 58, 156, 222, 200, 205, 165, 155, 187, 189, 49, 212, 96, 179, 41, 37, 33, 231, 193, 183, 34, 229, 102, 124, 3, 219, 47, 174, 117, 63, 1, 80, 23, 54, 207, 226, 71, 57, 67, 32, 216, 228, 175, 194, 253, 57, 181, 169, 51, 16, 97, 184, 30, 34, 65, 40, 43, 158, 23, 137, 24, 34, 181, 183, 158, 5, 47, 69, 151, 181, 150, 67, 253, 57, 55, 156, 81, 189, 81, 37, 196, 244, 139, 195, 240, 37, 206, 60, 211, 105, 83, 40, 108, 203, 56, 251]),
raw_compressed: new Uint8Array([3, 1, 86, 244, 121, 248, 223, 30, 32, 167, 255, 192, 76, 228, 32, 195, 225, 84, 174, 37, 25, 150, 190, 228, 47, 3, 75, 132, 212, 27, 116, 63, 52, 228, 95, 49, 27, 129, 58, 156, 222, 200, 205, 165, 155, 187, 189, 49, 212, 96, 179, 41, 37, 33, 231, 193, 183, 34, 229, 102, 124, 3, 219, 47, 174, 117, 63]),
pkcs8: new Uint8Array([48, 129, 238, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 35, 4, 129, 214, 48, 129, 211, 2, 1, 1, 4, 66, 0, 244, 8, 117, 131, 104, 186, 147, 15, 48, 247, 106, 224, 84, 254, 92, 210, 206, 127, 218, 44, 159, 118, 166, 212, 54, 207, 117, 214, 108, 68, 11, 254, 99, 49, 199, 193, 114, 161, 36, 120, 25, 60, 130, 81, 72, 123, 201, 18, 99, 250, 80, 33, 127, 133, 255, 99, 111, 89, 205, 84, 110, 58, 180, 131, 180, 161, 129, 137, 3, 129, 134, 0, 4, 1, 86, 244, 121, 248, 223, 30, 32, 167, 255, 192, 76, 228, 32, 195, 225, 84, 174, 37, 25, 150, 190, 228, 47, 3, 75, 132, 212, 27, 116, 63, 52, 228, 95, 49, 27, 129, 58, 156, 222, 200, 205, 165, 155, 187, 189, 49, 212, 96, 179, 41, 37, 33, 231, 193, 183, 34, 229, 102, 124, 3, 219, 47, 174, 117, 63, 1, 80, 23, 54, 207, 226, 71, 57, 67, 32, 216, 228, 175, 194, 253, 57, 181, 169, 51, 16, 97, 184, 30, 34, 65, 40, 43, 158, 23, 137, 24, 34, 181, 183, 158, 5, 47, 69, 151, 181, 150, 67, 253, 57, 55, 156, 81, 189, 81, 37, 196, 244, 139, 195, 240, 37, 206, 60, 211, 105, 83, 40, 108, 203, 56, 251]),
jwk: {
kty: "EC",
crv: "P-521",
x: "AVb0efjfHiCn_8BM5CDD4VSuJRmWvuQvA0uE1Bt0PzTkXzEbgTqc3sjNpZu7vTHUYLMpJSHnwbci5WZ8A9svrnU_",
y: "AVAXNs_iRzlDINjkr8L9ObWpMxBhuB4iQSgrnheJGCK1t54FL0WXtZZD_Tk3nFG9USXE9IvD8CXOPNNpUyhsyzj7",
d: "APQIdYNoupMPMPdq4FT-XNLOf9osn3am1DbPddZsRAv-YzHHwXKhJHgZPIJRSHvJEmP6UCF_hf9jb1nNVG46tIO0"
}
},
"P-256": {
spki: new Uint8Array([48, 89, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 3, 66, 0, 4, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209, 206, 3, 117, 82, 212, 129, 69, 12, 227, 155, 77, 16, 149, 112, 27, 23, 91, 250, 179, 75, 142, 108, 9, 158, 24, 241, 193, 152, 53, 131, 97, 232]),
spki_compressed: new Uint8Array([48, 57, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 3, 34, 0, 2, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209]),
raw: new Uint8Array([4, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209, 206, 3, 117, 82, 212, 129, 69, 12, 227, 155, 77, 16, 149, 112, 27, 23, 91, 250, 179, 75, 142, 108, 9, 158, 24, 241, 193, 152, 53, 131, 97, 232]),
raw_compressed: new Uint8Array([2, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209]),
pkcs8: new Uint8Array([48, 129, 135, 2, 1, 0, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 4, 109, 48, 107, 2, 1, 1, 4, 32, 19, 211, 58, 45, 90, 191, 156, 249, 235, 178, 31, 248, 96, 212, 174, 254, 110, 86, 231, 119, 144, 244, 222, 233, 180, 8, 132, 235, 211, 53, 68, 234, 161, 68, 3, 66, 0, 4, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209, 206, 3, 117, 82, 212, 129, 69, 12, 227, 155, 77, 16, 149, 112, 27, 23, 91, 250, 179, 75, 142, 108, 9, 158, 24, 241, 193, 152, 53, 131, 97, 232]),
jwk: {
kty: "EC",
crv: "P-256",
x: "0hCwpvnZ8BKGgFi0P6T0cQGFQ7ugDJJQ35JXwqyuXdE",
y: "zgN1UtSBRQzjm00QlXAbF1v6s0uObAmeGPHBmDWDYeg",
d: "E9M6LVq_nPnrsh_4YNSu_m5W53eQ9N7ptAiE69M1ROo"
}
},
"P-384": {
spki: new Uint8Array([48, 118, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 3, 98, 0, 4, 33, 156, 20, 214, 102, 23, 179, 110, 198, 216, 133, 107, 56, 91, 115, 167, 77, 52, 79, 216, 174, 117, 239, 4, 100, 53, 221, 165, 78, 59, 68, 189, 95, 189, 235, 209, 208, 141, 214, 158, 45, 125, 193, 220, 33, 140, 180, 53, 189, 40, 19, 140, 199, 120, 51, 122, 132, 47, 107, 214, 27, 36, 14, 116, 36, 159, 36, 102, 124, 42, 88, 16, 167, 107, 252, 40, 224, 51, 95, 136, 166, 80, 29, 236, 1, 151, 109, 168, 90, 251, 0, 134, 156, 182, 172, 232]),
spki_compressed: new Uint8Array([48, 70, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 3, 50, 0, 2, 33, 156, 20, 214, 102, 23, 179, 110, 198, 216, 133, 107, 56, 91, 115, 167, 77, 52, 79, 216, 174, 117, 239, 4, 100, 53, 221, 165, 78, 59, 68, 189, 95, 189, 235, 209, 208, 141, 214, 158, 45, 125, 193, 220, 33, 140, 180, 53]),
raw: new Uint8Array([4, 33, 156, 20, 214, 102, 23, 179, 110, 198, 216, 133, 107, 56, 91, 115, 167, 77, 52, 79, 216, 174, 117, 239, 4, 100, 53, 221, 165, 78, 59, 68, 189, 95, 189, 235, 209, 208, 141, 214, 158, 45, 125, 193, 220, 33, 140, 180, 53, 189, 40, 19, 140, 199, 120, 51, 122, 132, 47, 107, 214, 27, 36, 14, 116, 36, 159, 36, 102, 124, 42, 88, 16, 167, 107, 252, 40, 224, 51, 95, 136, 166, 80, 29, 236, 1, 151, 109, 168, 90, 251, 0, 134, 156, 182, 172, 232]),
raw_compressed: new Uint8Array([2, 33, 156, 20, 214, 102, 23, 179, 110, 198, 216, 133, 107, 56, 91, 115, 167, 77, 52, 79, 216, 174, 117, 239, 4, 100, 53, 221, 165, 78, 59, 68, 189, 95, 189, 235, 209, 208, 141, 214, 158, 45, 125, 193, 220, 33, 140, 180, 53]),
pkcs8: new Uint8Array([48, 129, 182, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 4, 129, 158, 48, 129, 155, 2, 1, 1, 4, 48, 69, 55, 181, 153, 7, 132, 211, 194, 210, 46, 150, 168, 249, 47, 161, 170, 73, 46, 232, 115, 229, 118, 164, 21, 130, 225, 68, 24, 60, 152, 136, 209, 14, 107, 158, 180, 206, 212, 178, 204, 64, 18, 228, 172, 94, 168, 64, 115, 161, 100, 3, 98, 0, 4, 33, 156, 20, 214, 102, 23, 179, 110, 198, 216, 133, 107, 56, 91, 115, 167, 77, 52, 79, 216, 174, 117, 239, 4, 100, 53, 221, 165, 78, 59, 68, 189, 95, 189, 235, 209, 208, 141, 214, 158, 45, 125, 193, 220, 33, 140, 180, 53, 189, 40, 19, 140, 199, 120, 51, 122, 132, 47, 107, 214, 27, 36, 14, 116, 36, 159, 36, 102, 124, 42, 88, 16, 167, 107, 252, 40, 224, 51, 95, 136, 166, 80, 29, 236, 1, 151, 109, 168, 90, 251, 0, 134, 156, 182, 172, 232]),
jwk: {
kty: "EC",
crv: "P-384",
x: "IZwU1mYXs27G2IVrOFtzp000T9iude8EZDXdpU47RL1fvevR0I3Wni19wdwhjLQ1",
y: "vSgTjMd4M3qEL2vWGyQOdCSfJGZ8KlgQp2v8KOAzX4imUB3sAZdtqFr7AIactqzo",
d: "RTe1mQeE08LSLpao-S-hqkku6HPldqQVguFEGDyYiNEOa560ztSyzEAS5KxeqEBz"
}
},
};
// combinations to test
var testVectors = [
{name: "ECDSA", privateUsages: ["sign"], publicUsages: ["verify"]},
{name: "ECDH", privateUsages: ["deriveKey", "deriveBits"], publicUsages: []}
];
// TESTS ARE HERE:
// Test every test vector, along with all available key data
testVectors.forEach(function(vector) {
curves.forEach(function(curve) {
[true, false].forEach(function(extractable) {
// Test public keys first
allValidUsages(vector.publicUsages, true).forEach(function(usages) {
['spki', 'spki_compressed', 'jwk', 'raw', 'raw_compressed'].forEach(function(format) {
var algorithm = {name: vector.name, namedCurve: curve};
var data = keyData[curve];
if (format === "jwk") { // Not all fields used for public keys
data = {jwk: {kty: keyData[curve].jwk.kty, crv: keyData[curve].jwk.crv, x: keyData[curve].jwk.x, y: keyData[curve].jwk.y}};
}
testFormat(format, algorithm, data, curve, usages, extractable);
if (vector.name === 'ECDH' && format === 'jwk') {
testEcdhJwkAlg(algorithm, { ...data.jwk, alg: 'any alg works here' }, curve, usages, extractable);
}
});
});
// Next, test private keys
['pkcs8', 'jwk'].forEach(function(format) {
var algorithm = {name: vector.name, namedCurve: curve};
var data = keyData[curve];
allValidUsages(vector.privateUsages).forEach(function(usages) {
testFormat(format, algorithm, data, curve, usages, extractable);
if (vector.name === 'ECDH' && format === 'jwk') {
testEcdhJwkAlg(algorithm, { ...data.jwk, alg: 'any alg works here' }, curve, usages, extractable);
}
});
testEmptyUsages(format, algorithm, data, curve, extractable);
});
});
});
});
// Test importKey with a given key format and other parameters. If
// extrable is true, export the key and verify that it matches the input.
function testFormat(format, algorithm, data, keySize, usages, extractable) {
const keyData = data[format];
const compressed = format.endsWith("_compressed");
if (compressed) {
[format] = format.split("_compressed");
}
promise_test(function(test) {
return subtle.importKey(format, keyData, algorithm, extractable, usages).
then(function(key) {
assert_equals(key.constructor, CryptoKey, "Imported a CryptoKey object");
assert_goodCryptoKey(key, algorithm, extractable, usages, (format === 'pkcs8' || (format === 'jwk' && keyData.d)) ? 'private' : 'public');
if (!extractable) {
return;
}
return subtle.exportKey(format, key).
then(function(result) {
if (format !== "jwk") {
assert_true(equalBuffers(data[format], result), "Round trip works");
} else {
assert_true(equalJwk(data[format], result), "Round trip works");
}
}, function(err) {
assert_unreached("Threw an unexpected error: " + err.toString());
});
}, function(err) {
if (compressed && err.name === "DataError") {
assert_implements_optional(false, "Compressed point format not supported: " + err.toString());
} else {
assert_unreached("Threw an unexpected error: " + err.toString());
}
});
}, "Good parameters: " + keySize.toString() + " bits " + parameterString(format, compressed, keyData, algorithm, extractable, usages));
}
// Test importKey with a given key format and other parameters but with empty usages.
// Should fail with SyntaxError
function testEmptyUsages(format, algorithm, data, keySize, extractable) {
const keyData = data[format];
const usages = [];
promise_test(function(test) {
return subtle.importKey(format, keyData, algorithm, extractable, usages).
then(function(key) {
assert_unreached("importKey succeeded but should have failed with SyntaxError");
}, function(err) {
assert_equals(err.name, "SyntaxError", "Should throw correct error, not " + err.name + ": " + err.message);
});
}, "Empty Usages: " + keySize.toString() + " bits " + parameterString(format, false, keyData, algorithm, extractable, usages));
}
// Test ECDH importKey with a JWK format
// Should succeed with any "alg" value
function testEcdhJwkAlg(algorithm, keyData, keySize, usages, extractable) {
const format = "jwk";
promise_test(function(test) {
return subtle.importKey(format, keyData, algorithm, extractable, usages).
then(function(key) {
assert_equals(key.constructor, CryptoKey, "Imported a CryptoKey object");
assert_goodCryptoKey(key, algorithm, extractable, usages, keyData.d ? 'private' : 'public');
}, function(err) {
assert_unreached("Threw an unexpected error: " + err.toString());
});
}, "ECDH any JWK alg: " + keySize.toString() + " bits " + parameterString(format, false, keyData, algorithm, extractable, usages));
}
// Helper methods follow:
// Are two array buffers the same?
function equalBuffers(a, b) {
if (a.byteLength !== b.byteLength) {
return false;
}
var aBytes = new Uint8Array(a);
var bBytes = new Uint8Array(b);
for (var i=0; i<a.byteLength; i++) {
if (aBytes[i] !== bBytes[i]) {
return false;
}
}
return true;
}
// Are two Jwk objects "the same"? That is, does the object returned include
// matching values for each property that was expected? It's okay if the
// returned object has extra methods; they aren't checked.
function equalJwk(expected, got) {
var fields = Object.keys(expected);
var fieldName;
for(var i=0; i<fields.length; i++) {
fieldName = fields[i];
if (!(fieldName in got)) {
return false;
}
if (expected[fieldName] !== got[fieldName]) {
return false;
}
}
return true;
}
// Build minimal Jwk objects from raw key data and algorithm specifications
function jwkData(keyData, algorithm) {
var result = {
kty: "oct",
k: byteArrayToUnpaddedBase64(keyData)
};
if (algorithm.name.substring(0, 3) === "AES") {
result.alg = "A" + (8 * keyData.byteLength).toString() + algorithm.name.substring(4);
} else if (algorithm.name === "HMAC") {
result.alg = "HS" + algorithm.hash.substring(4);
}
return result;
}
// Jwk format wants Base 64 without the typical padding at the end.
function byteArrayToUnpaddedBase64(byteArray){
var binaryString = "";
for (var i=0; i<byteArray.byteLength; i++){
binaryString += String.fromCharCode(byteArray[i]);
}
var base64String = btoa(binaryString);
return base64String.replace(/=/g, "");
}
// Convert method parameters to a string to uniquely name each test
function parameterString(format, compressed, data, algorithm, extractable, usages) {
if ("byteLength" in data) {
data = "buffer(" + data.byteLength.toString() + (compressed ? ", compressed" : "") + ")";
} else {
data = "object(" + Object.keys(data).join(", ") + ")";
}
var result = "(" +
objectToString(format) + ", " +
objectToString(data) + ", " +
objectToString(algorithm) + ", " +
objectToString(extractable) + ", " +
objectToString(usages) +
")";
return result;
}
// Character representation of any object we may use as a parameter.
function objectToString(obj) {
var keyValuePairs = [];
if (Array.isArray(obj)) {
return "[" + obj.map(function(elem){return objectToString(elem);}).join(", ") + "]";
} else if (typeof obj === "object") {
Object.keys(obj).sort().forEach(function(keyName) {
keyValuePairs.push(keyName + ": " + objectToString(obj[keyName]));
});
return "{" + keyValuePairs.join(", ") + "}";
} else if (typeof obj === "undefined") {
return "undefined";
} else {
return obj.toString();
}
var keyValuePairs = [];
Object.keys(obj).sort().forEach(function(keyName) {
var value = obj[keyName];
if (typeof value === "object") {
value = objectToString(value);
} else if (typeof value === "array") {
value = "[" + value.map(function(elem){return objectToString(elem);}).join(", ") + "]";
} else {
value = value.toString();
}
keyValuePairs.push(keyName + ": " + value);
});
return "{" + keyValuePairs.join(", ") + "}";
}

View file

@ -0,0 +1,18 @@
<!doctype html>
<meta charset=utf-8>
<title>WebCryptoAPI: importKey() for Failures</title>
<meta name="timeout" content="long">
<script>
self.GLOBAL = {
isWindow: function() { return true; },
isWorker: function() { return false; },
isShadowRealm: function() { return false; },
};
</script>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../util/helpers.js"></script>
<script src="ec_importKey_failures_fixtures.js"></script>
<script src="importKey_failures.js"></script>
<div id=log></div>
<script src="../../WebCryptoAPI/import_export/ec_importKey_failures_ECDH.https.any.js"></script>

View file

@ -0,0 +1,10 @@
// META: title=WebCryptoAPI: importKey() for Failures
// META: timeout=long
// META: script=../util/helpers.js
// META: script=ec_importKey_failures_fixtures.js
// META: script=importKey_failures.js
// Setup: define the correct behaviors that should be sought, and create
// helper functions that generate all possible test parameters for
// different situations.
run_test(["ECDH"]);

View file

@ -0,0 +1,203 @@
// Setup: define the correct behaviors that should be sought, and create
// helper functions that generate all possible test parameters for
// different situations.
function getValidKeyData(algorithm) {
return validKeyData[algorithm.namedCurve];
}
function getBadKeyLengthData(algorithm) {
return badKeyLengthData[algorithm.namedCurve];
}
function getMissingJWKFieldKeyData(algorithm) {
// The curve doesn't affect when testing for missing JWK fields.
return missingJWKFieldKeyData["P-521"];
}
function getMismatchedJWKKeyData(algorithm) {
// TODO: Implement test cases where the public key doesn't match the private key.
return [];
}
var validKeyData = {
"P-521": [
{
format: "spki",
data: new Uint8Array([48, 129, 155, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 35, 3, 129, 134, 0, 4, 1, 86, 244, 121, 248, 223, 30, 32, 167, 255, 192, 76, 228, 32, 195, 225, 84, 174, 37, 25, 150, 190, 228, 47, 3, 75, 132, 212, 27, 116, 63, 52, 228, 95, 49, 27, 129, 58, 156, 222, 200, 205, 165, 155, 187, 189, 49, 212, 96, 179, 41, 37, 33, 231, 193, 183, 34, 229, 102, 124, 3, 219, 47, 174, 117, 63, 1, 80, 23, 54, 207, 226, 71, 57, 67, 32, 216, 228, 175, 194, 253, 57, 181, 169, 51, 16, 97, 184, 30, 34, 65, 40, 43, 158, 23, 137, 24, 34, 181, 183, 158, 5, 47, 69, 151, 181, 150, 67, 253, 57, 55, 156, 81, 189, 81, 37, 196, 244, 139, 195, 240, 37, 206, 60, 211, 105, 83, 40, 108, 203, 56, 251]),
},
{
format: "raw",
data: new Uint8Array([4, 1, 86, 244, 121, 248, 223, 30, 32, 167, 255, 192, 76, 228, 32, 195, 225, 84, 174, 37, 25, 150, 190, 228, 47, 3, 75, 132, 212, 27, 116, 63, 52, 228, 95, 49, 27, 129, 58, 156, 222, 200, 205, 165, 155, 187, 189, 49, 212, 96, 179, 41, 37, 33, 231, 193, 183, 34, 229, 102, 124, 3, 219, 47, 174, 117, 63, 1, 80, 23, 54, 207, 226, 71, 57, 67, 32, 216, 228, 175, 194, 253, 57, 181, 169, 51, 16, 97, 184, 30, 34, 65, 40, 43, 158, 23, 137, 24, 34, 181, 183, 158, 5, 47, 69, 151, 181, 150, 67, 253, 57, 55, 156, 81, 189, 81, 37, 196, 244, 139, 195, 240, 37, 206, 60, 211, 105, 83, 40, 108, 203, 56, 251]),
},
{
format:"pkcs8",
data: new Uint8Array([48, 129, 238, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 35, 4, 129, 214, 48, 129, 211, 2, 1, 1, 4, 66, 0, 244, 8, 117, 131, 104, 186, 147, 15, 48, 247, 106, 224, 84, 254, 92, 210, 206, 127, 218, 44, 159, 118, 166, 212, 54, 207, 117, 214, 108, 68, 11, 254, 99, 49, 199, 193, 114, 161, 36, 120, 25, 60, 130, 81, 72, 123, 201, 18, 99, 250, 80, 33, 127, 133, 255, 99, 111, 89, 205, 84, 110, 58, 180, 131, 180, 161, 129, 137, 3, 129, 134, 0, 4, 1, 86, 244, 121, 248, 223, 30, 32, 167, 255, 192, 76, 228, 32, 195, 225, 84, 174, 37, 25, 150, 190, 228, 47, 3, 75, 132, 212, 27, 116, 63, 52, 228, 95, 49, 27, 129, 58, 156, 222, 200, 205, 165, 155, 187, 189, 49, 212, 96, 179, 41, 37, 33, 231, 193, 183, 34, 229, 102, 124, 3, 219, 47, 174, 117, 63, 1, 80, 23, 54, 207, 226, 71, 57, 67, 32, 216, 228, 175, 194, 253, 57, 181, 169, 51, 16, 97, 184, 30, 34, 65, 40, 43, 158, 23, 137, 24, 34, 181, 183, 158, 5, 47, 69, 151, 181, 150, 67, 253, 57, 55, 156, 81, 189, 81, 37, 196, 244, 139, 195, 240, 37, 206, 60, 211, 105, 83, 40, 108, 203, 56, 251]),
},
{
format: "jwk",
data: {
kty: "EC",
crv: "P-521",
x: "AVb0efjfHiCn_8BM5CDD4VSuJRmWvuQvA0uE1Bt0PzTkXzEbgTqc3sjNpZu7vTHUYLMpJSHnwbci5WZ8A9svrnU_",
y: "AVAXNs_iRzlDINjkr8L9ObWpMxBhuB4iQSgrnheJGCK1t54FL0WXtZZD_Tk3nFG9USXE9IvD8CXOPNNpUyhsyzj7",
d: "APQIdYNoupMPMPdq4FT-XNLOf9osn3am1DbPddZsRAv-YzHHwXKhJHgZPIJRSHvJEmP6UCF_hf9jb1nNVG46tIO0"
}
}
],
"P-256": [
{
format: "spki",
data: new Uint8Array([48, 89, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 3, 66, 0, 4, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209, 206, 3, 117, 82, 212, 129, 69, 12, 227, 155, 77, 16, 149, 112, 27, 23, 91, 250, 179, 75, 142, 108, 9, 158, 24, 241, 193, 152, 53, 131, 97, 232]),
},
{
format: "raw",
data: new Uint8Array([4, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209, 206, 3, 117, 82, 212, 129, 69, 12, 227, 155, 77, 16, 149, 112, 27, 23, 91, 250, 179, 75, 142, 108, 9, 158, 24, 241, 193, 152, 53, 131, 97, 232]),
},
{
format: "pkcs8",
data: new Uint8Array([48, 129, 135, 2, 1, 0, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 4, 109, 48, 107, 2, 1, 1, 4, 32, 19, 211, 58, 45, 90, 191, 156, 249, 235, 178, 31, 248, 96, 212, 174, 254, 110, 86, 231, 119, 144, 244, 222, 233, 180, 8, 132, 235, 211, 53, 68, 234, 161, 68, 3, 66, 0, 4, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209, 206, 3, 117, 82, 212, 129, 69, 12, 227, 155, 77, 16, 149, 112, 27, 23, 91, 250, 179, 75, 142, 108, 9, 158, 24, 241, 193, 152, 53, 131, 97, 232]),
},
{
format: "jwk",
data: {
kty: "EC",
crv: "P-256",
x: "0hCwpvnZ8BKGgFi0P6T0cQGFQ7ugDJJQ35JXwqyuXdE",
y: "zgN1UtSBRQzjm00QlXAbF1v6s0uObAmeGPHBmDWDYeg",
d: "E9M6LVq_nPnrsh_4YNSu_m5W53eQ9N7ptAiE69M1ROo"
}
},
],
"P-384": [
{
format: "spki",
data: new Uint8Array([48, 118, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 3, 98, 0, 4, 33, 156, 20, 214, 102, 23, 179, 110, 198, 216, 133, 107, 56, 91, 115, 167, 77, 52, 79, 216, 174, 117, 239, 4, 100, 53, 221, 165, 78, 59, 68, 189, 95, 189, 235, 209, 208, 141, 214, 158, 45, 125, 193, 220, 33, 140, 180, 53, 189, 40, 19, 140, 199, 120, 51, 122, 132, 47, 107, 214, 27, 36, 14, 116, 36, 159, 36, 102, 124, 42, 88, 16, 167, 107, 252, 40, 224, 51, 95, 136, 166, 80, 29, 236, 1, 151, 109, 168, 90, 251, 0, 134, 156, 182, 172, 232]),
},
{
format: "raw",
data: new Uint8Array([4, 33, 156, 20, 214, 102, 23, 179, 110, 198, 216, 133, 107, 56, 91, 115, 167, 77, 52, 79, 216, 174, 117, 239, 4, 100, 53, 221, 165, 78, 59, 68, 189, 95, 189, 235, 209, 208, 141, 214, 158, 45, 125, 193, 220, 33, 140, 180, 53, 189, 40, 19, 140, 199, 120, 51, 122, 132, 47, 107, 214, 27, 36, 14, 116, 36, 159, 36, 102, 124, 42, 88, 16, 167, 107, 252, 40, 224, 51, 95, 136, 166, 80, 29, 236, 1, 151, 109, 168, 90, 251, 0, 134, 156, 182, 172, 232]),
},
{
format: "pkcs8",
data: new Uint8Array([48, 129, 182, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 4, 129, 158, 48, 129, 155, 2, 1, 1, 4, 48, 69, 55, 181, 153, 7, 132, 211, 194, 210, 46, 150, 168, 249, 47, 161, 170, 73, 46, 232, 115, 229, 118, 164, 21, 130, 225, 68, 24, 60, 152, 136, 209, 14, 107, 158, 180, 206, 212, 178, 204, 64, 18, 228, 172, 94, 168, 64, 115, 161, 100, 3, 98, 0, 4, 33, 156, 20, 214, 102, 23, 179, 110, 198, 216, 133, 107, 56, 91, 115, 167, 77, 52, 79, 216, 174, 117, 239, 4, 100, 53, 221, 165, 78, 59, 68, 189, 95, 189, 235, 209, 208, 141, 214, 158, 45, 125, 193, 220, 33, 140, 180, 53, 189, 40, 19, 140, 199, 120, 51, 122, 132, 47, 107, 214, 27, 36, 14, 116, 36, 159, 36, 102, 124, 42, 88, 16, 167, 107, 252, 40, 224, 51, 95, 136, 166, 80, 29, 236, 1, 151, 109, 168, 90, 251, 0, 134, 156, 182, 172, 232]),
},
{
format: "jwk",
data: {
kty: "EC",
crv: "P-384",
x: "IZwU1mYXs27G2IVrOFtzp000T9iude8EZDXdpU47RL1fvevR0I3Wni19wdwhjLQ1",
y: "vSgTjMd4M3qEL2vWGyQOdCSfJGZ8KlgQp2v8KOAzX4imUB3sAZdtqFr7AIactqzo",
d: "RTe1mQeE08LSLpao-S-hqkku6HPldqQVguFEGDyYiNEOa560ztSyzEAS5KxeqEBz"
}
}
]
};
// Removed just the last byte.
var badKeyLengthData = {
"P-521": [
{
format: "spki",
data: new Uint8Array([48, 129, 155, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 35, 3, 129, 134, 0, 4, 1, 86, 244, 121, 248, 223, 30, 32, 167, 255, 192, 76, 228, 32, 195, 225, 84, 174, 37, 25, 150, 190, 228, 47, 3, 75, 132, 212, 27, 116, 63, 52, 228, 95, 49, 27, 129, 58, 156, 222, 200, 205, 165, 155, 187, 189, 49, 212, 96, 179, 41, 37, 33, 231, 193, 183, 34, 229, 102, 124, 3, 219, 47, 174, 117, 63, 1, 80, 23, 54, 207, 226, 71, 57, 67, 32, 216, 228, 175, 194, 253, 57, 181, 169, 51, 16, 97, 184, 30, 34, 65, 40, 43, 158, 23, 137, 24, 34, 181, 183, 158, 5, 47, 69, 151, 181, 150, 67, 253, 57, 55, 156, 81, 189, 81, 37, 196, 244, 139, 195, 240, 37, 206, 60, 211, 105, 83, 40, 108, 203, 56]),
},
{
format: "raw",
data: new Uint8Array([4, 1, 86, 244, 121, 248, 223, 30, 32, 167, 255, 192, 76, 228, 32, 195, 225, 84, 174, 37, 25, 150, 190, 228, 47, 3, 75, 132, 212, 27, 116, 63, 52, 228, 95, 49, 27, 129, 58, 156, 222, 200, 205, 165, 155, 187, 189, 49, 212, 96, 179, 41, 37, 33, 231, 193, 183, 34, 229, 102, 124, 3, 219, 47, 174, 117, 63, 1, 80, 23, 54, 207, 226, 71, 57, 67, 32, 216, 228, 175, 194, 253, 57, 181, 169, 51, 16, 97, 184, 30, 34, 65, 40, 43, 158, 23, 137, 24, 34, 181, 183, 158, 5, 47, 69, 151, 181, 150, 67, 253, 57, 55, 156, 81, 189, 81, 37, 196, 244, 139, 195, 240, 37, 206, 60, 211, 105, 83, 40, 108, 203, 56]),
},
{
format:"pkcs8",
data: new Uint8Array([48, 129, 238, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 35, 4, 129, 214, 48, 129, 211, 2, 1, 1, 4, 66, 0, 244, 8, 117, 131, 104, 186, 147, 15, 48, 247, 106, 224, 84, 254, 92, 210, 206, 127, 218, 44, 159, 118, 166, 212, 54, 207, 117, 214, 108, 68, 11, 254, 99, 49, 199, 193, 114, 161, 36, 120, 25, 60, 130, 81, 72, 123, 201, 18, 99, 250, 80, 33, 127, 133, 255, 99, 111, 89, 205, 84, 110, 58, 180, 131, 180, 161, 129, 137, 3, 129, 134, 0, 4, 1, 86, 244, 121, 248, 223, 30, 32, 167, 255, 192, 76, 228, 32, 195, 225, 84, 174, 37, 25, 150, 190, 228, 47, 3, 75, 132, 212, 27, 116, 63, 52, 228, 95, 49, 27, 129, 58, 156, 222, 200, 205, 165, 155, 187, 189, 49, 212, 96, 179, 41, 37, 33, 231, 193, 183, 34, 229, 102, 124, 3, 219, 47, 174, 117, 63, 1, 80, 23, 54, 207, 226, 71, 57, 67, 32, 216, 228, 175, 194, 253, 57, 181, 169, 51, 16, 97, 184, 30, 34, 65, 40, 43, 158, 23, 137, 24, 34, 181, 183, 158, 5, 47, 69, 151, 181, 150, 67, 253, 57, 55, 156, 81, 189, 81, 37, 196, 244, 139, 195, 240, 37, 206, 60, 211, 105, 83, 40, 108, 203, 56]),
},
{
format: "jwk",
data: {
kty: "EC",
crv: "P-521",
x: "AVb0efjfHiCn_8BM5CDD4VSuJRmWvuQvA0uE1Bt0PzTkXzEbgTqc3sjNpZu7vTHUYLMpJSHnwbci5WZ8A9svrnU",
y: "AVAXNs_iRzlDINjkr8L9ObWpMxBhuB4iQSgrnheJGCK1t54FL0WXtZZD_Tk3nFG9USXE9IvD8CXOPNNpUyhsyzj7",
d: "APQIdYNoupMPMPdq4FT-XNLOf9osn3am1DbPddZsRAv-YzHHwXKhJHgZPIJRSHvJEmP6UCF_hf9jb1nNVG46tIO0"
}
}
],
"P-256": [
{
format: "spki",
data: new Uint8Array([48, 89, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 3, 66, 0, 4, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209, 206, 3, 117, 82, 212, 129, 69, 12, 227, 155, 77, 16, 149, 112, 27, 23, 91, 250, 179, 75, 142, 108, 9, 158, 24, 241, 193, 152, 53, 131, 97]),
},
{
format: "raw",
data: new Uint8Array([4, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209, 206, 3, 117, 82, 212, 129, 69, 12, 227, 155, 77, 16, 149, 112, 27, 23, 91, 250, 179, 75, 142, 108, 9, 158, 24, 241, 193, 152, 53, 131, 97]),
},
{
format: "pkcs8",
data: new Uint8Array([48, 129, 135, 2, 1, 0, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 4, 109, 48, 107, 2, 1, 1, 4, 32, 19, 211, 58, 45, 90, 191, 156, 249, 235, 178, 31, 248, 96, 212, 174, 254, 110, 86, 231, 119, 144, 244, 222, 233, 180, 8, 132, 235, 211, 53, 68, 234, 161, 68, 3, 66, 0, 4, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209, 206, 3, 117, 82, 212, 129, 69, 12, 227, 155, 77, 16, 149, 112, 27, 23, 91, 250, 179, 75, 142, 108, 9, 158, 24, 241, 193, 152, 53, 131, 97]),
},
{
format: "jwk",
data: {
kty: "EC",
crv: "P-256",
x: "0hCwpvnZ8BKGgFi0P6T0cQGFQ7ugDJJQ35JXwqyuXd",
y: "zgN1UtSBRQzjm00QlXAbF1v6s0uObAmeGPHBmDWDYeg",
d: "E9M6LVq_nPnrsh_4YNSu_m5W53eQ9N7ptAiE69M1ROo"
}
},
],
"P-384": [
{
format: "spki",
data: new Uint8Array([48, 118, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 3, 98, 0, 4, 33, 156, 20, 214, 102, 23, 179, 110, 198, 216, 133, 107, 56, 91, 115, 167, 77, 52, 79, 216, 174, 117, 239, 4, 100, 53, 221, 165, 78, 59, 68, 189, 95, 189, 235, 209, 208, 141, 214, 158, 45, 125, 193, 220, 33, 140, 180, 53, 189, 40, 19, 140, 199, 120, 51, 122, 132, 47, 107, 214, 27, 36, 14, 116, 36, 159, 36, 102, 124, 42, 88, 16, 167, 107, 252, 40, 224, 51, 95, 136, 166, 80, 29, 236, 1, 151, 109, 168, 90, 251, 0, 134, 156, 182, 172]),
},
{
format: "raw",
data: new Uint8Array([4, 33, 156, 20, 214, 102, 23, 179, 110, 198, 216, 133, 107, 56, 91, 115, 167, 77, 52, 79, 216, 174, 117, 239, 4, 100, 53, 221, 165, 78, 59, 68, 189, 95, 189, 235, 209, 208, 141, 214, 158, 45, 125, 193, 220, 33, 140, 180, 53, 189, 40, 19, 140, 199, 120, 51, 122, 132, 47, 107, 214, 27, 36, 14, 116, 36, 159, 36, 102, 124, 42, 88, 16, 167, 107, 252, 40, 224, 51, 95, 136, 166, 80, 29, 236, 1, 151, 109, 168, 90, 251, 0, 134, 156, 182, 172]),
},
{
format: "pkcs8",
data: new Uint8Array([48, 129, 182, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 4, 129, 158, 48, 129, 155, 2, 1, 1, 4, 48, 69, 55, 181, 153, 7, 132, 211, 194, 210, 46, 150, 168, 249, 47, 161, 170, 73, 46, 232, 115, 229, 118, 164, 21, 130, 225, 68, 24, 60, 152, 136, 209, 14, 107, 158, 180, 206, 212, 178, 204, 64, 18, 228, 172, 94, 168, 64, 115, 161, 100, 3, 98, 0, 4, 33, 156, 20, 214, 102, 23, 179, 110, 198, 216, 133, 107, 56, 91, 115, 167, 77, 52, 79, 216, 174, 117, 239, 4, 100, 53, 221, 165, 78, 59, 68, 189, 95, 189, 235, 209, 208, 141, 214, 158, 45, 125, 193, 220, 33, 140, 180, 53, 189, 40, 19, 140, 199, 120, 51, 122, 132, 47, 107, 214, 27, 36, 14, 116, 36, 159, 36, 102, 124, 42, 88, 16, 167, 107, 252, 40, 224, 51, 95, 136, 166, 80, 29, 236, 1, 151, 109, 168, 90, 251, 0, 134, 156, 182, 172]),
},
{
format: "jwk",
data: {
kty: "EC",
crv: "P-384",
x: "IZwU1mYXs27G2IVrOFtzp000T9iude8EZDXdpU47RL1fvevR0I3Wni19wdwhjLQ",
y: "vSgTjMd4M3qEL2vWGyQOdCSfJGZ8KlgQp2v8KOAzX4imUB3sAZdtqFr7AIactqzo",
d: "RTe1mQeE08LSLpao-S-hqkku6HPldqQVguFEGDyYiNEOa560ztSyzEAS5KxeqEBz"
}
}
]
};
var missingJWKFieldKeyData = {
"P-521": [
{
param: "x",
data: {
kty: "EC",
crv: "P-521",
y: "AVAXNs_iRzlDINjkr8L9ObWpMxBhuB4iQSgrnheJGCK1t54FL0WXtZZD_Tk3nFG9USXE9IvD8CXOPNNpUyhsyzj7",
d: "APQIdYNoupMPMPdq4FT-XNLOf9osn3am1DbPddZsRAv-YzHHwXKhJHgZPIJRSHvJEmP6UCF_hf9jb1nNVG46tIO0"
}
},
{
param: "kty",
data: {
crv: "P-521",
x: "AVb0efjfHiCn_8BM5CDD4VSuJRmWvuQvA0uE1Bt0PzTkXzEbgTqc3sjNpZu7vTHUYLMpJSHnwbci5WZ8A9svrnU_",
y: "AVAXNs_iRzlDINjkr8L9ObWpMxBhuB4iQSgrnheJGCK1t54FL0WXtZZD_Tk3nFG9USXE9IvD8CXOPNNpUyhsyzj7",
d: "APQIdYNoupMPMPdq4FT-XNLOf9osn3am1DbPddZsRAv-YzHHwXKhJHgZPIJRSHvJEmP6UCF_hf9jb1nNVG46tIO0"
}
},
{
param: "crv",
data: {
kty: "EC",
x: "AVb0efjfHiCn_8BM5CDD4VSuJRmWvuQvA0uE1Bt0PzTkXzEbgTqc3sjNpZu7vTHUYLMpJSHnwbci5WZ8A9svrnU_",
y: "AVAXNs_iRzlDINjkr8L9ObWpMxBhuB4iQSgrnheJGCK1t54FL0WXtZZD_Tk3nFG9USXE9IvD8CXOPNNpUyhsyzj7",
d: "APQIdYNoupMPMPdq4FT-XNLOf9osn3am1DbPddZsRAv-YzHHwXKhJHgZPIJRSHvJEmP6UCF_hf9jb1nNVG46tIO0"
}
}
]
};