hmac-export-key-expected.txt 1.12 KB
Newer Older
1 2 3 4 5 6
Test exporting an AES key.

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


Importing a JWK key...
7 8 9 10 11
PASS crypto.subtle.exportKey(null, key) threw exception TypeError: Unknown key format.
PASS crypto.subtle.exportKey(undefined, key) threw exception TypeError: Unknown key format.
PASS crypto.subtle.exportKey({}, key) threw exception TypeError: Unknown key format.
PASS crypto.subtle.exportKey("", key) threw exception TypeError: Unknown key format.
PASS crypto.subtle.exportKey("foobar", key) threw exception TypeError: Unknown key format.
12
Exporting the key as raw data...
ap@apple.com's avatar
ap@apple.com committed
13
PASS bytesToHexString(new Uint8Array(exportedData)) is '6a18e49feff7f3b7e09ec89b7f6deab2f6a18e49feff7f3b7e09ec89b7f6deab'
14 15 16 17
Exporting the key as JWK...
PASS exportedJWK.kty is 'oct'
PASS exportedJWK.k is 'ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs'
PASS exportedJWK.alg is 'HS256'
18
PASS exportedJWK.ext is true
19 20 21 22 23 24 25 26
PASS exportedJWK.use is 'sig'

Importing a key that's not extractable...

Trying to export as raw...
PASS Rejected, as expected
Trying to export as jwk...
PASS Rejected, as expected
27 28 29 30
PASS successfullyParsed is true

TEST COMPLETE