blob: f65f7de10ae1f29098b81ce2c67d759be3d7fab7 [file] [log] [blame]
Test wrapping and unwrapping AES keys with RSA-OAEP.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Importing RSA keys...
Importing an AES key...
Wrapping it...
PASS wrappedKey.toString() is '[object ArrayBuffer]'
Unwrapping it...
PASS unwrappedKey.toString() is '[object CryptoKey]'
PASS unwrappedKey.type is 'secret'
PASS unwrappedKey.extractable is true
PASS unwrappedKey.algorithm.name is 'AES-CBC'
PASS unwrappedKey.algorithm.length is 256
PASS unwrappedKey.usages is ['encrypt', 'decrypt']
Exporting it...
PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
Wrapping the same key as JWK...
PASS wrappedKey.toString() is '[object ArrayBuffer]'
Unwrapping it...
PASS unwrappedKey.toString() is '[object CryptoKey]'
PASS unwrappedKey.type is 'secret'
PASS unwrappedKey.extractable is true
PASS unwrappedKey.algorithm.name is 'AES-CBC'
PASS unwrappedKey.algorithm.length is 256
PASS unwrappedKey.usages is ['encrypt', 'decrypt']
Exporting it...
PASS bytesToHexString(unwrappedKeyData) is bytesToHexString(aesKeyData)
PASS successfullyParsed is true
TEST COMPLETE