Preserving WebCrypto Key usages in JWK

All,

In bug 23796 [1], I proposed registering new JWK attributes such that a
WebCrypto Key can be exported to JWK and this JWK imported back to
WebCrypto, without losing information.

It's been requested that a use-case for this, specifically for preserving
the WebCrypto usages, be discussed on the list.

So, here is an example. There are others, this is just a simplified one to
illustrate the problem.

Suppose client and server have a shared secret, which on the client side is
stored as a WebCrypto Key, K1, with K1.extractable = false.

Now suppose I wish to deliver a key, K2, to the client, wrapped with K1,
with WebCrypto usage on K2 of "unwrap" and K2.extractable = false.

Now, finally, I will deliver a further key K3, to the client, wrapped with
K2. I also have K3.extractable = false.

We have previously agreed that for the case of wrapped keys, there may be
policy in the WebCrypto implementation which throws an error on conflict
between attributes specified in the wrapped Key and attributes specified in
the upwrap method parameters. I'm assuming we don't have to revisit that
compromise. In this example such a policy is in place.

Using the existing JWK attributes, the best we can do for K2 is specify
use=enc, meaning that the resulting WebCrypto Key has K2.usages = encrypt,
decrypt, wrap and unwrap.

This means that K2 can be used to decrypt the wrapped K3, obtaining a copy
of K3 outside of the WebCrypto implementation. This directly contradicts
the policy that requires K3.extractable = false should be respected.

...Mark

[1]  https://www.w3.org/Bugs/Public/show_bug.cgi?id=23796

Received on Wednesday, 13 November 2013 07:52:18 UTC