[Bug 26214] New: Define consistent error when calling exportKey() with unsupported key format

https://www.w3.org/Bugs/Public/show_bug.cgi?id=26214

            Bug ID: 26214
           Summary: Define consistent error when calling exportKey() with
                    unsupported key format
           Product: Web Cryptography
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Web Cryptography API Document
          Assignee: sleevi@google.com
          Reporter: ericroman@google.com
                CC: public-webcrypto@w3.org

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Thursday, 26 June 2014 22:32:43 UTC