Example
var key = await crypto.subtle.generateKey({name: "AES-CBC", length: 256}, true, ["encrypt", "decrypt"]);
var jwk = await crypto.subtle.exportKey("jwk", key);
delete jwk.key_ops
var hmacKey = await crypto.subtle.importKey("jwk", jwk, {name: "AES-KW"}, false, ["wrapKey"]);
DOMException (Chrome)
DOMException: The JWK "alg" member was inconsistent with that specified by the Web Crypto call
Example
var key = await crypto.subtle.generateKey({name: "AES-CBC", length: 256}, true, ["encrypt", "decrypt"]);
var jwk = await crypto.subtle.exportKey("jwk", key);
var hmacKey = await crypto.subtle.importKey("jwk", jwk, {name: "AES-KW"}, false, ["wrapKey"]);
DOMException (Chrome)
DOMException: The JWK "key_ops" member was inconsistent with that specified by the Web Crypto call. The JWK usage must be a superset of those requested
jwk.alg(if presents) withalgorithmargument and throwDOMExceptionif they are not equalExample
DOMException (Chrome)
jwk.key_ops(if presents) withkeyUsagesargument and throwDOMExceptionif they are not equalExample
DOMException (Chrome)