| OLD | NEW |
| (Empty) |
| 1 Tests deriveKey() with various bad parameters for ECDH | |
| 2 | |
| 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
| 4 | |
| 5 | |
| 6 Importing the private key... | |
| 7 Importing the public key... | |
| 8 | |
| 9 Deriving an AES key with no length... | |
| 10 error is: TypeError: AesDerivedKeyParams: length: Missing required property | |
| 11 | |
| 12 Deriving an AES key with bad length... | |
| 13 error is: OperationError: AES key length must be 128 or 256 bits | |
| 14 | |
| 15 Deriving an AES key with unsupported length... | |
| 16 error is: OperationError: 192-bit AES keys are not supported | |
| 17 | |
| 18 Deriving using an ECDH key that has deriveBits but NOT deriveKey... usage | |
| 19 error is: InvalidAccessError: key.usages does not permit this operation | |
| 20 | |
| 21 Deriving using public instead of private key... | |
| 22 error is: InvalidAccessError: key.usages does not permit this operation | |
| 23 | |
| 24 Deriving using private instead of public key... | |
| 25 error is: InvalidAccessError: The public parameter for ECDH key derivation is no
t a public EC key | |
| 26 | |
| 27 Deriving a key larger than the field size of P-521... | |
| 28 error is: OperationError: Length specified for ECDH key derivation is too large.
Maximum allowed is 528 bits | |
| 29 | |
| 30 Deriving a zero-length HMAC key... | |
| 31 error is: TypeError: HMAC key length must not be zero | |
| 32 | |
| 33 Deriving a key larger than field size of P-521, by requesting an HMAC SHA-512 ke
y with no length... | |
| 34 error is: OperationError: Length specified for ECDH key derivation is too large.
Maximum allowed is 528 bits | |
| 35 | |
| 36 Deriving a key using mismatched curves on public/private keys... | |
| 37 error is: InvalidAccessError: The public parameter for ECDH key derivation is fo
r a different named curve | |
| 38 | |
| 39 Deriving a key using a public EC key for different algorithm (ECDSA)... | |
| 40 error is: InvalidAccessError: The public parameter for ECDH key derivation must
be for ECDH | |
| 41 | |
| 42 Deriving a key using an AES key for public key... | |
| 43 error is: InvalidAccessError: The public parameter for ECDH key derivation is no
t a public EC key | |
| 44 | |
| 45 Deriving a key without specifying the "public" parameter... | |
| 46 error is: TypeError: EcdhKeyDeriveParams: public: Missing required property | |
| 47 | |
| 48 Deriving a key having specified a bogus "public" parameter... | |
| 49 error is: TypeError: EcdhKeyDeriveParams: public: Must be a CryptoKey | |
| 50 | |
| 51 Deriving an ECDH key using ECDH... | |
| 52 error is: NotSupportedError: ECDH: Unsupported operation: get key length | |
| 53 | |
| 54 Deriving an RSA-OAEP key using ECDH... | |
| 55 error is: NotSupportedError: RSA-OAEP: Unsupported operation: get key length | |
| 56 | |
| 57 PASS successfullyParsed is true | |
| 58 | |
| 59 TEST COMPLETE | |
| 60 | |
| OLD | NEW |