aes-kw-key-manipulation-expected.txt 866 Bytes
Newer Older
ap@apple.com's avatar
ap@apple.com committed
1 2 3 4 5 6 7 8
Test generating, importing and exporting keys for AES-KW. Test that they can't be used with another algorithm.

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


Generating a key...
PASS key.toString() is '[object Key]'
PASS key.type is 'secret'
9
PASS key.algorithm.name is 'AES-KW'
ap@apple.com's avatar
ap@apple.com committed
10 11 12 13 14 15 16 17 18 19
PASS key.algorithm.length is 256

Testing that the key can't be used with AES-CBC...
PASS crypto.subtle.encrypt({name: "aes-cbc", iv: iv}, key, hexStringToUint8Array("00")) threw exception Error: NotSupportedError: DOM Exception 9.

Exporting the key to raw...
PASS exportedKey.toString() is '[object ArrayBuffer]'
Importing it back...
PASS importedKey.toString() is '[object Key]'
PASS importedKey.type is 'secret'
20
PASS importedKey.algorithm.name is 'AES-KW'
ap@apple.com's avatar
ap@apple.com committed
21 22 23 24 25
PASS importedKey.algorithm.length is 256
PASS successfullyParsed is true

TEST COMPLETE