Test for unwrapping non-extractable JWKs

All,

I made a PR to add a test for this to the wrap / unwrap tests:
https://github.com/w3c/web-platform-tests/pull/3954.

This only tests wrapping AES-CTR keys with AES-CTR, but it should be easy
to extend to other wrapping types and other wrapped key types.

The reason for the wrapping key restriction is that we need to implement
wrapping of such keys "by hand" using encryptKey, because wrapKey cannot be
called on non-extractable keys. I only implemented it for AES-CTR so far.

The reason for the wrapped key restriction is that we need to compare the
result of the unwrap with the original key, but this cannot be done by
exporting it (it is non-extractable) and so must be done by using it for
something and comparing the result. I only implemented this for AES-CTR so
far.

The new test case passes on Chrome and Firefox at least.

...Mark

Received on Monday, 10 October 2016 16:53:13 UTC