hmac-generate-key-expected.txt 1.08 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
Test generating a HMAC key.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS crypto.subtle.generateKey("hmac", extractable, ["sign", "verify"]) threw exception TypeError: Type error.
PASS crypto.subtle.generateKey({name: "hmac"}, extractable, ["sign", "verify"]) threw exception Error: NotSupportedError: DOM Exception 9.
PASS crypto.subtle.generateKey({name: "hmac", length: undefined}, extractable, ["sign", "verify"]) threw exception Error: NotSupportedError: DOM Exception 9.
PASS crypto.subtle.generateKey({name: "hmac", length: {}}, extractable, ["sign", "verify"]) threw exception Error: NotSupportedError: DOM Exception 9.

Generating a key with default length...
PASS key.type is 'secret'
PASS key.extractable is true
PASS key.algorithm.name is 'hmac'
PASS key.algorithm.length is 64
PASS key.usages is ["sign", "verify"]

Generating a key with custom length...
PASS key.type is 'secret'
PASS key.extractable is true
PASS key.algorithm.name is 'hmac'
PASS key.algorithm.length is 5
PASS key.usages is ["sign"]
PASS successfullyParsed is true

TEST COMPLETE