This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26214 - Define consistent error when calling exportKey() with unsupported key format
Summary: Define consistent error when calling exportKey() with unsupported key format
Status: RESOLVED FIXED
Alias: None
Product: Web Cryptography
Classification: Unclassified
Component: Web Cryptography API Document (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Ryan Sleevi
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-26 22:32 UTC by Eric Roman
Modified: 2014-09-26 00:46 UTC (History)
2 users (show)

See Also:


Attachments

Description Eric Roman 2014-06-26 22:32:42 UTC
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.
Comment 1 Mark Watson 2014-09-22 17:54:14 UTC
I agree with the proposal to always use NotSupportedError in this case.