This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
When calling importKey() with a "format" that is not applicable to the algorith, the spec says to return a NotSupportedError. So I would expect when calling exportKey() with a format that is not applicable for the key's algorithm, to similarly return a NotSupportedError. However as currently written there are per-algorithm inconsistencies: * The RSA and EC keys define it as returning NotSupported * AES-GCM defines it as DataError * AES-CTR leaves it undefined * AES-CBC leaves it undefined * AES-CMAC leaves it undefined Proposal: Fail with NotSupportedError in all cases.
I agree with the proposal to always use NotSupportedError in this case.
https://dvcs.w3.org/hg/webcrypto-api/rev/5b2b1e7a8d4c https://dvcs.w3.org/hg/webcrypto-api/rev/939143e3319f